Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Error on KRAGEN backend #87

Open
HyunjunA opened this issue May 13, 2024 · 4 comments
Open

API Error on KRAGEN backend #87

HyunjunA opened this issue May 13, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@HyunjunA
Copy link
Contributor

HyunjunA commented May 13, 2024

Describe the bug
The error shown in the screenshot sometimes occurs when posting a question "Please list five genes associated with Alzheimer's disease" to the Kragen server. Specifically, the POST request to http://127.0.0.1:5050/chat/api/v1/got results in a "500 Internal Server Error." The browser console displays "Failed to fetch data: SyntaxError: Unexpected token '<', '<!doctype '... is not valid JSON," indicating that the server response was not in JSON format as expected. Instead, the server seems to have returned an HTML document (often an error page), which the client-side script attempted to parse as JSON.

To Reproduce
Steps to reproduce the behavior:

  1. Ask KRAGEN the question: 'Please list five genes associated with Alzheimer's disease.
  2. Check if it shows the API call error or not by opening the console on the web.
  3. Please use docker logs to check the API calls and error messages.

Screenshots
image

image
@jay-m-dev
Copy link
Collaborator

Which vector DB are you connected to when you see this error? The full AlzKB vector DB? or the local (test) vector DB?

@HyunjunA
Copy link
Contributor Author

I used the full AlzKB vector DB.

@jay-m-dev
Copy link
Collaborator

jay-m-dev commented May 13, 2024

If the WEAVIATE_URL and WEAVIATE_API_KEY are configured correctly, it works fine. It's likely that you mixed the test and prod WEAVIATE_API_KEYs

During troubleshooting, I found that setting the wrong WEAVIATE_API_KEY causes the IndexError you're experiencing (very likely because no "knowledge* was retrieved.)

We'll need to resolve these tasks:

  • POST /chatapi/v1/got endpoint needs to return a proper result when no "thoughts" are retrieved.
  • Once the first task is fixed, we'll need to make sure a user-friendly message is shown to users (this ties into Add user-friendly responses on the GUI #54)

@HyunjunA Please confirm if you can get this to work with the correct weaviate configuration (i.e. having the right corresponding WEAVIATE_URL and WEAVIATE_API_KEY)

@jay-m-dev jay-m-dev self-assigned this May 13, 2024
@jay-m-dev jay-m-dev added the bug Something isn't working label May 13, 2024
@HyunjunA HyunjunA self-assigned this May 14, 2024
@HyunjunA
Copy link
Contributor Author

@jay-m-dev I believe the WEAVIATE_URL and WEAVIATE_API_KEY are configured correctly. However, I can review with you how they are set up on my local machine.

It is functioning properly, but occasionally, this error occurs.

@jay-m-dev jay-m-dev assigned HyunjunA and unassigned HyunjunA and jay-m-dev May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants