workflow Code node bug: Got error code: -500. Got error msg: fork/exec /usr/local/bin/python3: too many open files #5451

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

Originally created by @double-Dou on GitHub (Sep 8, 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.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I use code nodes to convert the results of the previous LLM. After a long period of running, the following errors appear: Got Error Code: -500. Got Error MSG: Fork/EXEC/USR/LOCAL/BIN/Python33 : Too Many Open Files

After the errors, the code nodes of all workflow can not run

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @double-Dou on GitHub (Sep 8, 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.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I use code nodes to convert the results of the previous LLM. After a long period of running, the following errors appear: Got Error Code: -500. Got Error MSG: Fork/EXEC/USR/LOCAL/BIN/Python33 : Too Many Open Files After the errors, the code nodes of all workflow can not run ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:11:02 -05:00
yindo closed this issue 2026-02-21 18:11:02 -05:00
Author
Owner

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

@double-Dou Hello there! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve the issue you're experiencing.

I found a similar issue related to "operation not permitted" errors in workflows, which might be relevant to your problem. The issue was likely due to restrictions in the Docker environment, specifically with native Python packages and network/file/OS access [1].

For your specific error "too many open files," this is typically related to the system's file descriptor limit. Here are some steps to resolve it:

  1. Increase File Descriptor Limit:

    • On the host machine, increase the file descriptor limit by adding the following lines to /etc/security/limits.conf:
      * soft nofile 65535
      * hard nofile 65535
      
    • Apply the changes by logging out and back in, or by rebooting the system.
  2. Docker Configuration:

    • Ensure Docker is configured to use the increased file descriptor limit. You can add the following to your Docker service configuration (usually found in /etc/docker/daemon.json):
      {
        "default-ulimits": {
          "nofile": {
            "Name": "nofile",
            "Hard": 65535,
            "Soft": 65535
          }
        }
      }
      
    • Restart the Docker service to apply the changes:
      sudo systemctl restart docker
      
  3. Check Workflow Code:

    • Ensure that your workflow code is not leaking file descriptors. This can happen if files or network connections are not properly closed after use.

After making these changes, restart your Docker containers and try running the workflow again. This should help mitigate the "too many open files" error.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Sep 8, 2024): <!-- Greeting --> @double-Dou Hello there! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve the issue you're experiencing. <!-- Answer --> I found a similar issue related to "operation not permitted" errors in workflows, which might be relevant to your problem. The issue was likely due to restrictions in the Docker environment, specifically with native Python packages and network/file/OS access <sup>[[1]](https://github.com/langgenius/dify/issues/3331)</sup>. For your specific error "too many open files," this is typically related to the system's file descriptor limit. Here are some steps to resolve it: 1. **Increase File Descriptor Limit**: - On the host machine, increase the file descriptor limit by adding the following lines to `/etc/security/limits.conf`: ```plaintext * soft nofile 65535 * hard nofile 65535 ``` - Apply the changes by logging out and back in, or by rebooting the system. 2. **Docker Configuration**: - Ensure Docker is configured to use the increased file descriptor limit. You can add the following to your Docker service configuration (usually found in `/etc/docker/daemon.json`): ```json { "default-ulimits": { "nofile": { "Name": "nofile", "Hard": 65535, "Soft": 65535 } } } ``` - Restart the Docker service to apply the changes: ```bash sudo systemctl restart docker ``` 3. **Check Workflow Code**: - Ensure that your workflow code is not leaking file descriptors. This can happen if files or network connections are not properly closed after use. After making these changes, restart your Docker containers and try running the workflow again. This should help mitigate the "too many open files" error. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

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

See this for help https://stackoverflow.com/questions/18280612/ioerror-errno-24-too-many-open-files

@crazywoola commented on GitHub (Sep 8, 2024): See this for help https://stackoverflow.com/questions/18280612/ioerror-errno-24-too-many-open-files
Author
Owner

@double-Dou commented on GitHub (Sep 12, 2024):

@crazywoola @dosu I did not open the file or access the network in my code, just a simple JSON format data conversion;
If the file descriptor limit is raised, will it just postpone the time when the problem is delayed and cannot fundamentally solve the problem

@double-Dou commented on GitHub (Sep 12, 2024): @crazywoola @dosu I did not open the file or access the network in my code, just a simple JSON format data conversion; If the file descriptor limit is raised, will it just postpone the time when the problem is delayed and cannot fundamentally solve the problem
Author
Owner

@dnyg commented on GitHub (Sep 18, 2024):

We have the exact same issue. I believe it is localized to the sandbox, so I've posted it there:

https://github.com/langgenius/dify-sandbox/issues/62

@dnyg commented on GitHub (Sep 18, 2024): We have the exact same issue. I believe it is localized to the sandbox, so I've posted it there: https://github.com/langgenius/dify-sandbox/issues/62
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5451