The install(Account registration) page keeps getting stuck, verions: 0.6.8, 0.6.9, 0.6.10 #3983

Closed
opened 2026-02-21 18:04:14 -05:00 by yindo · 11 comments
Owner

Originally created by @dyh2024 on GitHub (Jun 5, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8, 0.6.9, 0.6.10

Cloud or Self Hosted

Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

Deploy dify strictly follow the document of https://docs.dify.ai/getting-started/install-self-hosted/local-source-code , or strictly follow the document of https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, Both appear the install(Account registration) page keeps getting stuck。 But succeed follow the document of https://docs.dify.ai/getting-started/install-self-hosted/docker-compose on the same Tencent Cloud Server 。

✔️ Expected Behavior

User registration page

Actual Behavior

1

Originally created by @dyh2024 on GitHub (Jun 5, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.8, 0.6.9, 0.6.10 ### Cloud or Self Hosted Self Hosted (Docker), Self Hosted (Source) ### Steps to reproduce Deploy dify strictly follow the document of https://docs.dify.ai/getting-started/install-self-hosted/local-source-code , or strictly follow the document of https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, Both appear the install(Account registration) page keeps getting stuck。 But succeed follow the document of https://docs.dify.ai/getting-started/install-self-hosted/docker-compose on the same Tencent Cloud Server 。 ### ✔️ Expected Behavior User registration page ### ❌ Actual Behavior ![1](https://github.com/langgenius/dify/assets/171358568/3ea4c17e-c3ca-445e-8b4d-3b40c85448b4)
yindo added the 🙏 help wanted🤔 cant-reproduce labels 2026-02-21 18:04:14 -05:00
yindo closed this issue 2026-02-21 18:04:14 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 5, 2024):

@dyh2024 Hello there! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to resolve this issue.

The account registration page getting stuck when deploying Dify versions 0.6.8, 0.6.9, and 0.6.10 using self-hosted (Docker) and self-hosted (Source) setups on a Tencent Cloud Server, but not when using Docker Compose deployment, may be due to CORS (Cross-Origin Resource Sharing) issues.

To resolve this, ensure that the CORS configuration is correctly set in your deployment setup. Specifically, update the following configuration items in your environment variables to match your domain name:

CONSOLE_API_URL: The backend URL of the console API.
CONSOLE_WEB_URL: The front-end URL of the console web.
SERVICE_API_URL: Service API Url.
APP_API_URL: WebApp API backend Url.
APP_WEB_URL: WebApp Url.

Additionally, ensure that the CORS settings are properly configured:

CONSOLE_CORS_ALLOW_ORIGINS: The CORS policy for the console, default is `*`.
WEB_API_CORS_ALLOW_ORIGINS: The CORS policy for the WebApp, default is `*`.

This configuration ensures that the front end and back end are correctly aligned, preventing CORS issues that could cause the registration page to get stuck.

Furthermore, ensure that the following environment variables are properly configured in your docker-compose.yaml file:

CONSOLE_WEB_URL: 'http://your-console-web-url'
CONSOLE_API_URL: 'http://your-console-api-url'
SERVICE_API_URL: 'http://your-service-api-url'
APP_WEB_URL: 'http://your-app-web-url'
WEB_API_CORS_ALLOW_ORIGINS: '*'
CONSOLE_CORS_ALLOW_ORIGINS: '*'

By ensuring these configurations are correctly set, you can avoid CORS issues and ensure the account registration page functions properly [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 5, 2024): <!-- Greeting --> @dyh2024 Hello there! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to resolve this issue. <!-- Answer --> The account registration page getting stuck when deploying Dify versions 0.6.8, 0.6.9, and 0.6.10 using self-hosted (Docker) and self-hosted (Source) setups on a Tencent Cloud Server, but not when using Docker Compose deployment, may be due to CORS (Cross-Origin Resource Sharing) issues. To resolve this, ensure that the CORS configuration is correctly set in your deployment setup. Specifically, update the following configuration items in your environment variables to match your domain name: ```yaml CONSOLE_API_URL: The backend URL of the console API. CONSOLE_WEB_URL: The front-end URL of the console web. SERVICE_API_URL: Service API Url. APP_API_URL: WebApp API backend Url. APP_WEB_URL: WebApp Url. ``` Additionally, ensure that the CORS settings are properly configured: ```yaml CONSOLE_CORS_ALLOW_ORIGINS: The CORS policy for the console, default is `*`. WEB_API_CORS_ALLOW_ORIGINS: The CORS policy for the WebApp, default is `*`. ``` This configuration ensures that the front end and back end are correctly aligned, preventing CORS issues that could cause the registration page to get stuck. Furthermore, ensure that the following environment variables are properly configured in your `docker-compose.yaml` file: ```yaml CONSOLE_WEB_URL: 'http://your-console-web-url' CONSOLE_API_URL: 'http://your-console-api-url' SERVICE_API_URL: 'http://your-service-api-url' APP_WEB_URL: 'http://your-app-web-url' WEB_API_CORS_ALLOW_ORIGINS: '*' CONSOLE_CORS_ALLOW_ORIGINS: '*' ``` By ensuring these configurations are correctly set, you can avoid CORS issues and ensure the account registration page functions properly <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/install-faq.md)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.middleware.yaml)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/getting-started/install-self-hosted/environments.md)</sup><sup>[[4]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jun 5, 2024):

