dify icon indicating copy to clipboard operation
dify copied to clipboard

The Template Transform node has error : operation not permitted

Open kkjinping opened this issue 1 year ago • 3 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. equals string has error
{% if text == '1' %}
1
{% endif %}
  1. join is ok, but join(',') has error
{{text | join(','}}
  1. replace has error, the example from dify doc
{{ item.content | replace('\n', '\n\n') }}

1731398471116 1731398475410

✔️ Expected Behavior

no error

❌ Actual Behavior

No response

kkjinping avatar Nov 12 '24 08:11 kkjinping

I found a similar issue related to the "operation not permitted" error in Dify, which might be relevant to your situation. The issue was discussed in this thread, where users encountered workflow errors in a self-hosted Docker environment. The suggested solution involves checking Docker and Docker Compose versions, setting proper permissions, and reviewing Docker Compose configurations [1].

Here are some steps you can try to resolve the issue:

  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: Make sure your user has the necessary permissions to run Docker commands.

    sudo usermod -aG docker $USER
    
  3. Review and Modify Docker Compose Configuration: Ensure the docker-compose.yaml file is correctly configured, especially the volume mounts and network settings.

  4. Check Container Status: Verify that all containers are running successfully.

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

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

  7. Docker Security Options: Consider Docker's security options like --cap-add or --privileged to grant additional permissions, but use them cautiously.

These steps should help address the "operation not permitted" error. If the issue persists, further investigation into the specific error messages or logs generated by the Template Transform node might be necessary.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Nov 12 '24 08:11 dosubot[bot]

Thanks for reporting this issue, we will take a look at this later.

crazywoola avatar Nov 12 '24 08:11 crazywoola

Hi, @kkjinping. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • Bug reported in the Template Transform node of Dify, version 0.11.1, when self-hosted via Docker.
  • Errors encountered with string operations.
  • I suggested checking Docker versions, permissions, and configurations.
  • Crazywoola acknowledged the issue and mentioned that the team would investigate further.

Next Steps

  • Please confirm if this issue is still relevant to the latest version of the Dify repository. If so, you can keep the discussion open by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Dec 13 '24 16:12 dosubot[bot]

0.14 as well

kkjinping avatar Dec 18 '24 08:12 kkjinping

@crazywoola

kkjinping avatar Dec 18 '24 08:12 kkjinping

I also have this problem. The current version of dify is 0.14.1. Has it been solved?

xuemusi avatar Dec 20 '24 02:12 xuemusi

I also have this problem. The current version of dify is 0.14.1. Has it been solved?

It's not.

kkjinping avatar Dec 20 '24 02:12 kkjinping

{% if text == '1' %} 1 {% endif %}

work fine on cloud and my local env

image image

yihong0618 avatar Dec 20 '24 03:12 yihong0618

The problem I have is that the simple code works. But it won't work if you introduce sdk.

xuemusi avatar Dec 20 '24 03:12 xuemusi

{% if text == '1' %} 1 {% endif %}

work fine on cloud and my local env

image image

Cloud is fine. But my local env based on Docker Compose is error.

kkjinping avatar Dec 20 '24 06:12 kkjinping

It has been found that the problem can be solved through the following steps:

  1. Modify the volumes mapping of the sandbox in docker-compose.yaml, and add "/volumes/sandbox/conf:/conf".
  2. Modify the "allowed_syscalls" in /volumes/sandbox/conf/config.yaml, and add "0-500".

kkjinping avatar Dec 26 '24 03:12 kkjinping