after upgrade to 0.7.3 the worker container keeep restart #5374

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

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

Dify version

0.7.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I've deploy dify on k8s by helm : https://github.com/douban/charts/tree/master/charts/dify
after I upgrade from 0.7.1 to 0.7.3, the dify-worker keep CrashLoopBackOff
the log of the worker pod is :

None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
2024-09-04 03:43:10,417.417 WARNING [MainThread] [ext_mail.py:51] - MAIL_TYPE is not set
Usage: celery worker [OPTIONS]
Try 'celery worker --help' for help.

Error: Invalid value for '-l' / '--loglevel': '-Q' is not one of 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'FATAL'.

✔️ Expected Behavior

Running

Actual Behavior

CrashLoopBackOff

Originally created by @lordk911 on GitHub (Sep 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.7.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I've deploy dify on k8s by helm : https://github.com/douban/charts/tree/master/charts/dify after I upgrade from 0.7.1 to 0.7.3, the dify-worker keep CrashLoopBackOff the log of the worker pod is : ``` None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. 2024-09-04 03:43:10,417.417 WARNING [MainThread] [ext_mail.py:51] - MAIL_TYPE is not set Usage: celery worker [OPTIONS] Try 'celery worker --help' for help. Error: Invalid value for '-l' / '--loglevel': '-Q' is not one of 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'FATAL'. ``` ### ✔️ Expected Behavior Running ### ❌ Actual Behavior CrashLoopBackOff
yindo added the 🐞 bug label 2026-02-21 18:10:40 -05:00
yindo closed this issue 2026-02-21 18:10:40 -05:00
Author
Owner

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

The dify-worker container is experiencing a CrashLoopBackOff error after upgrading to version 0.7.3 due to missing dependencies and incorrect log level settings. Here are the steps to resolve these issues:

  1. Install Missing Dependencies:
    Ensure that PyTorch, TensorFlow >= 2.0, or Flax are installed. These dependencies are required for the worker to function correctly.

  2. Correct Log Level Settings:
    The error message indicates an invalid log level setting. Ensure that the LOG_LEVEL environment variable is set to one of the supported values: DEBUG, INFO, WARNING, ERROR, CRITICAL. The correct setting in your docker-compose.yaml should look like this:

    LOG_LEVEL: INFO
    
  3. Set MAIL_TYPE:
    The warning message indicates that MAIL_TYPE is not set. Configure the MAIL_TYPE and related mail settings in your .env file. Here is an example configuration:

    MAIL_TYPE: 'resend'
    MAIL_DEFAULT_SEND_FROM: 'no-reply@dify.ai'
    SMTP_SERVER: ''
    SMTP_PORT: 465
    SMTP_USERNAME: ''
    SMTP_PASSWORD: ''
    SMTP_USE_TLS: 'true'
    SMTP_OPPORTUNISTIC_TLS: 'false'
    RESEND_API_KEY: ''
    RESEND_API_URL: https://api.resend.com
    
  4. Verify Environment Variables:
    Ensure all required environment variables are correctly set. Here is an example configuration for the worker service:

    worker:
      image: langgenius/dify-api:0.7.3
      restart: always
      environment:
        <<: *shared-api-worker-env
        MODE: worker
        LOG_LEVEL: INFO
        MAIL_TYPE: 'resend'
      depends_on:
        - db
        - redis
      volumes:
        - ./volumes/app/storage:/app/api/storage
      networks:
        - ssrf_proxy_network
        - default
    
  5. Restart the Services:
    After making these changes, restart your Docker containers:

    docker compose down
    docker compose up -d
    

By following these steps, the dify-worker container should stop restarting and function correctly [1][2][3].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Sep 3, 2024): <!-- Answer --> The `dify-worker` container is experiencing a `CrashLoopBackOff` error after upgrading to version 0.7.3 due to missing dependencies and incorrect log level settings. Here are the steps to resolve these issues: 1. **Install Missing Dependencies**: Ensure that PyTorch, TensorFlow >= 2.0, or Flax are installed. These dependencies are required for the worker to function correctly. 2. **Correct Log Level Settings**: The error message indicates an invalid log level setting. Ensure that the `LOG_LEVEL` environment variable is set to one of the supported values: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`. The correct setting in your `docker-compose.yaml` should look like this: ```yaml LOG_LEVEL: INFO ``` 3. **Set MAIL_TYPE**: The warning message indicates that `MAIL_TYPE` is not set. Configure the `MAIL_TYPE` and related mail settings in your `.env` file. Here is an example configuration: ```yaml MAIL_TYPE: 'resend' MAIL_DEFAULT_SEND_FROM: 'no-reply@dify.ai' SMTP_SERVER: '' SMTP_PORT: 465 SMTP_USERNAME: '' SMTP_PASSWORD: '' SMTP_USE_TLS: 'true' SMTP_OPPORTUNISTIC_TLS: 'false' RESEND_API_KEY: '' RESEND_API_URL: https://api.resend.com ``` 4. **Verify Environment Variables**: Ensure all required environment variables are correctly set. Here is an example configuration for the `worker` service: ```yaml worker: image: langgenius/dify-api:0.7.3 restart: always environment: <<: *shared-api-worker-env MODE: worker LOG_LEVEL: INFO MAIL_TYPE: 'resend' depends_on: - db - redis volumes: - ./volumes/app/storage:/app/api/storage networks: - ssrf_proxy_network - default ``` 5. **Restart the Services**: After making these changes, restart your Docker containers: ```bash docker compose down docker compose up -d ``` By following these steps, the `dify-worker` container should stop restarting and function correctly <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker-legacy/docker-compose.yaml)</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/en/getting-started/install-self-hosted/docker-compose.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Sep 4, 2024):

See the bot's answer, check the LOG_LEVEL in you .env files.

@crazywoola commented on GitHub (Sep 4, 2024): See the bot's answer, check the `LOG_LEVEL` in you .env files.
Author
Owner

@jumpei-tsutsui commented on GitHub (Sep 6, 2024):

Since the documentation states that ‘Default is INFO’, shouldn’t this be fixed as a bug?

@jumpei-tsutsui commented on GitHub (Sep 6, 2024): Since the documentation states that ‘Default is INFO’, shouldn’t this be fixed as a bug?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5374