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

Fail to upgrade to 0.6.12 #5730

Open
5 tasks done
paulcx opened this issue Jun 28, 2024 · 17 comments
Open
5 tasks done

Fail to upgrade to 0.6.12 #5730

paulcx opened this issue Jun 28, 2024 · 17 comments
Labels
🤔 cant-reproduce This issue can not be reproduced

Comments

@paulcx
Copy link

paulcx commented Jun 28, 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.12

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Copy the docker/.env.example file to a new file named .env and customize it as needed.
Run docker compose up to start the services.

✔️ Expected Behavior

upgrade

❌ Actual Behavior

redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Jun 28, 2024
Copy link

dosubot bot commented Jun 28, 2024

Hey @paulcx! 👋 I'm here to assist you with any bugs, questions, or contributions while you wait for a human maintainer. Let's work together to resolve any issues you're encountering.

To resolve the redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused error when upgrading to Dify version 0.6.12 on a self-hosted Docker setup, ensure that the Redis container is running properly. Follow these steps:

  1. Clone the Dify source code to your local machine if you haven't already:

    git clone https://github.com/langgenius/dify.git
  2. Navigate to the Dify source code's Docker directory:

    cd dify/docker
  3. Pull the latest changes from the repository:

    git pull origin main
  4. Bring down the existing Docker containers:

    docker compose down
  5. Pull the latest images:

    docker compose pull
  6. Start the Docker containers:

    docker compose up -d
  7. Verify that all containers, including Redis, are running:

    docker compose ps

Ensure that the redis container is listed with a status of "Up". If the Redis container is not running, there may be an issue with the Docker setup or the Redis configuration.

Additionally, check the docker-compose.yaml file to ensure that the Redis service is correctly configured. Here is an example configuration for the Redis service:

redis:
  image: redis:6-alpine
  restart: always
  volumes:
    - ./volumes/redis/data:/data
  command: redis-server --requirepass ${REDIS_PASSWORD:-difyai123456}
  healthcheck:
    test: [ "CMD", "redis-cli", "ping" ]
  # uncomment to expose redis port to host
  # ports:
  #   - "6379:6379"

