dify icon indicating copy to clipboard operation
dify copied to clipboard

When I used the new version 0.68 and the 0.20 sandbox, I still encountered workflow errors: error: operation not permitted

Open xiaoxiongxyy opened this issue 1 year ago • 5 comments

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

image simple code: def main(arg1): print(arg1)

✔️ Expected Behavior

no error

❌ Actual Behavior

panic

xiaoxiongxyy avatar May 22 '24 06:05 xiaoxiongxyy

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!

dosubot[bot] avatar May 22 '24 06:05 dosubot[bot]

my test code: def main(arg1): print(arg1)

xiaoxiongxyy avatar May 22 '24 06:05 xiaoxiongxyy

def main(arg1): return {'result': str(arg1)} 你可以尝试一下这个代码

WillWillWong avatar May 23 '24 07:05 WillWillWong

To resolve the "error: operation not permitted" issue when using Dify version 0.68 in a self-hosted Docker environment, follow these steps:

  1. 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
    
  2. Set Proper Permissions: Ensure your user has the necessary permissions to run Docker commands:

    sudo usermod -aG docker $USER
    
  3. Clone Dify Repository: Clone the Dify source code to your local machine:

    git clone https://github.com/langgenius/dify.git
    
  4. Navigate to Docker Directory: Navigate to the docker directory in the Dify source code:

    cd dify/docker
    
  5. Review and Modify Docker Compose Configuration: Ensure the docker-compose.yaml file 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
    
  6. Start Dify: Start Dify using Docker Compose:

    docker compose up -d
    
  7. Check Container Status: Verify that all containers are running successfully:

    docker compose ps
    
  8. Review Docker Logs: Check the Docker container logs for any additional insights into the permission issue:

    docker logs <container_name>
    
  9. SELinux/AppArmor Policies: If SELinux or AppArmor is active, adjust the policies to allow the needed operations.

  10. Docker Security Options: Consider Docker's security options like --cap-add or --privileged to 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


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.

dosubot[bot] avatar May 23 '24 07:05 dosubot[bot]

@xiaoxiongxyy It looks like you don't have enough permissions on the Dify server. Try changing the Dify server permissions using the chomod command.

junonya avatar May 25 '24 13:05 junonya

See this https://github.com/langgenius/dify/issues/4993 for updates

crazywoola avatar Jul 09 '24 14:07 crazywoola