Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Unable to search for thoughts #15

Closed
phkus opened this issue Feb 7, 2022 · 5 comments
Closed

Unable to search for thoughts #15

phkus opened this issue Feb 7, 2022 · 5 comments

Comments

@phkus
Copy link

phkus commented Feb 7, 2022

Unfortunately I have to open another issue, but we're getting there.

  • my token works now
  • I can save thoughts, or at least I get a response with a filename, metadata, and the embeddings

However, I cannot query for those thoughts. Through the API I just get an internal server error, but through the interface there are more details:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback:
File "/usr/local/lib/python3.9/site-packages/streamlit/script_runner.py", line 379, in _run_script
exec(code, module.dict)
File "/app/main.py", line 19, in
component.paint()
File "/app/components/navigator.py", line 25, in paint
st.session_state['authorized_thoughts'] = knowledge.load(
File "/app/components/knowledge.py", line 45, in load
content = json.loads(response.content)
File "/usr/local/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None

@paulbricman
Copy link
Owner

paulbricman commented Feb 8, 2022

Thanks a lot for not giving up after three issues and helping iron out those quirks, @phkus!

Here it seems the issue happens in the backend, and the frontend simply reports on getting a shitty response in more depth, but doesn't give insight into that internal server error. Could you please send the results of the following?

docker container ls
docker logs <backend container id>

This should give us a more detailed trace of what went wrong in the backend.

@phkus
Copy link
Author

phkus commented Feb 8, 2022

These are the logs that correspond to a single query:

INFO:     172.18.0.3:55070 - "GET /find?token="token"&query=test&relatedness=0.8&activation=0.0&noise=0.01&return_embeddings=False HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 41, in call_next
    message = await recv_stream.receive()
  File "/usr/local/lib/python3.8/dist-packages/anyio/streams/memory.py", line 81, in receive
    return self.receive_nowait()
  File "/usr/local/lib/python3.8/dist-packages/anyio/streams/memory.py", line 74, in receive_nowait
    raise EndOfStream
anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/httptools_impl.py", line 378, 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 75, in call
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 212, in call
    await super().call(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, 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
  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/middleware/base.py", line 63, in call
    response = await self.dispatch_func(request, call_next)
  File "/usr/local/lib/python3.8/dist-packages/slowapi/middleware.py", line 56, in dispatch
    response = await call_next(request)
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 44, in call_next
    raise app_exc
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 34, in coro
    await self.app(scope, request.receive, send_stream.send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
    raise exc
  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 656, in call
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
    response = await func(request)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 250, in app
    response = actual_response_class(response_data, **response_args)
  File "/usr/local/lib/python3.8/dist-packages/starlette/responses.py", line 49, in init
    self.body = self.render(content)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/responses.py", line 33, in render
    assert orjson is not None, "orjson must be installed to use ORJSONResponse"
AssertionError: orjson must be installed to use ORJSONResponse

@paulbricman
Copy link
Owner

Got it, could you rinse and try the latest backend image?

docker rm -f <backend container id>
docker-compose up -d

@phkus
Copy link
Author

phkus commented Feb 8, 2022

As far as I can see everything's working now :-)

Looking forward to trying it out!

@phkus phkus closed this as completed Feb 8, 2022
@paulbricman
Copy link
Owner

Nice, I'm glad! Also, note that the lexiscore / ideoscope are still based on an url to the old conceptarium version, but I'll update those in the upcoming weeks, too. @phkus

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

2 participants