Closed xiaoqib closed 8 months ago
🤖
Hello @xiaoqib,
I hope you're doing well! I'm Dosu, a friendly bot here to assist you with bugs, answer your questions, and guide you to contribute to the Quivr repository.
While we wait for a human maintainer to join us, I'll be reviewing your posted issue. I'll get back to you shortly with a detailed response. Hang tight!
🤖
Hello @xiaoqib,
Nice to meet you! I'm Dosu, an AI assistant here to help you with your issues, answer your questions, and guide you to be a contributor to our Quivr repository. While we wait for a human maintainer to assist you further, feel free to ask me anything. Looking forward to our interaction!
From your description, it seems like there are a few issues that need to be addressed.
Firstly, the "Error occurred while fetching your chats" message suggests that there might be an issue with the chat_router in the backend-core service. This router is responsible for handling chat-related requests. The 404 Not Found and 405 Method Not Allowed errors indicate that the server is unable to find the requested resource or the HTTP method used is not supported for the requested resource. This could be due to incorrect endpoints being hit or the wrong HTTP methods being used. You might want to check your application's API calls to ensure they are correct.
Secondly, the warnings about memory overcommit in the Redis service suggest that your server might be running out of memory. Redis saves changes to the database every 3600 seconds as per your configuration, and if the changes are too large to fit into memory, it could cause issues. You might want to consider reducing the save interval or increasing the server's memory if possible.
Lastly, running the worker with superuser privileges is generally not recommended due to potential security risks. It's advisable to run services with the least privileges necessary. You might want to consider changing this in your configuration.
Regarding the interaction between the backend-core service and the Redis service, as per the provided context, the backend-core service depends on the Redis service as indicated in the docker-compose.dev.yml file. This means that the backend-core service will not start until the Redis service is up and running. However, the exact nature of the interaction (e.g., data exchange, function calls, etc.) is not specified in the provided context. For more detailed information about how backend-core interacts with Redis, you would need to look at the application code within the backend service.
I hope this helps! If you have any more questions or need further clarification, feel free to ask.
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.
@dosu-bot
EMAIL=apple.jp@yitouchina.cn
DOMAIN_NAME=bot.house360.co.jp
API_DOMAIN_NAME=api.house360.co.jp
The configuration for the FRONTEND .env file is as follows:
NEXT_PUBLIC_ENV=production NEXT_PUBLIC_BACKEND_URL=https://bot.house360.co.jp:5050/ NEXT_PUBLIC_FRONTEND_URL=https://bot.house360.co.jp:*/ NEXT_PUBLIC_SUPABASE_URL=xxxxx NEXT_PUBLIC_SUPABASE_ANON_KEY=xxxxxx
NEXT_PUBLIC_GROWTHBOOK_CLIENT_KEY=
NEXT_PUBLIC_JUNE_API_KEY=
NEXT_PUBLIC_E2E_URL=http://localhost:3003/
NEXT_PUBLIC_E2E_EMAIL=
NEXT_PUBLIC_CMS_URL=https://cms.quivr.app/
NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID=
NEXT_PUBLIC_AUTH_MODES=magic_link,password
What is wrong with my configuration?
🤖
From the information you've provided, there are several potential issues that could be causing the errors you're experiencing. Let's go through them one by one:
404 Not Found and 405 Method Not Allowed errors: These errors typically indicate that the server is unable to find the requested resource or the HTTP method used is not allowed. This could be due to incorrect routing or misconfiguration in your backend service. Please ensure that the routes and methods in your backend service match those being requested by the frontend.
Memory overcommit warnings from the Redis service: This warning is usually thrown when the system does not have enough memory to fulfill a request by Redis. You might want to consider increasing the memory allocated to your Docker containers or optimizing your application to use less memory.
Running worker with superuser privileges: It's generally not recommended to run services with superuser privileges due to potential security risks. You might want to consider running your services with a non-root user.
Regarding your FRONTEND .env file configuration, it seems to be correctly set up. However, please ensure that all the URLs and keys are correct and accessible. Also, make sure that the NEXT_PUBLIC_BACKEND_URL
is correctly pointing to your backend service and that the service is running and accessible.
Please note that without access to your backend service configuration and the specific error messages, it's difficult to provide a more precise diagnosis. If you could provide more details about your backend service configuration and the specific error messages, it would be helpful in identifying the root cause of the issues.
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.
@dosu-bot 怎么确保请确保 正确指向后端服务,并且该服务正在运行且可访问。NEXT_PUBLIC_BACKEND_URL,我需要查看哪些文件 或者哪个.env 文件的哪个熟悉需要确认
🤖
To confirm that NEXT_PUBLIC_BACKEND_URL
is correctly pointing to your backend service, you should check the .frontend_env.example
file in the root of the project. This file contains the NEXT_PUBLIC_BACKEND_URL
variable, which should be set to the URL where your backend service is running. In your case, it's currently set to https://bot.house360.co.jp:5050/
.
To verify that the backend service is running and accessible, you can use a tool like curl
or wget
in your terminal, or a web-based tool like Postman. Send a request to the URL specified in NEXT_PUBLIC_BACKEND_URL
and check the response. If the service is running and accessible, you should receive a successful HTTP response.
Here's an example using curl
:
curl -I https://bot.house360.co.jp:5050/
If the service is running, you should see an HTTP/1.1 200 OK (or similar) response. If not, you might see a different status code, or no response at all, indicating that the service is not accessible.
For more information, you can refer to the env.md and .frontend_env.example files in the Quivr repository.
Regarding the Dockerfile for the backend-core service, it's structured as follows:
DEV_MODE
and sets it as an environment variable./code
.DEV_MODE
is set to true
, it also installs debugpy
.uvicorn
with the specified options.You can find the Dockerfile for the backend-core service in the backend/Dockerfile file in the Quivr repository.
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.
🤖
Based on the information you've provided and the context from the Quivr repository, the "Connection refused" error could be due to several reasons:
The backend service might not be running or might not have started successfully. You can check the logs of the backend-core
service to see if it started successfully and is running on port 5050. Use the command docker logs backend-core
to check the logs.
There might be a network issue. The backend-core
service might not be reachable from the frontend
service. You can check the network configuration in your Docker Compose file. Use the command docker network inspect <network-name>
to check the network configuration.
The backend-core
service might not be listening on port 5050. You can check the application code or the Dockerfile of the backend-core
service to see if it's configured to listen on port 5050.
In the Quivr codebase, there is a specific configuration that needs to be set for the backend service to listen on port 5050. In the main.py
file, the uvicorn.run() function should be set to listen on port 5050:
if __name__ == "__main__":
# run main.py to debug backend
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=5050) # Set the port number here
Also, in the docker-compose.yml
file, the backend-core
service should be configured to expose and map to port 5050:
backend-core:
...
ports:
- 5050:5050
And in the Dockerfile, the application should be set to run on port 5050:
CMD ["uvicorn", "main:app", "--reload", "--host", "0.0.0.0", "--port", "5050", "--workers", "6"]
Please check these configurations and let me know if you still encounter the issue.
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.
1. root@iZ6we7nwen3zaknisrym6xZ:~/quivr/backend# docker logs backend-core INFO: Will watch for changes in these directories: ['/code'] WARNING: "workers" flag is ignored when reloading is enabled. INFO: Uvicorn running on http://0.0.0.0:5050 (Press CTRL+C to quit) INFO: Started reloader process [1] using StatReload INFO: Started server process [7] INFO: Waiting for application startup. [INFO] Downloading pandoc from https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb ... 2023-11-16 19:01:03,993:INFO - Downloading pandoc from https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb ... [INFO] Unpacking pandoc-3.1.9-1-amd64.deb to tempfolder... 2023-11-16 19:01:05,825:INFO - Unpacking pandoc-3.1.9-1-amd64.deb to tempfolder... [INFO] Copying pandoc to /root/bin ... 2023-11-16 19:01:06,892:INFO - Copying pandoc to /root/bin ... [INFO] Making /root/bin/pandoc executeable... 2023-11-16 19:01:07,004:INFO - Making /root/bin/pandoc executeable... [INFO] Copying copyright to /root/bin ... 2023-11-16 19:01:07,005:INFO - Copying copyright to /root/bin ... INFO: Application startup complete. INFO: 172.18.0.2:56616 - "GET /.git/config HTTP/1.1" 404 Not Found INFO: 172.18.0.2:56618 - "HEAD / HTTP/1.1" 405 Method Not Allowed INFO: 172.18.0.2:45804 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:34654 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:49182 - "HEAD / HTTP/1.1" 405 Method Not Allowed INFO: 172.18.0.2:46670 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:46670 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:54740 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:54740 - "HEAD /favicon.ico HTTP/1.1" 404 Not Found INFO: 172.18.0.2:45068 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:45068 - "GET /favicon.ico HTTP/1.1" 404 Not Found INFO: 172.18.0.2:55704 - "GET /robots.txt HTTP/1.1" 404 Not Found INFO: 172.18.0.2:55704 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:43258 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:49698 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:49698 - "GET /favicon.ico HTTP/1.1" 404 Not Found INFO: 172.18.0.2:40356 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:47010 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:47010 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:47010 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:47010 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:47010 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:47018 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:50948 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:50948 - "GET /Public/home/js/check.js HTTP/1.1" 404 Not Found INFO: 172.18.0.2:50948 - "GET /static/admin/javascript/hetong.js HTTP/1.1" 404 Not Found INFO: 172.18.0.2:34062 - "HEAD / HTTP/1.1" 405 Method Not Allowed INFO: 172.18.0.2:50430 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:50430 - "GET /Public/home/js/check.js HTTP/1.1" 404 Not Found INFO: 172.18.0.2:50430 - "GET /static/admin/javascript/hetong.js HTTP/1.1" 404 Not Found INFO: 172.18.0.2:55734 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:55734 - "GET /favicon.ico HTTP/1.1" 404 Not Found INFO: 172.18.0.2:57138 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:57138 - "GET /favicon.ico HTTP/1.1" 404 Not Found INFO: 172.18.0.2:50866 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:50866 - "GET /favicon.ico HTTP/1.1" 404 Not Found INFO: 172.18.0.2:36076 - "HEAD / HTTP/1.1" 405 Method Not Allowed INFO: 172.18.0.2:52514 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:38860 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:54758 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:54758 - "GET /favicon.ico HTTP/1.1" 404 Not Found INFO: 172.18.0.2:55762 - "GET / HTTP/1.1" 200 OK INFO: 172.18.0.2:33338 - "GET / HTTP/1.1" 200 OK 这个是服务的日志 我应该怎么修改配置文件
@dosu-bot 关于Redis 内存不足,会导致backend-core 服务 无法正常使用吗?我怎么去查看redis 的内存需求
🤖
Based on the information provided in the Quivr repository, there are no specific configuration settings for the Redis service, including memory requirements. The Redis service is defined in the docker-compose.dev.yml file with a basic configuration that doesn't include any specific memory settings.
However, the warning about memory overcommit you're seeing in your logs could potentially cause issues with the backend-core service if Redis runs out of memory. Redis, like many data stores, requires enough memory to store all the data you're using it for. If it runs out of memory, it could start evicting data or even fail to write new data, which could cause issues with any service that relies on it.
To check the memory requirements of the Redis service, you can use the INFO memory
command in Redis, which provides information about memory usage. This can give you an idea of how much memory Redis is currently using and whether you need to allocate more.
If you find that Redis is using more memory than you have available, you may need to adjust your Redis configuration to better suit your memory constraints. This could involve setting a maxmemory limit, enabling data eviction policies, or optimizing your data structures for memory efficiency.
Please note that these are general Redis performance tuning strategies and may not be applicable to your specific use case. You may need to adjust these strategies based on your specific application requirements and infrastructure constraints.
I hope this helps! If you have any more questions or need further clarification, feel free to ask.
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.
🤖
Hello @dosubot[bot],
Nice to meet you! I'm Dosu, a friendly bot here to assist you with your Quivr-related issues and queries. While you're waiting for a human maintainer, I'm here to help you with bug troubleshooting, answering questions, and even guiding you on how to contribute to the project. Let's get started!
To check the memory usage of the Redis service in Quivr, you can use the docker stats
command followed by the ID of your Redis container. This command will provide real-time statistics about the Docker container, including memory usage. Here's how you can do it:
docker stats <container_id>
Replace <container_id>
with the ID of your Redis container.
If you find that the Redis service is using more memory than expected, you can limit its memory usage by adding a mem_limit
directive under the redis
service in your docker-compose file. Here's an example of how to do it:
redis:
image: redis:latest
container_name: redis
restart: unless-stopped
mem_limit: 500m
ports:
- 6379:6379
In this example, the memory usage of the Redis service is limited to 500 megabytes. You can adjust this value according to your needs.
As for the default memory allocation for the Redis service in the Quivr codebase, I wasn't able to find this information in the repository. It's possible that this information is available elsewhere or I may have missed it. If you have any more questions or need further clarification, feel free to ask.
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.
🤖
From the logs you've provided, it seems like there are a few files that the server is trying to access but can't find, hence the 404 errors. These files include '/favicon.ico', '/Public/home/js/check.js', and '/static/admin/javascript/hetong.js'.
The '/favicon.ico' is a standard file that browsers look for when loading a website. If your application doesn't need a favicon, this error can be safely ignored. However, if you want to get rid of this error, you can add a favicon.ico file to your server's root directory.
The '/Public/home/js/check.js' and '/static/admin/javascript/hetong.js' files seem to be JavaScript files that your application is trying to load. If these files are necessary for your application, you should ensure that they exist in the specified paths. If they are not necessary, you might want to check your application's code to see why it's trying to load these files and possibly remove those references if they are not needed.
As for the error message "Error occurred while fetching your chats", it's hard to say exactly what the issue is without more information. It could be a problem with the server's connection to the database, an issue with the chat data itself, or a bug in the code that fetches the chat data. You might want to check the part of your application that handles chat data to see if you can find any issues.
Regarding the 405 Method Not Allowed errors, these are occurring because your server is receiving HEAD requests but doesn't have a handler set up for them. HEAD is a type of HTTP request method that asks for a response identical to that of a GET request, but without the response body. If your application doesn't need to handle HEAD requests, these errors can be safely ignored. If you do want to handle HEAD requests, you'll need to set up a handler for them in your server's code.
I hope this helps! If you have any more information or if there's anything else you're unsure about, feel free to ask.
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.
🤖
Based on the information you've provided and the context from the Quivr repository, there are a few things that could be causing the issue with the core chat service.
Firstly, the error message "No chat_id provided" suggests that the chat_id
is not being passed correctly to the update_chat
function. This could be due to a problem in the code where this function is being called. You might want to check the part of your code where you're calling this function and ensure that the chat_id
is being correctly passed.
Secondly, the issue could be related to missing or incorrect environment variables. The environment variables in the .env files are crucial for the correct operation of the Quivr application. For example, the SUPABASE_URL
and SUPABASE_SERVICE_KEY
are used to configure the connection to the Supabase backend service, and the OPENAI_API_KEY
is used to configure the OpenAI service. If any of these variables are missing or incorrect, it could cause issues with the core chat service.
In a similar issue found in the Quivr repository, the problem was related to missing API keys for the analytics tools. You might want to check your .env files and ensure that all the necessary API keys are present and correct. You can get these keys from the respective service providers.
Lastly, it's worth noting that the PG_DATABASE_URL
in your Backend/.env file is set to notimplementedyet
. If you're using a PostgreSQL database, you'll need to replace this with the correct database URL.
I hope this helps! If you're still having trouble, could you provide more information about the exact error message you're seeing and the steps you're taking when the error occurs? This will help in diagnosing the problem.
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.
🤖
Yes, the environment variables GOOGLE_APPLICATION_CREDENTIALS
, GOOGLE_CLOUD_PROJECT
, RESEND_API_KEY
, and RESEND_CONTACT_SALES_TO
are indeed mandatory for the operation of Quivr. They are used to authenticate your application with Google Cloud services and the Resend service, as well as to identify your project and specify the recipient's email address for sales inquiries. Here's how you can set them:
GOOGLE_APPLICATION_CREDENTIALS
: This should be set to the path of the JSON file that contains your service account key. This is used to authenticate your application with Google Cloud services.
GOOGLE_CLOUD_PROJECT
: This should be set to the ID of your Google Cloud project. This is used to identify your project when interacting with Google Cloud services.
RESEND_API_KEY
: This should be set to your Resend API key. This is used to authenticate your application with the Resend service.
RESEND_CONTACT_SALES_TO
: This should be set to the recipient's email address for sales inquiries using the "RESEND" service.
Here's an example of how these variables could be set:
GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/service-account-key.json
GOOGLE_CLOUD_PROJECT=your-google-cloud-project-id
RESEND_API_KEY=your-resend-api-key
RESEND_CONTACT_SALES_TO=sales-inquiries@example.com
Please replace the values after the equals sign (=) with your actual values.
In addition to these, there are other environment variables in the backend/.env file that are crucial for Quivr's operation, such as SUPABASE_URL
, SUPABASE_SERVICE_KEY
, OPENAI_API_KEY
, JWT_SECRET_KEY
, CELERY_BROKER_URL
, RESEND_EMAIL_ADDRESS
, RESEND_CONTACT_SALES_FROM
, PREMIUM_MAX_BRAIN_NUMBER
, PREMIUM_MAX_BRAIN_SIZE
, and PREMIUM_DAILY_CHAT_CREDIT
. These should also be correctly set according to their respective purposes.
For more information, you can refer to the .backend_env.example and env.md files in the Quivr repository.
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.
change to this NEXT_PUBLIC_ENV=prod NEXT_PUBLIC_BACKEND_URL=https://api.bot.house360.co.jp NEXT_PUBLIC_FRONTEND_URL=https://bot.house360.co.jp/:*
更改为此 NEXT_PUBLIC_ENV=prod NEXT_PUBLIC_BACKEND_URL=https://api.bot.house360.co.jp NEXT_PUBLIC_FRONTEND_URL=https://bot.house360.co.jp/:*
我没https://api.bot.house360.co.jp 这个域名, 是不是应该api.house360.co.jp ?
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.
What happened?
A bug happened! The error message is: Error occurred while fetching your chats
Relevant log output
Twitter / LinkedIn details
No response