login failed with no exception logs from both the api and the web pod #1135

Closed
opened 2026-02-21 17:30:10 -05:00 by yindo · 4 comments
Owner

Originally created by @dbug-dk on GitHub (Feb 29, 2024).

Originally assigned to: @takatost on GitHub.

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.5.6

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

i use the image to deploy some pods in my k8s cluster。after deploy complete and reset password,I am unable to log in, and I can only see error messages in the Chrome console. When I check the logs of the Nginx, API, and web pods using kubectl logs, there are no error outputs.
image

I have created a service for each pod and use these services for communication, which also results in the web and API having different domain names.

Is it necessary for the api and the web to use the same domain name?

To add on, I can successfully make a login request to the API using curl from the Nginx pod.

image

my nginx default.conf is as follows:
server {
listen 80;
server_name _;

location /console/api {
  proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001;
  include proxy.conf;
  add_header 'Access-Control-Allow-Origin' '*';
  add_header 'Access-Control-Allow-Methods' '*';
  add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With';
  add_header 'Access-Control-Allow-Credentials' 'true';
}

location /api {
  proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001;
  include proxy.conf;
  add_header 'Access-Control-Allow-Origin' '*';
  add_header 'Access-Control-Allow-Methods' '*';
  add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With';
  add_header 'Access-Control-Allow-Credentials' 'true';
}

location /v1 {
  proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001;
  include proxy.conf;
  add_header 'Access-Control-Allow-Origin' '*';
  add_header 'Access-Control-Allow-Methods' '*';
  add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With';
  add_header 'Access-Control-Allow-Credentials' 'true';
}

location /files {
  proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001;
  include proxy.conf;
  add_header 'Access-Control-Allow-Origin' '*';
  add_header 'Access-Control-Allow-Methods' '*';
  add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With';
  add_header 'Access-Control-Allow-Credentials' 'true';
}

location / {
  proxy_pass http://difyapi-web-service.difyapi.svc.cluster.local:3000;
  include proxy.conf;
  add_header 'Access-Control-Allow-Origin' '*';
  add_header 'Access-Control-Allow-Methods' '*';
  add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With';
  add_header 'Access-Control-Allow-Credentials' 'true';
}

}

✔️ Expected Behavior

login success

Actual Behavior

can not login

Originally created by @dbug-dk on GitHub (Feb 29, 2024). Originally assigned to: @takatost on GitHub. ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Pleas do not modify this template :) and fill in all the required fields. ### Dify version 0.5.6 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce i use the image to deploy some pods in my k8s cluster。after deploy complete and reset password,I am unable to log in, and I can only see error messages in the Chrome console. When I check the logs of the Nginx, API, and web pods using kubectl logs, there are no error outputs. ![image](https://github.com/langgenius/dify/assets/7811716/e7250de2-9082-4984-9ad6-3818664c121d) I have created a service for each pod and use these services for communication, which also results in the web and API having different domain names. Is it necessary for the api and the web to use the same domain name? To add on, I can successfully make a login request to the API using curl from the Nginx pod. ![image](https://github.com/langgenius/dify/assets/7811716/49c3cade-6af3-4898-8245-b0a5e65a3d99) my nginx default.conf is as follows: server { listen 80; server_name _; location /console/api { proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001; include proxy.conf; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With'; add_header 'Access-Control-Allow-Credentials' 'true'; } location /api { proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001; include proxy.conf; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With'; add_header 'Access-Control-Allow-Credentials' 'true'; } location /v1 { proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001; include proxy.conf; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With'; add_header 'Access-Control-Allow-Credentials' 'true'; } location /files { proxy_pass http://difyapi-api-service.difyapi.svc.cluster.local:5001; include proxy.conf; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With'; add_header 'Access-Control-Allow-Credentials' 'true'; } location / { proxy_pass http://difyapi-web-service.difyapi.svc.cluster.local:3000; include proxy.conf; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With'; add_header 'Access-Control-Allow-Credentials' 'true'; } } ### ✔️ Expected Behavior login success ### ❌ Actual Behavior can not login
yindo added the 🐞 bug label 2026-02-21 17:30:10 -05:00
yindo closed this issue 2026-02-21 17:30:10 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 29, 2024):

🤖

Hey @dbug-dk! Great to see you back here 🚀

Based on the information you've provided and the similar issues I found in the repository, it seems like your issue might be related to a known login issue that was addressed in previous versions of Dify.

In one of the issues, a temporary solution was suggested which involves restoring three lines of code from a previous commit. You can do this by checking out the specific commit with the command:

git checkout 9df0dcedae2a3a0773f8c7bf777d8f23f677760c

