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

backend-core error in "http://localhost:5050/user/identity" [Bug]: #2454

Open
Braga-source opened this issue Apr 19, 2024 · 4 comments
Open
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working

Comments

@Braga-source
Copy link

What happened?

It was expected that the Quivr application would function correctly, but with the errors, it is not possible to create brains, for example.

Relevant log output

Installation: Ubuntu 22
The installation guide from the Quivr GitHub page was followed.

The installation proceeds smoothly without errors, and the installation of supabse also presents no issues.

The error is verified when attempting to create a brain, and inspecting the page in Google Chrome, it's possible to see that the error occurs at "http://localhost:5050/brains/" with the message "Not authenticated".

Twitter / LinkedIn details

No response

@Braga-source Braga-source added the bug Something isn't working label Apr 19, 2024
Copy link

dosubot bot commented Apr 19, 2024

It looks like the issue you're encountering with authentication when trying to create a brain in the Quivr application is likely due to one of several potential misconfigurations or mismatches in your setup. Here's what you should check and adjust to resolve the problem:

  1. Environment Variable Configuration: Ensure the NEXT_PUBLIC_AUTH_MODES is correctly set to include all intended authentication modes. This variable controls which authentication methods are available, such as password, magic link, and Google SSO.

  2. Authentication Mode Support: Verify that the authentication mode you're trying to use is enabled and supported. If you're using a mode that's not listed in NEXT_PUBLIC_AUTH_MODES, authentication will fail.

  3. Supabase Integration: Double-check your Supabase setup, including API keys and redirect URIs for SSO. Incorrect configuration here can prevent successful authentication.

  4. Frontend and Backend Consistency: Make sure that the authentication modes expected by the backend align with those enabled in the frontend. Any mismatch can lead to issues.

For more detailed troubleshooting, consider reviewing the code in backend/modules/brain/service/brain_authorization_service.py and frontend/lib/hooks/useAuthModes.ts.

If these steps don't resolve the issue, providing more specific error messages or logs could help pinpoint the exact problem.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the area: backend Related to backend functionality or under the /backend directory label Apr 19, 2024
@Braga-source
Copy link
Author

@dosu-bot

"It was done the alterations that were suggested but the problem persists.
Configuration of the .env file:"

QUIVR Configuration

This file is used to configure the Quivr stack. It is used by the docker-compose.yml file to configure the stack.

OPENAI. Update this to use your API key. To skip OpenAI integration use a fake key, for example: tk-aabbccddAABBCCDDEeFfGgHhIiJKLmnopjklMNOPqQqQqQqQ

OPENAI_API_KEY=sk-voCNLgel8xcjYElMaU1qT3

LOCAL

OLLAMA_API_BASE_URL=http://host.docker.internal:11434 # Uncomment to activate ollama. This is the local url for the ollama api

########

FRONTEND

########

NEXT_PUBLIC_ENV=local
NEXT_PUBLIC_BACKEND_URL=http://localhost:5050
NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
NEXT_PUBLIC_CMS_URL=https://cms.quivr.app
NEXT_PUBLIC_FRONTEND_URL=http://localhost:*
NEXT_PUBLIC_AUTH_MODES=magic_link,google_sso,password

########

BACKEND

########

SUPABASE_URL=http://host.docker.internal:54321
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
PG_DATABASE_URL=notimplementedyet
ANTHROPIC_API_KEY=null
JWT_SECRET_KEY=super-secret-jwt-token-with-at-least-32-characters-long
AUTHENTICATE=true
TELEMETRY_ENABLED=true
CELERY_BROKER_URL=redis://redis:6379/0
CELEBRY_BROKER_QUEUE_NAME=quivr-preview.fifo
QUIVR_DOMAIN=http://localhost:3000/

Copy link

dosubot bot commented Apr 19, 2024

Given the detailed configuration you've shared and the persistent "Not authenticated" error, it seems the issue might still be related to the authentication process, despite the correct setup in your .env file. Here are some targeted steps to troubleshoot and potentially resolve the issue:

  1. Verify Supabase Service Key and URL: Double-check that the SUPABASE_SERVICE_KEY and SUPABASE_URL are correct and match the details in your Supabase project settings. These are crucial for backend communication with Supabase.

  2. Ensure Environment Variables Are Loaded: Confirm that your application is correctly loading the environment variables. Sometimes, issues in loading .env files can lead to authentication failures due to missing or incorrect configurations.

  3. Review Authentication Logic: Since the error occurs when attempting to create a brain, which requires authentication, closely examine the authentication logic in your application. This includes how tokens are handled, ensuring they're valid and not expired.

  4. Debugging and Error Logging: Enhance error handling and logging around the authentication process. This can provide clearer insights into what might be going wrong during the authentication phase.

  5. Check for Service Disruptions: Ensure there are no issues or outages with the authentication service you're using (e.g., Supabase) that might be affecting authentication operations.

If these steps do not resolve the issue, consider providing more specific error messages or logs from the authentication process. This additional information could be crucial in pinpointing the exact cause of the authentication failure.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@StanGirard
Copy link
Collaborator

Hey my friend, can you try to git pull and rerun the docker compose up ?

Or else, follow this procedure if on your own vps: https://docs.quivr.app/deployment/digital_ocean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants