Error response from daemon and 401 Unauthorized #4416

Closed
opened 2026-02-21 18:06:19 -05:00 by yindo · 3 comments
Owner

Originally created by @mouse33333 on GitHub (Jul 3, 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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.11

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image
I follow the step on official website:

  1. cd dify/docker
  2. cp .env.example .env
  3. docker compose up -d

However, when trying to load the docker compose, it always occured "401 unauthorized" error.

I work on Windows 11, Docker Desktop.

✔️ Expected Behavior

update the compose of the project

Actual Behavior

Error response from daemon: failed to resolve reference "docker.io/library/redis:6-alpine": failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository%3Alibrary%2Fredis%3Apull&service=registry.docker.io: 401 Unauthorized

Originally created by @mouse33333 on GitHub (Jul 3, 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] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.11 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![image](https://github.com/langgenius/dify/assets/4304174/28747c58-b311-42db-bdba-2b64730bc52a) I follow the step on official website: 1. cd dify/docker 2. cp .env.example .env 3. docker compose up -d However, when trying to load the docker compose, it always occured "401 unauthorized" error. I work on Windows 11, Docker Desktop. ### ✔️ Expected Behavior update the compose of the project ### ❌ Actual Behavior Error response from daemon: failed to resolve reference "docker.io/library/redis:6-alpine": failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository%3Alibrary%2Fredis%3Apull&service=registry.docker.io: 401 Unauthorized
yindo closed this issue 2026-02-21 18:06:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 3, 2024):

Hello @mouse33333! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's work together to resolve the issue you're facing.

To resolve the "401 Unauthorized" error and successfully run the Docker Compose setup for the Dify project on Windows 11, follow these steps:

  1. Clone the Dify Repository:

    git clone https://github.com/langgenius/dify.git
    
  2. Navigate to the Docker Directory:

    cd dify/docker
    
  3. Copy the Example Environment File:

    cp .env.example .env
    
  4. Edit the .env File:
    Modify the environment variable values in your .env file as needed. Ensure that the following variables are correctly set to avoid the 401 Unauthorized error:

    • CONSOLE_API_URL
    • APP_API_URL
    • SECRET_KEY
    • INIT_PASSWORD
    • DB_USERNAME
    • DB_PASSWORD
    • DB_HOST
    • DB_PORT
    • DB_DATABASE
    • REDIS_HOST
    • REDIS_PASSWORD
    • WEAVIATE_API_KEY
    • WEAVIATE_ENDPOINT
  5. Start the Docker Compose Setup:

    docker compose up -d
    
  6. Check if All Containers are Running Successfully:

    docker compose ps
    
  7. Access Dify:
    Open your browser and navigate to http://localhost.

If you encounter a 401 Unauthorized error, ensure that the environment variables in your .env file are correctly configured. You may need to customize the .env file with appropriate values and restart the setup:

  1. Edit the .env File:
    Modify the environment variable values in your .env file as needed. The environment variables are located in the docker/dotenvs directory. Rename the corresponding .env.example file by removing the .example suffix and edit the variables directly.

  2. Restart Dify:

    docker compose down
    docker compose up -d
    

Ensure that you have the necessary permissions and correct credentials configured in the .env file to avoid the 401 Unauthorized error. Additionally, make sure your system meets the prerequisites for running Docker Compose as specified in the Dify documentation [1].

For a more detailed setup, including configuring your local environment with Conda, CUDA, and WSL2, refer to the Dify documentation. Here is a brief overview:

  1. Prepare Your Local Environment:

    • Install Conda and set up a Python environment.
    • Install CUDA from the official NVIDIA website.
    • Set up WSL2 on Windows and install Docker Desktop with WSL2 backend.
  2. Configure Proxy for WSL:

    • Create a script to set up a proxy for WSL if needed.
  3. Install PyTorch:

    • Follow the instructions on the PyTorch website to install it in your environment.

By following these steps, you should be able to resolve the 401 Unauthorized error and successfully run the Docker Compose setup for the Dify project.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 3, 2024): <!-- Greeting --> Hello @mouse33333! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's work together to resolve the issue you're facing. <!-- Answer --> To resolve the "401 Unauthorized" error and successfully run the Docker Compose setup for the Dify project on Windows 11, follow these steps: 1. **Clone the Dify Repository:** ```bash git clone https://github.com/langgenius/dify.git ``` 2. **Navigate to the Docker Directory:** ```bash cd dify/docker ``` 3. **Copy the Example Environment File:** ```bash cp .env.example .env ``` 4. **Edit the `.env` File:** Modify the environment variable values in your `.env` file as needed. Ensure that the following variables are correctly set to avoid the 401 Unauthorized error: - `CONSOLE_API_URL` - `APP_API_URL` - `SECRET_KEY` - `INIT_PASSWORD` - `DB_USERNAME` - `DB_PASSWORD` - `DB_HOST` - `DB_PORT` - `DB_DATABASE` - `REDIS_HOST` - `REDIS_PASSWORD` - `WEAVIATE_API_KEY` - `WEAVIATE_ENDPOINT` 5. **Start the Docker Compose Setup:** ```bash docker compose up -d ``` 6. **Check if All Containers are Running Successfully:** ```bash docker compose ps ``` 7. **Access Dify:** Open your browser and navigate to [http://localhost](http://localhost). If you encounter a 401 Unauthorized error, ensure that the environment variables in your `.env` file are correctly configured. You may need to customize the `.env` file with appropriate values and restart the setup: 1. **Edit the `.env` File:** Modify the environment variable values in your `.env` file as needed. The environment variables are located in the `docker/dotenvs` directory. Rename the corresponding `.env.example` file by removing the `.example` suffix and edit the variables directly. 2. **Restart Dify:** ```bash docker compose down docker compose up -d ``` Ensure that you have the necessary permissions and correct credentials configured in the `.env` file to avoid the 401 Unauthorized error. Additionally, make sure your system meets the prerequisites for running Docker Compose as specified in the Dify documentation <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/docker-compose.md)</sup>. For a more detailed setup, including configuring your local environment with Conda, CUDA, and WSL2, refer to the Dify documentation. Here is a brief overview: 1. **Prepare Your Local Environment:** - Install Conda and set up a Python environment. - Install CUDA from the official NVIDIA website. - Set up WSL2 on Windows and install Docker Desktop with WSL2 backend. 2. **Configure Proxy for WSL:** - Create a script to set up a proxy for WSL if needed. 3. **Install PyTorch:** - Follow the instructions on the PyTorch website to install it in your environment. By following these steps, you should be able to resolve the 401 Unauthorized error and successfully run the Docker Compose setup for the Dify project. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jul 3, 2024):

This is not related to our code base, instead it's a problem of basic docker usage.

@crazywoola commented on GitHub (Jul 3, 2024): This is not related to our code base, instead it's a problem of basic docker usage.
Author
Owner

@mouse33333 commented on GitHub (Jul 4, 2024):

Thank you! I finlally found it's the network problem that failed updating the compose.

@mouse33333 commented on GitHub (Jul 4, 2024): Thank you! I finlally found it's the network problem that failed updating the compose.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4416