For a long-term solution, it was suggested to wait for the release of tag v0.3.24, which should resolve the problem. However, since you're using version 0.5.6, this solution might not be applicable.

Regarding your question about the necessity of the API and the web to use the same domain name, it is not necessary for them to be on the same domain for successful login. The documentation provides configurations for both same domain and cross-domain setups. For cross-domain scenarios, specific CORS and cookie policy configurations are recommended.

Unfortunately, I couldn't find any specific changes made in Dify version 0.5.7 that could potentially address the login issue you're experiencing in version 0.5.6. It would be helpful if you could provide more details about the error messages you're seeing in the Chrome console. This could help in identifying the root cause of the issue.

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[bot] commented on GitHub (Feb 29, 2024): _🤖_ <!-- Greeting --> Hey @dbug-dk! Great to see you back here 🚀 <!-- Answer --> Based on the information you've provided and the similar issues I found in the repository, it seems like your issue might be related to a known login issue that was addressed in previous versions of Dify. In one of the [issues](https://github.com/langgenius/dify/issues/1243), a temporary solution was suggested which involves restoring three lines of code from a previous commit. You can do this by checking out the specific commit with the command: ``` git checkout 9df0dcedae2a3a0773f8c7bf777d8f23f677760c ``` For a long-term solution, it was suggested to wait for the release of tag v0.3.24, which should resolve the problem. However, since you're using version 0.5.6, this solution might not be applicable. Regarding your question about the necessity of the API and the web to use the same domain name, it is not necessary for them to be on the same domain for successful login. The [documentation](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/install-faq.md) provides configurations for both same domain and cross-domain setups. For cross-domain scenarios, specific CORS and cookie policy configurations are recommended. Unfortunately, I couldn't find any specific changes made in Dify version 0.5.7 that could potentially address the login issue you're experiencing in version 0.5.6. It would be helpful if you could provide more details about the error messages you're seeing in the Chrome console. This could help in identifying the root cause of the issue. ## Sources - [通过docker本地部署dify,登录提示404](https://github.com/langgenius/dify/issues/1827) - [docker部署后无法登录,反复卡在登录页面](https://github.com/langgenius/dify/issues/1257) - [login failed](https://github.com/langgenius/dify/issues/1243) - [en/getting-started/install-self-hosted/install-faq.md](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/install-faq.md) <!-- Dosu Comment Footer --> <details open> <summary> #### About Dosu </summary> 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. </details>
Author
Owner

@takatost commented on GitHub (Mar 1, 2024):

If the front-end and back-end are not on the same domain, you need to set the corresponding URL as mentioned in the help document below:

https://docs.dify.ai/getting-started/install-self-hosted/environments#console_api_url

@takatost commented on GitHub (Mar 1, 2024): If the front-end and back-end are not on the same domain, you need to set the corresponding URL as mentioned in the help document below: https://docs.dify.ai/getting-started/install-self-hosted/environments#console_api_url
Author
Owner

@dbug-dk commented on GitHub (Mar 1, 2024):

If the front-end and back-end are not on the same domain, you need to set the corresponding URL as mentioned in the help document below:

https://docs.dify.ai/getting-started/install-self-hosted/environments#console_api_url

Thank you for reply。I have already set all the environments on my pod。
CONSOLE_WEB_URL="http://difyapi-web-service.difyapi.svc.cluster.local:3000"
CONSOLE_API_URL="http://difyapi-api-service.difyapi.svc.cluster.local:5001"
SERVICE_API_URL="http://difyapi-api-service.difyapi.svc.cluster.local:5001"
APP_WEB_URL="http://difyapi-web-service.difyapi.svc.cluster.local:3000"

is there anything wrong or missing?

@dbug-dk commented on GitHub (Mar 1, 2024): > If the front-end and back-end are not on the same domain, you need to set the corresponding URL as mentioned in the help document below: > > https://docs.dify.ai/getting-started/install-self-hosted/environments#console_api_url Thank you for reply。I have already set all the environments on my pod。 CONSOLE_WEB_URL="http://difyapi-web-service.difyapi.svc.cluster.local:3000" CONSOLE_API_URL="http://difyapi-api-service.difyapi.svc.cluster.local:5001" SERVICE_API_URL="http://difyapi-api-service.difyapi.svc.cluster.local:5001" APP_WEB_URL="http://difyapi-web-service.difyapi.svc.cluster.local:3000" is there anything wrong or missing?
Author
Owner

@dbug-dk commented on GitHub (Mar 14, 2024):

CONSOLE_API_URL and CONSOLE_WEB_URL all set as the nginx service domain name can solve this problem

@dbug-dk commented on GitHub (Mar 14, 2024): CONSOLE_API_URL and CONSOLE_WEB_URL all set as the nginx service domain name can solve this problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1135