Code execution module error: Operation not permitted #20706

Closed
opened 2026-02-21 20:08:33 -05:00 by yindo · 7 comments
Owner

Originally created by @MrYangming on GitHub (Dec 1, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.0

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Image

✔️ Expected Behavior

normal

Actual Behavior

exception

Originally created by @MrYangming on GitHub (Dec 1, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.0 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce <img width="1885" height="856" alt="Image" src="https://github.com/user-attachments/assets/78da6234-5b0d-4780-b7a1-fcda9cc93eb6" /> ### ✔️ Expected Behavior normal ### ❌ Actual Behavior exception
yindo added the 🐞 bugoutdated labels 2026-02-21 20:08:33 -05:00
yindo closed this issue 2026-02-21 20:08:34 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 1, 2025):

The "operation not permitted" error in the code execution node comes from the sandbox service that runs your code. By default, the sandbox restricts system calls using seccomp, and its config file (docker/volumes/sandbox/conf/config.yaml) leaves allowed_syscalls empty. If your code or its runtime needs a syscall that's not permitted, you'll get this error. To fix it, add the required syscall numbers to allowed_syscalls in the sandbox config and restart the sandbox container. You can also enable debug logging in the sandbox to help identify which syscall is being blocked.

If the issue persists, check the sandbox and Dify logs for more details, and try running different code snippets to see if the error is specific to certain operations or languages. For more info, see the code execution and sandbox config logic here and here.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 1, 2025): <!-- Answer --> The "operation not permitted" error in the code execution node comes from the sandbox service that runs your code. By default, the sandbox restricts system calls using seccomp, and its config file (`docker/volumes/sandbox/conf/config.yaml`) leaves `allowed_syscalls` empty. If your code or its runtime needs a syscall that's not permitted, you'll get this error. To fix it, add the required syscall numbers to `allowed_syscalls` in the sandbox config and restart the sandbox container. You can also enable debug logging in the sandbox to help identify which syscall is being blocked. If the issue persists, check the sandbox and Dify logs for more details, and try running different code snippets to see if the error is specific to certain operations or languages. For more info, see the code execution and sandbox config logic [here](https://github.com/langgenius/dify/blob/d162f7e5ef0db74d3396239c82e6283732f043ae/docker/volumes/sandbox/conf/config.yaml) and [here](https://github.com/langgenius/dify/blob/d162f7e5ef0db74d3396239c82e6283732f043ae/api/core/helper/code_executor/code_executor.py#L56-L157). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/dc7c3f23-dd10-4b59-afdc-0effa225f25c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/dc7c3f23-dd10-4b59-afdc-0effa225f25c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/dc7c3f23-dd10-4b59-afdc-0effa225f25c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/dc7c3f23-dd10-4b59-afdc-0effa225f25c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/dc7c3f23-dd10-4b59-afdc-0effa225f25c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/dc7c3f23-dd10-4b59-afdc-0effa225f25c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/dc7c3f23-dd10-4b59-afdc-0effa225f25c?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20%22operation%20not%20permitted%22%20error%20in%20the%20code%20execution%20node%20comes%20from%20the%20sandbox%20service%20that%20runs%20your%20code.%20By%20default%2C%20the%20sandbox%20restricts%20system%20calls%20using%20seccomp%2C%20and%20its%20config%20file%20%28%60docker/volumes/sandbox/conf/config.yaml%60%29%20leaves%20%60allowed_syscalls%60%20empty.%20If%20your%20code%20or%20its%20runtime%20needs%20a%20syscall%20that%27s%20not%20permitted%2C%20you%27ll%20get%20this%20error.%20To%20fix%20it%2C%20add%20the%20required%20syscall%20numbers%20to%20%60allowed_syscalls%60%20in%20the%20sandbox%20config%20and%20restart%20the%20sandbox%20container.%20You%20can%20also%20enable%20debug%20logging%20in%20the%20sandbox%20to%20help%20identify%20which%20syscall%20is%20being%20blocked.%0A%0AIf%20the%20issue%20persists%2C%20check%20the%20sandbox%20and%20Dify%20logs%20for%20more%20details%2C%20and%20try%20running%20different%20code%20snippets%20to%20see%20if%20the%20error%20is%20specific%20to%20certain%20operations%20or%20languages.%20For%20more%20info%2C%20see%20the%20code%20execution%20and%20sandbox%20config%20logic%20%5Bhere%5D%28https%3A//github.com/langgenius/dify/blob/d162f7e5ef0db74d3396239c82e6283732f043ae/docker/volumes/sandbox/conf/config.yaml%29%20and%20%5Bhere%5D%28https%3A//github.com/langgenius/dify/blob/d162f7e5ef0db74d3396239c82e6283732f043ae/api/core/helper/code_executor/code_executor.py%23L56-L157%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/28974)
Author
Owner

@MrYangming commented on GitHub (Dec 1, 2025):

sandbox log shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

ImageIs it related to this anomaly?

@MrYangming commented on GitHub (Dec 1, 2025): sandbox log shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory <img width="1598" height="211" alt="Image" src="https://github.com/user-attachments/assets/4121ec36-0275-4edf-b71c-ceeeb559c37b" />Is it related to this anomaly?
Author
Owner

@MrYangming commented on GitHub (Dec 1, 2025):

server log is

Image
@MrYangming commented on GitHub (Dec 1, 2025): server log is <img width="1654" height="425" alt="Image" src="https://github.com/user-attachments/assets/df57a087-97ee-4036-b702-e5b12ebf4b7b" />
Author
Owner

@dosubot[bot] commented on GitHub (Dec 1, 2025):

The server log traceback confirms that the "operation not permitted" error is a permissions or sandbox restriction issue during code execution. This matches the shell-init error in your sandbox logs, which indicates the working directory is missing or inaccessible. This can happen if the sandbox container's working directory was deleted, unmounted, or is not writable, causing syscalls like getcwd to fail and be blocked by the sandbox security policy.

To resolve this, exec into your sandbox container and check that the working directory exists and is accessible. Also, verify that /tmp and /var/tmp exist and are writable. If you’re running in Docker, ensure the relevant host directories are mounted correctly and have the right permissions. You can also try switching to a more permissive sandbox image like svcvit/dify-sandbox-py:0.1.3 or set privileged: true for the sandbox, api, and worker services in your docker-compose.yaml if your security policy allows it. If the problem persists, check for external security layers (like SELinux or AppArmor) or user remapping that might block access. For more details and step-by-step checks, see this discussion and this issue.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 1, 2025): <!-- Answer --> The server log traceback confirms that the "operation not permitted" error is a permissions or sandbox restriction issue during code execution. This matches the shell-init error in your sandbox logs, which indicates the working directory is missing or inaccessible. This can happen if the sandbox container's working directory was deleted, unmounted, or is not writable, causing syscalls like getcwd to fail and be blocked by the sandbox security policy. To resolve this, exec into your sandbox container and check that the working directory exists and is accessible. Also, verify that /tmp and /var/tmp exist and are writable. If you’re running in Docker, ensure the relevant host directories are mounted correctly and have the right permissions. You can also try switching to a more permissive sandbox image like `svcvit/dify-sandbox-py:0.1.3` or set `privileged: true` for the sandbox, api, and worker services in your docker-compose.yaml if your security policy allows it. If the problem persists, check for external security layers (like SELinux or AppArmor) or user remapping that might block access. For more details and step-by-step checks, see [this discussion](https://github.com/langgenius/dify/discussions/25732) and [this issue](https://github.com/langgenius/dify/issues/15267). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/aad31379-7402-4aae-a3e7-623975a294d2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/aad31379-7402-4aae-a3e7-623975a294d2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/aad31379-7402-4aae-a3e7-623975a294d2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/aad31379-7402-4aae-a3e7-623975a294d2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/aad31379-7402-4aae-a3e7-623975a294d2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/aad31379-7402-4aae-a3e7-623975a294d2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/aad31379-7402-4aae-a3e7-623975a294d2?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20server%20log%20traceback%20confirms%20that%20the%20%22operation%20not%20permitted%22%20error%20is%20a%20permissions%20or%20sandbox%20restriction%20issue%20during%20code%20execution.%20This%20matches%20the%20shell-init%20error%20in%20your%20sandbox%20logs%2C%20which%20indicates%20the%20working%20directory%20is%20missing%20or%20inaccessible.%20This%20can%20happen%20if%20the%20sandbox%20container%27s%20working%20directory%20was%20deleted%2C%20unmounted%2C%20or%20is%20not%20writable%2C%20causing%20syscalls%20like%20getcwd%20to%20fail%20and%20be%20blocked%20by%20the%20sandbox%20security%20policy.%0A%0ATo%20resolve%20this%2C%20exec%20into%20your%20sandbox%20container%20and%20check%20that%20the%20working%20directory%20exists%20and%20is%20accessible.%20Also%2C%20verify%20that%20/tmp%20and%20/var/tmp%20exist%20and%20are%20writable.%20If%20you%E2%80%99re%20running%20in%20Docker%2C%20ensure%20the%20relevant%20host%20directories%20are%20mounted%20correctly%20and%20have%20the%20right%20permissions.%20You%20can%20also%20try%20switching%20to%20a%20more%20permissive%20sandbox%20image%20like%20%60svcvit/dify-sandbox-py%3A0.1.3%60%20or%20set%20%60privileged%3A%20true%60%20for%20the%20sandbox%2C%20api%2C%20and%20worker%20services%20in%20your%20docker-compose.yaml%20if%20your%20security%20policy%20allows%20it.%20If%20the%20problem%20persists%2C%20check%20for%20external%20security%20layers%20%28like%20SELinux%20or%20AppArmor%29%20or%20user%20remapping%20that%20might%20block%20access.%20For%20more%20details%20and%20step-by-step%20checks%2C%20see%20%5Bthis%20discussion%5D%28https%3A//github.com/langgenius/dify/discussions/25732%29%20and%20%5Bthis%20issue%5D%28https%3A//github.com/langgenius/dify/issues/15267%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/28974)
Author
Owner

