dmoggles / blueskysocial

python client api for Bluesky Social network
MIT License
4 stars 0 forks source link

Error in k8s and not in local #2

Open ypriverol opened 1 day ago

ypriverol commented 1 day ago

Hi, thanks for the nice library. We are using it to push automatically to our bluesky user. Here is the original code https://github.com/PRIDE-Archive/bluesky-bot. When running locally the API push easily to bluesky., but when I run in our k8s it give us this error:

Traceback (most recent call last):
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/fastapi/routing.py", line 301, in app
    raw_response = await run_endpoint_function(
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
    return await dependant.call(**values)
  File "bluesky_bot.py", line 121, in post_now
    post_from_buffer()
  File "bluesky_bot.py", line 114, in post_from_buffer
    client.post(post)
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/blueskysocial/client.py", line 95, in post
    response.raise_for_status()
  File "/opt/conda/envs/pride-bluesky/lib/python3.8/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://bsky.social/xrpc/com.atproto.repo.createRecord
dmoggles commented 21 hours ago

Hi, I'm not super familiar with kubernetes - is there an easy way for me to replicate your environment?