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

Can not sign in to quivr[Bug]: #2125

Closed
BabakSarf opened this issue Jan 31, 2024 · 2 comments
Closed

Can not sign in to quivr[Bug]: #2125

BabakSarf opened this issue Jan 31, 2024 · 2 comments
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working Stale type: dependencies

Comments

@BabakSarf
Copy link

What happened?

When try to sign in to quiver get a message that can not fetch data
my backend supabase path for supabase is SUPABASE_URL=docker.host.internal:54321
but I get this error when try to reach the path
{oot@dd71254af9bf:/code# curl http://docker.host.internal:54321
curl: (6) Could not resolve host: docker.host.internal
root@dd71254af9bf:/code#
and I get the following error in docker log
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11730:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async globalThis.fetch (/app/.next/server/chunks/75.js:24:164766)
at async e7 (/app/.next/server/chunks/75.js:114:743265)
at async e8 (/app/.next/server/chunks/75.js:114:743009)
at async a (/app/.next/server/chunks/75.js:115:18067)
at async /app/.next/server/chunks/75.js:115:18322 {
cause: Error: connect ECONNREFUSED 127.0.0.1:54321
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 54321
}
}
e0 [AuthRetryableFetchError]: fetch failed
at e7 (/app/.next/server/chunks/75.js:114:743310)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async e8 (/app/.next/server/chunks/75.js:114:743009)
at async a (/app/.next/server/chunks/75.js:115:18067)
at async /app/.next/server/chunks/75.js:115:18322 {
__isAuthError: true,
status: 0

Relevant log output

No response

Twitter / LinkedIn details

No response

@BabakSarf BabakSarf added the bug Something isn't working label Jan 31, 2024
Copy link

dosubot bot commented Jan 31, 2024

🤖

Hey @BabakSarf, great to see you back! Hope you're doing well.

The issue you're experiencing seems to be related to the connection to your database. Your application is trying to connect to a database at 127.0.0.1:54321, but there is no database listening on that address and port. This is indicated by the ECONNREFUSED error you're seeing.

The SUPABASE_URL you've set to docker.host.internal:54321 is not being recognized, which might be due to the fact that this environment variable is not properly set in your Dockerfile or Docker run command.

To resolve this issue, you need to ensure that your database is running and accessible at the address specified by SUPABASE_URL. If your database is running in a separate Docker container, you might need to set up Docker networking to allow the two containers to communicate.

You can set the SUPABASE_URL environment variable in your Dockerfile like this:

# Set environment variables
ENV SUPABASE_URL=docker.host.internal:54321

Or in your Docker run command like this:

docker run -e SUPABASE_URL=docker.host.internal:54321 -p 1337:3000 your-image-name

Please replace your-image-name with the name of your Docker image.

Remember to replace docker.host.internal:54321 with the actual address and port where your Supabase service is running.

As for the structure of the Quivr codebase and how it handles database connections, it does so through a configuration file located at cms/quivr/config/database.js. This file exports a function that takes an environment object as a parameter and returns a configuration object for the database connection. The function first determines the database client to use, defaulting to 'sqlite' if none is specified in the environment variables. It then defines connection settings for four different types of databases: 'mysql', 'mysql2', 'postgres', and 'sqlite'. Each type of database has its own specific settings, such as host, port, database name, username, password, and SSL settings. These settings are retrieved from the environment variables, with default values provided for each one.

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

Best,
Dosu

Sources


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 area: backend Related to backend functionality or under the /backend directory type: dependencies labels Jan 31, 2024
Copy link
Contributor

Thanks for your contributions, we'll be closing this issue as it has gone stale. Feel free to reopen if you'd like to continue the discussion.

@github-actions github-actions bot added the Stale label Apr 30, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
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 Stale type: dependencies
Projects
None yet
Development

No branches or pull requests

1 participant