Make sure the REDIS_PASSWORD environment variable is set correctly in your .env file or Docker Compose environment variables. If you have exposed the Redis port to the host, ensure that the port mapping is correct and not conflicting with other services [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@paulcx
Copy link
Author

paulcx commented Jun 28, 2024

does it related to env file? i used the default env file middleware.env

Copy link

dosubot bot commented Jun 28, 2024

Yes, the issue could be related to the .env file. Ensure that your .env file includes the correct configurations for the Redis container. Here is an example configuration for the .env file to ensure the Redis container runs correctly in a self-hosted Docker setup for Dify version 0.6.12:

REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=difyai123456
REDIS_DB=0
REDIS_USERNAME=
REDIS_USE_SSL=false

These settings should match the Redis service configuration in your docker-compose.middleware.yaml file:

services:
  # The redis cache.
  redis:
    image: redis:6-alpine
    restart: always
    volumes:
      # Mount the redis data directory to the container.
      - ./volumes/redis/data:/data
    # Set the redis password when startup redis server.
    command: redis-server --requirepass ${REDIS_PASSWORD:-difyai123456}
    ports:
      - "6379:6379"

Make sure to replace difyai123456 with a strong password of your choice. After updating the .env file, restart your Docker containers:

docker compose down
docker compose up -d

Then, verify that all containers, including Redis, are running:

docker compose ps

This should help resolve the connection error [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@paulcx
Copy link
Author

paulcx commented Jun 28, 2024

what is the difference of use between docker-compose.middleware.yaml and docker-compose.yaml? which one should be used to upgrade?

Actually, redis server works fine but somehow worker can connect redis server. it should be something wrong with the config?

Copy link

dosubot bot commented Jun 28, 2024

The differences between docker-compose.middleware.yaml and docker-compose.yaml in the Dify repository are primarily in formatting and presentation. Both files contain the same services and configurations, so functionally, they are identical [1][2].

For upgrading, you can use either docker-compose.middleware.yaml or docker-compose.yaml as they both define the same services and configurations. However, ensure that the .env file you are using matches the configurations in the chosen docker-compose file.

Since your Redis server works fine but the worker cannot connect to it, double-check the following:

  1. Environment Variables: Ensure that the environment variables in your .env file are correctly set and match the Redis configuration.

    REDIS_HOST=redis
    REDIS_PORT=6379
    REDIS_PASSWORD=difyai123456
  2. Service Configuration: Verify that the Redis service configuration in your docker-compose file is correct.

    services:
      redis:
        image: redis:6-alpine
        restart: always
        volumes:
          - ./volumes/redis/data:/data
        command: redis-server --requirepass ${REDIS_PASSWORD:-difyai123456}
        ports:
          - "6379:6379"
  3. Network Configuration: Ensure that all services are on the same Docker network and can communicate with each other.

  4. Container Status: Verify that all containers, including the worker and Redis, are running and healthy.

    docker compose ps

By ensuring these configurations are correct, you should be able to resolve the connection issue between the worker and the Redis server.

To continue talking to Dosu, mention @dosu.

@damadorPL
Copy link

also have similar issue - docker @ windows run with

@echo off
cd dify/docker
call git pull origin main
call docker compose down
call docker compose pull
call docker compose up -d --remove-orphans

then output bunch of warnings

  • branch main -> FETCH_HEAD
    Already up to date.
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "TENCENT_COS_BUCKET_NAME" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "MILVUS_PASSWORD" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "ORACLE_USER" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "CHROMA_DATABASE" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "CELERY_WORKER_CLASS" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "VECTOR_STORE" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "SECRET_KEY" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "UPLOAD_FILE_BATCH_LIMIT" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "NOTION_CLIENT_SECRET" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "INVITE_EXPIRY_HOURS" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "CHROMA_AUTH_CREDENTIALS" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "AZURE_BLOB_ACCOUNT_URL" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "AZURE_BLOB_ACCOUNT_KEY" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "CONSOLE_CORS_ALLOW_ORIGINS" variable is not set. Defaulting to a blank string."
    time="2024-06-28T22:01:53+02:00" level=warning msg="The "GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64" variable is not set. Defaulting to a blank string."

(...)

@damadorPL
Copy link

using default env file warning gone but now

2024-06-28 22:30:39 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:41 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:44 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:46 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:48 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:50 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:54 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:31:01 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:31:14 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:31:40 ssrf_proxy-1 | sh: 1: /docker-entrypoint.sh: not found

and

2024-06-28 22:30:46 nginx-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:47 nginx-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:49 nginx-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:53 nginx-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:30:59 nginx-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:31:12 nginx-1 | sh: 1: /docker-entrypoint.sh: not found
2024-06-28 22:31:38 nginx-1 | sh: 1: /docker-entrypoint.sh: not found

2 volumes are created but are 0 byte files

@listelin
Copy link

I also could not start DIFY 0.6.12 with the following error.

 /docker-entrypoint.sh: not found

I was able to start it successfully by using docker-legacy.

cd docker-legacy
docker compose -p dify up -d

Since docker-legacy/volumes is the initial state, DIFY will start on the first signup screen.

@xd845217xd
Copy link

xd845217xd commented Jun 28, 2024

@damadorPL

"docker\nginx\docker-entrypoint.sh"
"docker\ssrf_proxy\docker-entrypoint.sh"

Converting these two files from CRLF to LF will resolve the issue.

You can use "Notepad++". Open the file, go to Edit, EOL Conversion, select UNIX (LF), and save the file.
Don't forget to run "docker compose up -d" again.

I spent quite some time figuring this out, not sure if it counts as a bug?

@crazywoola
Copy link
Member

what is the difference of use between docker-compose.middleware.yaml and docker-compose.yaml? which one should be used to upgrade?

Actually, redis server works fine but somehow worker can connect redis server. it should be something wrong with the config?

docker-compose.middleware.yaml is used for self hosted (source code).
In your case, you should use docker-compose.yaml to start the container instead.

@crazywoola crazywoola added 🤔 cant-reproduce This issue can not be reproduced and removed 🐞 bug Something isn't working labels Jun 29, 2024
@jerryandjune
Copy link

@damadorPL

“docker\nginx\docker-entrypoint.sh” “docker\ssrf_proxy\docker-entrypoint.sh”

将这两个文件从 CRLF 转换为 LF 将解决该问题。

您可以使用“Notepad++”。打开文件,转到编辑、EOL 转换,选择 UNIX (LF),然后保存文件。 别忘了再次运行“docker compose up -d”。

我花了很长时间来解决这个问题,不确定这是否算是一个错误?

可以解决nginx,ssrf_proxy的docker无法启动问题

@listelin
Copy link

listelin commented Jun 29, 2024

On windows, if git config core.autocrlf is true (default), the above problem occurs and DIFY cannot be started.

You can manually edit file CRLF -> LF as described above, or changing the git config and pulling should solve the problem.

git config --global core.autocrlf false

@MWang-TS
Copy link

@damadorPL

"docker\nginx\docker-entrypoint.sh" "docker\ssrf_proxy\docker-entrypoint.sh"

Converting these two files from CRLF to LF will resolve the issue.

You can use "Notepad++". Open the file, go to Edit, EOL Conversion, select UNIX (LF), and save the file. Don't forget to run "docker compose up -d" again.

I spent quite some time figuring this out, not sure if it counts as a bug?

It works finally, great ! Thanks a lot !

@MWang-TS
Copy link

all 0.6.12 containers are started but got this issue at (http://localhost/install) page ?
Screenshot 2024-06-29 121951

@crazywoola
Copy link
Member

I guess @MWang-TS you need to attach the screenshot of web console.

@MWang-TS
Copy link

I guess @MWang-TS you need to attach the screenshot of web console.

The screenshot above is the interface for initializing the administrator user password ,after I click [Setting up an admin account] from signin page.

@KevinLoveGitHub
Copy link

+1

❌ Actual Behavior
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 cant-reproduce This issue can not be reproduced
Projects
None yet
Development

No branches or pull requests

8 participants