Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Got 500 internal error #8

Open
PimpMySocial opened this issue Jan 18, 2021 · 2 comments
Open

Got 500 internal error #8

PimpMySocial opened this issue Jan 18, 2021 · 2 comments

Comments

@PimpMySocial
Copy link

Hello, everytime I try to get /message, I have an internal 500 error:

500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 171, in call
await super().call(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 102, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 181, in call
raise exc from None
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
raise exc from None
File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 550, in call
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 149, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/usr/local/lib/python3.8/dist-packages/starlette/concurrency.py", line 34, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/dist-packages/signal_cli_rest_api/app/api/api_v1/endpoints/messages.py", line 24, in get_messages
return [json.loads(m) for m in response.split("\n") if m != ""]
AttributeError: 'coroutine' object has no attribute 'split'
/usr/local/lib/python3.8/dist-packages/uvicorn/main.py:390: RuntimeWarning: coroutine 'run_signal_cli_command' was never awaited
loop.run_until_complete(self.serve(sockets=sockets))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

@gimli82
Copy link

gimli82 commented Jan 18, 2021

Same here, the docker image was ok though, Although I didn't want to go for the docker version. In addition, it is impossible to send / receive messages containing anything else than alphanum. It would be a fantastic piece of software otherwise ...

@thielenf
Copy link

I had a similar issue and was able to resolve it by changing the return statement in utils.py, line 86 from: return await process.stdout.readline() to return (await process.stdout.read()).decode()
My understanding is that this allows multiple envelopes to be received by the signal-cli task instead of reading just the first one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants