When I used the new version 0.68 and the 0.20 sandbox, I still encountered workflow errors: error: operation not permitted
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.68
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
no error
❌ Actual Behavior
panic
Hello @xiaoxiongxyy! I'm Dosu, a bot here to help you squash bugs, answer questions, and guide you on becoming a contributor. While you wait for a human maintainer, I'm here to assist. I'll take a look at your issue and get back to you shortly!
my test code: def main(arg1): print(arg1)
def main(arg1): return {'result': str(arg1)} 你可以尝试一下这个代码
To resolve the "error: operation not permitted" issue when using Dify version 0.68 in a self-hosted Docker environment, follow these steps:
-
Check Docker and Docker Compose Versions: Ensure you have Docker 19.03 or later and Docker Compose 1.25.1 or later installed:
docker --version docker-compose --version -
Set Proper Permissions: Ensure your user has the necessary permissions to run Docker commands:
sudo usermod -aG docker $USER -
Clone Dify Repository: Clone the Dify source code to your local machine:
git clone https://github.com/langgenius/dify.git -
Navigate to Docker Directory: Navigate to the docker directory in the Dify source code:
cd dify/docker -
Review and Modify Docker Compose Configuration: Ensure the
docker-compose.yamlfile is correctly configured, especially the volume mounts and network settings:services: db: image: postgres:15-alpine volumes: - ./volumes/db/data:/var/lib/postgresql/data redis: image: redis:6-alpine volumes: - ./volumes/redis/data:/data sandbox: image: langgenius/dify-sandbox:0.2.0 volumes: - ./volumes/sandbox/dependencies:/dependencies -
Start Dify: Start Dify using Docker Compose:
docker compose up -d -
Check Container Status: Verify that all containers are running successfully:
docker compose ps -
Review Docker Logs: Check the Docker container logs for any additional insights into the permission issue:
docker logs <container_name> -
SELinux/AppArmor Policies: If SELinux or AppArmor is active, adjust the policies to allow the needed operations.
-
Docker Security Options: Consider Docker's security options like
--cap-addor--privilegedto grant additional permissions, but use them cautiously:docker run --cap-add=SYS_ADMIN --security-opt seccomp=unconfined <image_name>
Ensure you have the necessary permissions and that your Docker setup meets the prerequisites as outlined in the documentation. If the issue persists, consult your system administrator or refer to Docker's documentation for further troubleshooting.
Details
Sources
- Code block error: operation not permitted with dify-sandbox 0.2.0
- Workflow run code tool error: operation not permitted
- en/getting-started/install-self-hosted/docker-compose.md
- docker/docker-compose.middleware.yaml
- docker/docker-compose.yaml
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
@xiaoxiongxyy It looks like you don't have enough permissions on the Dify server. Try changing the Dify server permissions using the chomod command.
See this https://github.com/langgenius/dify/issues/4993 for updates