Please check your env vars.

@crazywoola commented on GitHub (Jun 5, 2024): Please check your env vars.
Author
Owner

@dyh2024 commented on GitHub (Jun 5, 2024):

Please check your env vars.

My env vars consistent with the documentation( https://docs.dify.ai/getting-started/install-self-hosted/local-source-code,https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container), and keep the same with default values, no modifications . for examples:api/.env , web/.env.local . Do I need to modify the default vars? for example :CONSOLE_API_URL=http://127.0.0.1:5001 and NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api

@dyh2024 commented on GitHub (Jun 5, 2024): > Please check your env vars. My env vars consistent with the documentation( https://docs.dify.ai/getting-started/install-self-hosted/local-source-code,https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container), and keep the same with default values, no modifications . for examples:api/.env , web/.env.local . Do I need to modify the default vars? for example :CONSOLE_API_URL=http://127.0.0.1:5001 and NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api
Author
Owner

@dyh2024 commented on GitHub (Jun 5, 2024):

@dyh2024 Hello there! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to resolve this issue.

The account registration page getting stuck when deploying Dify versions 0.6.8, 0.6.9, and 0.6.10 using self-hosted (Docker) and self-hosted (Source) setups on a Tencent Cloud Server, but not when using Docker Compose deployment, may be due to CORS (Cross-Origin Resource Sharing) issues.

To resolve this, ensure that the CORS configuration is correctly set in your deployment setup. Specifically, update the following configuration items in your environment variables to match your domain name:

CONSOLE_API_URL: The backend URL of the console API.
CONSOLE_WEB_URL: The front-end URL of the console web.
SERVICE_API_URL: Service API Url.
APP_API_URL: WebApp API backend Url.
APP_WEB_URL: WebApp Url.

Additionally, ensure that the CORS settings are properly configured:

CONSOLE_CORS_ALLOW_ORIGINS: The CORS policy for the console, default is `*`.
WEB_API_CORS_ALLOW_ORIGINS: The CORS policy for the WebApp, default is `*`.

This configuration ensures that the front end and back end are correctly aligned, preventing CORS issues that could cause the registration page to get stuck.

Furthermore, ensure that the following environment variables are properly configured in your docker-compose.yaml file:

CONSOLE_WEB_URL: 'http://your-console-web-url'
CONSOLE_API_URL: 'http://your-console-api-url'
SERVICE_API_URL: 'http://your-service-api-url'
APP_WEB_URL: 'http://your-app-web-url'
WEB_API_CORS_ALLOW_ORIGINS: '*'
CONSOLE_CORS_ALLOW_ORIGINS: '*'

By ensuring these configurations are correctly set, you can avoid CORS issues and ensure the account registration page functions properly [1][2][3][4].

To continue talking to Dosu, mention @dosu.

I was started from local source (https://docs.dify.ai/getting-started/install-self-hosted/local-source-code), where(in which files) should i to configure these environment variables?

@dyh2024 commented on GitHub (Jun 5, 2024): > @dyh2024 Hello there! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to resolve this issue. > > The account registration page getting stuck when deploying Dify versions 0.6.8, 0.6.9, and 0.6.10 using self-hosted (Docker) and self-hosted (Source) setups on a Tencent Cloud Server, but not when using Docker Compose deployment, may be due to CORS (Cross-Origin Resource Sharing) issues. > > To resolve this, ensure that the CORS configuration is correctly set in your deployment setup. Specifically, update the following configuration items in your environment variables to match your domain name: > > ```yaml > CONSOLE_API_URL: The backend URL of the console API. > CONSOLE_WEB_URL: The front-end URL of the console web. > SERVICE_API_URL: Service API Url. > APP_API_URL: WebApp API backend Url. > APP_WEB_URL: WebApp Url. > ``` > > Additionally, ensure that the CORS settings are properly configured: > > ```yaml > CONSOLE_CORS_ALLOW_ORIGINS: The CORS policy for the console, default is `*`. > WEB_API_CORS_ALLOW_ORIGINS: The CORS policy for the WebApp, default is `*`. > ``` > > This configuration ensures that the front end and back end are correctly aligned, preventing CORS issues that could cause the registration page to get stuck. > > Furthermore, ensure that the following environment variables are properly configured in your `docker-compose.yaml` file: > > ```yaml > CONSOLE_WEB_URL: 'http://your-console-web-url' > CONSOLE_API_URL: 'http://your-console-api-url' > SERVICE_API_URL: 'http://your-service-api-url' > APP_WEB_URL: 'http://your-app-web-url' > WEB_API_CORS_ALLOW_ORIGINS: '*' > CONSOLE_CORS_ALLOW_ORIGINS: '*' > ``` > > By ensuring these configurations are correctly set, you can avoid CORS issues and ensure the account registration page functions properly [[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/install-faq.md)[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.middleware.yaml)[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/getting-started/install-self-hosted/environments.md)[[4]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml). > > _To continue talking to [Dosu](https://dosu.dev), mention @dosu._ I was started from local source (https://docs.dify.ai/getting-started/install-self-hosted/local-source-code), where(in which files) should i to configure these environment variables?
Author
Owner

@dosubot[bot] commented on GitHub (Jun 5, 2024):

To configure the environment variables when starting from the local source, you should modify the .env files for the API and web services. Here are the steps:

  1. API Service Configuration:

    • Navigate to the api directory:
      cd api
      
    • Copy the environment variable configuration file:
      cp .env.example .env
      
    • Modify the .env file to include the necessary environment variables:
      CONSOLE_API_URL=http://127.0.0.1:5001
      CONSOLE_WEB_URL=http://127.0.0.1:3000
      SERVICE_API_URL=http://127.0.0.1:5001
      APP_API_URL=http://127.0.0.1:5001/api
      APP_WEB_URL=http://127.0.0.1:3000
      
  2. Web Frontend Configuration:

    • Navigate to the web directory:
      cd web
      
    • Create a file named .env.local and copy the contents from .env.example. Modify the values of these environment variables:
      NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api
      NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api
      
  3. CORS Configuration:

    • Ensure that the CORS settings are properly configured in your .env files:
      CONSOLE_CORS_ALLOW_ORIGINS=*
      WEB_API_CORS_ALLOW_ORIGINS=*
      

After modifying these files, you need to rebuild and restart your services for the changes to take effect.

For more detailed configuration options, you can refer to the environments.md file in the Dify documentation [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 5, 2024): <!-- Answer --> To configure the environment variables when starting from the local source, you should modify the `.env` files for the API and web services. Here are the steps: 1. **API Service Configuration:** - Navigate to the `api` directory: ```bash cd api ``` - Copy the environment variable configuration file: ```bash cp .env.example .env ``` - Modify the `.env` file to include the necessary environment variables: ```env CONSOLE_API_URL=http://127.0.0.1:5001 CONSOLE_WEB_URL=http://127.0.0.1:3000 SERVICE_API_URL=http://127.0.0.1:5001 APP_API_URL=http://127.0.0.1:5001/api APP_WEB_URL=http://127.0.0.1:3000 ``` 2. **Web Frontend Configuration:** - Navigate to the `web` directory: ```bash cd web ``` - Create a file named `.env.local` and copy the contents from `.env.example`. Modify the values of these environment variables: ```env NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api ``` 3. **CORS Configuration:** - Ensure that the CORS settings are properly configured in your `.env` files: ```env CONSOLE_CORS_ALLOW_ORIGINS=* WEB_API_CORS_ALLOW_ORIGINS=* ``` After modifying these files, you need to rebuild and restart your services for the changes to take effect. For more detailed configuration options, you can refer to the `environments.md` file in the Dify documentation <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/environments.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/local-source-code.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@dyh2024 commented on GitHub (Jun 5, 2024):

To configure the environment variables when starting from the local source, you should modify the .env files for the API and web services. Here are the steps:

  1. API Service Configuration:

    • Navigate to the api directory:
      cd api
      
    • Copy the environment variable configuration file:
      cp .env.example .env
      
    • Modify the .env file to include the necessary environment variables:
      CONSOLE_API_URL=http://127.0.0.1:5001
      CONSOLE_WEB_URL=http://127.0.0.1:3000
      SERVICE_API_URL=http://127.0.0.1:5001
      APP_API_URL=http://127.0.0.1:5001/api
      APP_WEB_URL=http://127.0.0.1:3000
      
  2. Web Frontend Configuration:

    • Navigate to the web directory:
      cd web
      
    • Create a file named .env.local and copy the contents from .env.example. Modify the values of these environment variables:
      NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api
      NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api
      
  3. CORS Configuration:

    • Ensure that the CORS settings are properly configured in your .env files:
      CONSOLE_CORS_ALLOW_ORIGINS=*
      WEB_API_CORS_ALLOW_ORIGINS=*
      

After modifying these files, you need to rebuild and restart your services for the changes to take effect.

For more detailed configuration options, you can refer to the environments.md file in the Dify documentation [1][2].

To continue talking to Dosu, mention @dosu.

Configure the environment variables as same as above-mentioned, but the problem remain!

@dyh2024 commented on GitHub (Jun 5, 2024): > To configure the environment variables when starting from the local source, you should modify the `.env` files for the API and web services. Here are the steps: > > 1. **API Service Configuration:** > > * Navigate to the `api` directory: > ```shell > cd api > ``` > * Copy the environment variable configuration file: > ```shell > cp .env.example .env > ``` > * Modify the `.env` file to include the necessary environment variables: > ```dotenv > CONSOLE_API_URL=http://127.0.0.1:5001 > CONSOLE_WEB_URL=http://127.0.0.1:3000 > SERVICE_API_URL=http://127.0.0.1:5001 > APP_API_URL=http://127.0.0.1:5001/api > APP_WEB_URL=http://127.0.0.1:3000 > ``` > 2. **Web Frontend Configuration:** > > * Navigate to the `web` directory: > ```shell > cd web > ``` > * Create a file named `.env.local` and copy the contents from `.env.example`. Modify the values of these environment variables: > ```dotenv > NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api > NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api > ``` > 3. **CORS Configuration:** > > * Ensure that the CORS settings are properly configured in your `.env` files: > ```dotenv > CONSOLE_CORS_ALLOW_ORIGINS=* > WEB_API_CORS_ALLOW_ORIGINS=* > ``` > > After modifying these files, you need to rebuild and restart your services for the changes to take effect. > > For more detailed configuration options, you can refer to the `environments.md` file in the Dify documentation [[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/environments.md)[[2]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/local-source-code.md). > > _To continue talking to [Dosu](https://dosu.dev), mention @dosu._ Configure the environment variables as same as above-mentioned, but the problem remain!
Author
Owner

@dyh2024 commented on GitHub (Jun 5, 2024):

图片2

To configure the environment variables when starting from the local source, you should modify the .env files for the API and web services. Here are the steps:

  1. API Service Configuration:

    • Navigate to the api directory:
      cd api
      
    • Copy the environment variable configuration file:
      cp .env.example .env
      
    • Modify the .env file to include the necessary environment variables:
      CONSOLE_API_URL=http://127.0.0.1:5001
      CONSOLE_WEB_URL=http://127.0.0.1:3000
      SERVICE_API_URL=http://127.0.0.1:5001
      APP_API_URL=http://127.0.0.1:5001/api
      APP_WEB_URL=http://127.0.0.1:3000
      
  2. Web Frontend Configuration:

    • Navigate to the web directory:
      cd web
      
    • Create a file named .env.local and copy the contents from .env.example. Modify the values of these environment variables:
      NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api
      NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api
      
  3. CORS Configuration:

    • Ensure that the CORS settings are properly configured in your .env files:
      CONSOLE_CORS_ALLOW_ORIGINS=*
      WEB_API_CORS_ALLOW_ORIGINS=*
      

After modifying these files, you need to rebuild and restart your services for the changes to take effect.
For more detailed configuration options, you can refer to the environments.md file in the Dify documentation [1][2].
To continue talking to Dosu, mention @dosu.

Configure the environment variables as same as above-mentioned, but the problem remain!
图片1
图片2

@dyh2024 commented on GitHub (Jun 5, 2024): ![图片2](https://github.com/langgenius/dify/assets/171358568/aa823eb3-2564-4327-8633-f3458f3815ff) > > To configure the environment variables when starting from the local source, you should modify the `.env` files for the API and web services. Here are the steps: > > > > 1. **API Service Configuration:** > > > > * Navigate to the `api` directory: > > ```shell > > cd api > > ``` > > * Copy the environment variable configuration file: > > ```shell > > cp .env.example .env > > ``` > > * Modify the `.env` file to include the necessary environment variables: > > ```dotenv > > CONSOLE_API_URL=http://127.0.0.1:5001 > > CONSOLE_WEB_URL=http://127.0.0.1:3000 > > SERVICE_API_URL=http://127.0.0.1:5001 > > APP_API_URL=http://127.0.0.1:5001/api > > APP_WEB_URL=http://127.0.0.1:3000 > > ``` > > 2. **Web Frontend Configuration:** > > > > * Navigate to the `web` directory: > > ```shell > > cd web > > ``` > > * Create a file named `.env.local` and copy the contents from `.env.example`. Modify the values of these environment variables: > > ```dotenv > > NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api > > NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api > > ``` > > 3. **CORS Configuration:** > > > > * Ensure that the CORS settings are properly configured in your `.env` files: > > ```dotenv > > CONSOLE_CORS_ALLOW_ORIGINS=* > > WEB_API_CORS_ALLOW_ORIGINS=* > > ``` > > > > After modifying these files, you need to rebuild and restart your services for the changes to take effect. > > For more detailed configuration options, you can refer to the `environments.md` file in the Dify documentation [[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/environments.md)[[2]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/local-source-code.md). > > _To continue talking to [Dosu](https://dosu.dev), mention @dosu._ > > Configure the environment variables as same as above-mentioned, but the problem remain! ![图片1](https://github.com/langgenius/dify/assets/171358568/3b2441c7-e357-44de-aa63-76fa010e1234) ![图片2](https://github.com/langgenius/dify/assets/171358568/5d898e4e-0c94-42c0-96c9-a1b7a598bcba)
Author
Owner

@dosubot[bot] commented on GitHub (Jun 5, 2024):

To address the issue with the account registration page getting stuck and encountering net::ERR_CONNECTION_REFUSED errors for the /setup endpoint, follow these steps:

  1. Check Network Configuration:

    • Ensure that the network settings on your Tencent Cloud Server allow traffic to the port on which your Dify application is running. This might involve configuring security groups or firewall rules.
  2. Verify Docker Configuration:

    • Ensure that the Docker containers are correctly exposing the necessary ports. For example, if your Dify API service is running on port 5001 inside the container, you should map it to a port on the host machine:
      services:
        api:
          ...
          ports:
            - "5001:5001"
      
  3. Inspect Docker Compose Configuration:

    • Ensure that the docker-compose.yaml file is correctly configured. For example, make sure the api service is properly set up to expose the necessary ports and that the nginx service is configured to reverse proxy the API service:
      services:
        api:
          image: langgenius/dify-api:0.6.10
          ...
          ports:
            - "5001:5001"
        nginx:
          ...
          ports:
            - "80:80"
      
  4. Database Connection:

    • Ensure that the database connection is correctly configured and accessible from your Dify application. The setup function interacts with the database, so any issues with the database connection could cause the setup process to fail. Verify the database settings in the docker-compose.yaml file:
      services:
        db:
          image: postgres:15-alpine
          environment:
            POSTGRES_PASSWORD: difyai123456
            POSTGRES_DB: dify
          ...
      
  5. Check Logs:

    • Look at the logs of your Dify application and Docker containers to identify any errors or warnings that might provide more context about why the connection is being refused. You can use the following command to check the logs:
      docker-compose logs
      
  6. Ensure Services are Running:

    • Make sure that all necessary services (API, web, database, etc.) are running and healthy. You can check the status of the services using:
      docker-compose ps
      
  7. Reverse Proxy Configuration:

    • Ensure that the nginx service is correctly configured to reverse proxy the API and web services. Here is an example configuration snippet for nginx:
      services:
        nginx:
          image: nginx:latest
          volumes:
            - ./nginx/nginx.conf:/etc/nginx/nginx.conf
          depends_on:
            - api
            - web
          ports:
            - "80:80"
      
  8. Environment Variables:

    • Ensure that the environment variables are correctly set. Based on the example .env file, the NEXT_PUBLIC_API_PREFIX and NEXT_PUBLIC_PUBLIC_API_PREFIX should be correctly configured to point to the appropriate URLs. Here are some examples:
      NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api
      NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api
      
  9. Configuration File:

    • Ensure that the configuration file api/config.py is correctly set up. Verify that the database and other service configurations are correctly specified. For example:
      import os
      import dotenv
      
      dotenv.load_dotenv()
      DEFAULTS = {
          'DB_USERNAME': 'postgres',
          'DB_PASSWORD': 'dify123456',
          'DB_HOST': 'localhost',
          'DB_PORT': '5432',
          'DB_DATABASE': 'dify',
          'REDIS_HOST': 'localhost',
          'REDIS_PORT': '6379',
          'REDIS_DB': '0',
          'CONSOLE_API_URL': 'http://localhost:5001/console/api',
          'CONSOLE_WEB_URL': 'http://localhost:5001',
          'SERVICE_API_URL': 'http://localhost:5001/api',
          ...
      }
      
      def get_env(key):
          return os.environ.get(key, DEFAULTS.get(key))
      
      class Config:
          def __init__(self):
              self.DB_USERNAME = get_env('DB_USERNAME')
              self.DB_PASSWORD = get_env('DB_PASSWORD')
              self.DB_HOST = get_env('DB_HOST')
              self.DB_PORT = get_env('DB_PORT')
              self.DB_DATABASE = get_env('DB_DATABASE')
              self.REDIS_HOST = get_env('REDIS_HOST')
              self.REDIS_PORT = get_env('REDIS_PORT')
              self.REDIS_DB = get_env('REDIS_DB')
              self.CONSOLE_API_URL = get_env('CONSOLE_API_URL')
              self.CONSOLE_WEB_URL = get_env('CONSOLE_WEB_URL')
              self.SERVICE_API_URL = get_env('SERVICE_API_URL')
              ...
      

By following these steps, you should be able to resolve the net::ERR_CONNECTION_REFUSED errors and get the account registration page working correctly [1][2][3][4][5].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 5, 2024): <!-- Answer --> To address the issue with the account registration page getting stuck and encountering `net::ERR_CONNECTION_REFUSED` errors for the `/setup` endpoint, follow these steps: 1. **Check Network Configuration**: - Ensure that the network settings on your Tencent Cloud Server allow traffic to the port on which your Dify application is running. This might involve configuring security groups or firewall rules. 2. **Verify Docker Configuration**: - Ensure that the Docker containers are correctly exposing the necessary ports. For example, if your Dify API service is running on port 5001 inside the container, you should map it to a port on the host machine: ```yaml services: api: ... ports: - "5001:5001" ``` 3. **Inspect Docker Compose Configuration**: - Ensure that the `docker-compose.yaml` file is correctly configured. For example, make sure the `api` service is properly set up to expose the necessary ports and that the `nginx` service is configured to reverse proxy the API service: ```yaml services: api: image: langgenius/dify-api:0.6.10 ... ports: - "5001:5001" nginx: ... ports: - "80:80" ``` 4. **Database Connection**: - Ensure that the database connection is correctly configured and accessible from your Dify application. The `setup` function interacts with the database, so any issues with the database connection could cause the setup process to fail. Verify the database settings in the `docker-compose.yaml` file: ```yaml services: db: image: postgres:15-alpine environment: POSTGRES_PASSWORD: difyai123456 POSTGRES_DB: dify ... ``` 5. **Check Logs**: - Look at the logs of your Dify application and Docker containers to identify any errors or warnings that might provide more context about why the connection is being refused. You can use the following command to check the logs: ```sh docker-compose logs ``` 6. **Ensure Services are Running**: - Make sure that all necessary services (API, web, database, etc.) are running and healthy. You can check the status of the services using: ```sh docker-compose ps ``` 7. **Reverse Proxy Configuration**: - Ensure that the `nginx` service is correctly configured to reverse proxy the API and web services. Here is an example configuration snippet for `nginx`: ```yaml services: nginx: image: nginx:latest volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf depends_on: - api - web ports: - "80:80" ``` 8. **Environment Variables**: - Ensure that the environment variables are correctly set. Based on the example `.env` file, the `NEXT_PUBLIC_API_PREFIX` and `NEXT_PUBLIC_PUBLIC_API_PREFIX` should be correctly configured to point to the appropriate URLs. Here are some examples: ```env NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api ``` 9. **Configuration File**: - Ensure that the configuration file `api/config.py` is correctly set up. Verify that the database and other service configurations are correctly specified. For example: ```py import os import dotenv dotenv.load_dotenv() DEFAULTS = { 'DB_USERNAME': 'postgres', 'DB_PASSWORD': 'dify123456', 'DB_HOST': 'localhost', 'DB_PORT': '5432', 'DB_DATABASE': 'dify', 'REDIS_HOST': 'localhost', 'REDIS_PORT': '6379', 'REDIS_DB': '0', 'CONSOLE_API_URL': 'http://localhost:5001/console/api', 'CONSOLE_WEB_URL': 'http://localhost:5001', 'SERVICE_API_URL': 'http://localhost:5001/api', ... } def get_env(key): return os.environ.get(key, DEFAULTS.get(key)) class Config: def __init__(self): self.DB_USERNAME = get_env('DB_USERNAME') self.DB_PASSWORD = get_env('DB_PASSWORD') self.DB_HOST = get_env('DB_HOST') self.DB_PORT = get_env('DB_PORT') self.DB_DATABASE = get_env('DB_DATABASE') self.REDIS_HOST = get_env('REDIS_HOST') self.REDIS_PORT = get_env('REDIS_PORT') self.REDIS_DB = get_env('REDIS_DB') self.CONSOLE_API_URL = get_env('CONSOLE_API_URL') self.CONSOLE_WEB_URL = get_env('CONSOLE_WEB_URL') self.SERVICE_API_URL = get_env('SERVICE_API_URL') ... ``` By following these steps, you should be able to resolve the `net::ERR_CONNECTION_REFUSED` errors and get the account registration page working correctly <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/controllers/console/setup.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/getting-started/install-self-hosted/environments.md)</sup><sup>[[4]](https://github.com/langgenius/dify/blob/main/web/.env.example)</sup><sup>[[5]](https://github.com/langgenius/dify/blob/main/api/config.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@dyh2024 commented on GitHub (Jun 6, 2024):

Please check your env vars.

Maybe I found the cause of the problem!

After I deployed the server according to the document https://docs.dify.ai/getting-started/install-self-hosted/local-source-code#server-deployment, And start then frontend service according to the document https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, by then command 'docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest' .

My environment is Tencent Cloud Server and opened the ports: 3000,5001.

When I visit http://127.0.0.1:3000 and http://(Internal IP):3000, no problem.
But when I visit http://(Public IP):3000, The problem arose(the install(Account registration) page keeps getting stuck).

The vars of CORS in api/.env :
image

Is there any solution to this problem?

@dyh2024 commented on GitHub (Jun 6, 2024): > Please check your env vars. Maybe I found the cause of the problem! After I deployed the server according to the document https://docs.dify.ai/getting-started/install-self-hosted/local-source-code#server-deployment, And start then frontend service according to the document https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, by then command 'docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest' . My environment is Tencent Cloud Server and opened the ports: 3000,5001. When I visit http://127.0.0.1:3000 and http://(Internal IP):3000, no problem. But when I visit http://(Public IP):3000, The problem arose(the install(Account registration) page keeps getting stuck). The vars of CORS in api/.env : ![image](https://github.com/langgenius/dify/assets/171358568/c346afc0-e9e3-4fd9-91c3-134b817c208c) Is there any solution to this problem?
Author
Owner

@crazywoola commented on GitHub (Jun 16, 2024):

Please check your env vars.

Maybe I found the cause of the problem!

After I deployed the server according to the document https://docs.dify.ai/getting-started/install-self-hosted/local-source-code#server-deployment, And start then frontend service according to the document https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, by then command 'docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest' .

My environment is Tencent Cloud Server and opened the ports: 3000,5001.

When I visit http://127.0.0.1:3000 and http://(Internal IP):3000, no problem. But when I visit http://(Public IP):3000, The problem arose(the install(Account registration) page keeps getting stuck).

The vars of CORS in api/.env : image

Is there any solution to this problem?

If you deploy the application to your public severs.

You need to change this as well.

CONSOLE_URL=http://public-ip:5001/ -e APP_URL=http://public-ip:5001/

Because you are trying to access the localhost(your computer) in your public server and it doesn't know.

@crazywoola commented on GitHub (Jun 16, 2024): > > Please check your env vars. > > Maybe I found the cause of the problem! > > After I deployed the server according to the document https://docs.dify.ai/getting-started/install-self-hosted/local-source-code#server-deployment, And start then frontend service according to the document https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, by then command 'docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest' . > > My environment is Tencent Cloud Server and opened the ports: 3000,5001. > > When I visit http://127.0.0.1:3000 and http://(Internal IP):3000, no problem. But when I visit http://(Public IP):3000, The problem arose(the install(Account registration) page keeps getting stuck). > > The vars of CORS in api/.env : ![image](https://private-user-images.githubusercontent.com/171358568/337221650-c346afc0-e9e3-4fd9-91c3-134b817c208c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg1OTM3NTUsIm5iZiI6MTcxODU5MzQ1NSwicGF0aCI6Ii8xNzEzNTg1NjgvMzM3MjIxNjUwLWMzNDZhZmMwLWU5ZTMtNGZkOS05MWMzLTEzNGI4MTdjMjA4Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxN1QwMzA0MTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hNjk1NzY3NWM2NGUzNjAwOWM1MjdjMGFjZWNiNjNkNjU2Y2I0Y2QyZjE4NzE0MGVhOTk1MDk0NDM3NWVlMDJhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.rMKqF9h4jzfoSwQz1ckHdyn2hEuaC_ATYgFS6q0fYNI) > > Is there any solution to this problem? If you deploy the application to your public severs. You need to change this as well. ``` CONSOLE_URL=http://public-ip:5001/ -e APP_URL=http://public-ip:5001/ ``` Because you are trying to access the localhost(your computer) in your public server and it doesn't know.
Author
Owner

@dyh2024 commented on GitHub (Jun 18, 2024):

Please check your env vars.

Maybe I found the cause of the problem!
After I deployed the server according to the document https://docs.dify.ai/getting-started/install-self-hosted/local-source-code#server-deployment, And start then frontend service according to the document https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, by then command 'docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest' .
My environment is Tencent Cloud Server and opened the ports: 3000,5001.
When I visit http://127.0.0.1:3000 and http://(Internal IP):3000, no problem. But when I visit http://(Public IP):3000, The problem arose(the install(Account registration) page keeps getting stuck).
The vars of CORS in api/.env : image
Is there any solution to this problem?

If you deploy the application to your public severs.

You need to change this as well.

CONSOLE_URL=http://public-ip:5001/ -e APP_URL=http://public-ip:5001/

Because you are trying to access the localhost(your computer) in your public server and it doesn't know.

Thanks! This done!

@dyh2024 commented on GitHub (Jun 18, 2024): > > > Please check your env vars. > > > > > > Maybe I found the cause of the problem! > > After I deployed the server according to the document https://docs.dify.ai/getting-started/install-self-hosted/local-source-code#server-deployment, And start then frontend service according to the document https://docs.dify.ai/getting-started/install-self-hosted/start-the-frontend-docker-container, by then command 'docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest' . > > My environment is Tencent Cloud Server and opened the ports: 3000,5001. > > When I visit http://127.0.0.1:3000 and http://(Internal IP):3000, no problem. But when I visit http://(Public IP):3000, The problem arose(the install(Account registration) page keeps getting stuck). > > The vars of CORS in api/.env : ![image](https://private-user-images.githubusercontent.com/171358568/337221650-c346afc0-e9e3-4fd9-91c3-134b817c208c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg1OTM3NTUsIm5iZiI6MTcxODU5MzQ1NSwicGF0aCI6Ii8xNzEzNTg1NjgvMzM3MjIxNjUwLWMzNDZhZmMwLWU5ZTMtNGZkOS05MWMzLTEzNGI4MTdjMjA4Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxN1QwMzA0MTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hNjk1NzY3NWM2NGUzNjAwOWM1MjdjMGFjZWNiNjNkNjU2Y2I0Y2QyZjE4NzE0MGVhOTk1MDk0NDM3NWVlMDJhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.rMKqF9h4jzfoSwQz1ckHdyn2hEuaC_ATYgFS6q0fYNI) > > Is there any solution to this problem? > > If you deploy the application to your public severs. > > You need to change this as well. > > ``` > CONSOLE_URL=http://public-ip:5001/ -e APP_URL=http://public-ip:5001/ > ``` > > Because you are trying to access the localhost(your computer) in your public server and it doesn't know. Thanks! This done!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#3983