@SomaLily commented on GitHub (Dec 15, 2025):

server log is

Image

use 3th sandbox

@SomaLily commented on GitHub (Dec 15, 2025): > server log is > > <img alt="Image" width="1654" height="425" src="https://private-user-images.githubusercontent.com/28382279/520680935-df57a087-97ee-4036-b702-e5b12ebf4b7b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU3ODY2MTcsIm5iZiI6MTc2NTc4NjMxNywicGF0aCI6Ii8yODM4MjI3OS81MjA2ODA5MzUtZGY1N2EwODctOTdlZS00MDM2LWI3MDItZTViMTJlYmY0YjdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMjE1VDA4MTE1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwMGExMGU0NzRiYjU1MTcyZGQxMjVkZmYwMWY5YWQ5NGVlOTk0MzU3ODVhNTI3N2VjZjdhNzMyZDcyMzk3NWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.B8s906AGySU8tiiN7-auV_ZswdJzyeaiBhjy_RXuaI0"> use 3th sandbox
Author
Owner

@Covfefeable commented on GitHub (Dec 17, 2025):

server log is
Image

use 3th sandbox

what's that mean? I encountered same problem:
getcwd: cannot access parent directories: No such file or directory

@Covfefeable commented on GitHub (Dec 17, 2025): > > server log is > > <img alt="Image" width="1654" height="425" src="https://private-user-images.githubusercontent.com/28382279/520680935-df57a087-97ee-4036-b702-e5b12ebf4b7b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU3ODY2MTcsIm5iZiI6MTc2NTc4NjMxNywicGF0aCI6Ii8yODM4MjI3OS81MjA2ODA5MzUtZGY1N2EwODctOTdlZS00MDM2LWI3MDItZTViMTJlYmY0YjdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMjE1VDA4MTE1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwMGExMGU0NzRiYjU1MTcyZGQxMjVkZmYwMWY5YWQ5NGVlOTk0MzU3ODVhNTI3N2VjZjdhNzMyZDcyMzk3NWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.B8s906AGySU8tiiN7-auV_ZswdJzyeaiBhjy_RXuaI0"> > > use 3th sandbox what's that mean? I encountered same problem: getcwd: cannot access parent directories: No such file or directory
Author
Owner

@SomaLily commented on GitHub (Dec 25, 2025):

server log is
Image

use 3th sandbox

what's that mean? I encountered same problem: getcwd: cannot access parent directories: No such file or directory

search svcvit

@SomaLily commented on GitHub (Dec 25, 2025): > > > server log is > > > <img alt="Image" width="1654" height="425" src="https://private-user-images.githubusercontent.com/28382279/520680935-df57a087-97ee-4036-b702-e5b12ebf4b7b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU3ODY2MTcsIm5iZiI6MTc2NTc4NjMxNywicGF0aCI6Ii8yODM4MjI3OS81MjA2ODA5MzUtZGY1N2EwODctOTdlZS00MDM2LWI3MDItZTViMTJlYmY0YjdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMjE1VDA4MTE1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwMGExMGU0NzRiYjU1MTcyZGQxMjVkZmYwMWY5YWQ5NGVlOTk0MzU3ODVhNTI3N2VjZjdhNzMyZDcyMzk3NWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.B8s906AGySU8tiiN7-auV_ZswdJzyeaiBhjy_RXuaI0"> > > > > > > use 3th sandbox > > what's that mean? I encountered same problem: getcwd: cannot access parent directories: No such file or directory search svcvit
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20706