nextcloud / workflow_script

Rule based processing of files through specified external scripts
https://apps.nextcloud.com/apps/workflow_script
GNU Affero General Public License v3.0
73 stars 19 forks source link

Event trigered. Action not executed. Log tell it's OK #107

Open chrisaga opened 2 years ago

chrisaga commented 2 years ago

Steps to reproduce

  1. Create a simple workflow (e.g. echo toto>/tmp/1.log) trigered by file creation and/or write an/or rename
  2. Create a new text file in nextcloud (or modify it, or rename it)
  3. Look at the log for messages with "message":"All qualified flow configurations are going to run" and "message":"All qualified flow configurations are going to run". Messages are there, yeah !
  4. See that file /tmp/1.log has not been written :-(
  5. Try to write in other directories, try to use a shell script (and trap possible TERM signal), ... same result

Expected behaviour

Action would be executed If not, log shouldn't tell it is but should give a clue about what's wrong

Actual behaviour

Event is triggered (traced in the log), but action is not executed

Workflow Script app

Workflow Script app version: 1.7.0

Server configuration

Operating system: Debian GNU/Linux 9

Web server: Apache

Database: MySQL

PHP version: 7.3.31

Nextcloud Version: 22.2.3

Where did you install Nextcloud from: Nextcloud upgrade

Signing status:

No errors have been found.
``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your server installation folder ```

Nextcloud configuration:

``` { "system": { "htaccess.RewriteBase": "\/", "mail_smtpmode": "sendmail", "mail_sendmailmode": "pipe", "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.chrisagathon.fr" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "22.2.3.0", "overwrite.cli.url": "https:\/\/cloud.chrisagathon.fr", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "app_install_overwrite": [ "files_frommail", "files_mindmap" ], "maintenance": false, "updater.secret": "***REMOVED SENSITIVE VALUE***", "loglevel": 1, "theme": "", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "updater.release.channel": "stable", "default_phone_region": "FR" } } ```

Are you using external storage, if yes which one: no

Are you using encryption: no

Server log (data/nextcloud.log)

``` {"reqId":"qH0sRPJEwBjgZT44bvFs","level":1,"time":"2021-12-03T13:29:59+00:00","remoteAddr":"188.141.219.67","user":"chris","app":"workflowengine","method":"MOVE","url":"/remote.php/dav/files/chris/test2/content/toto1.md","message":"All qualified flow configurations are going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.3.0","data":{"entity":{"class":"OCA\\WorkflowEngine\\Entity\\File","name":"Fichier"},"operation":{"class":"OCA\\WorkflowScript\\Operation","name":"Run script"},"configuration":[{"id":"3","class":"OCA\\WorkflowScript\\Operation","name":"","checks":"[2]","operation":"echo toto> /tmp/toto;sleep 30","entity":"OCA\\WorkflowEngine\\Entity\\File","events":"[\"\\\\OCP\\\\Files::postCreate\",\"\\\\OCP\\\\Files::postWrite\",\"\\\\OCP\\\\Files::postRename\",\"\\\\OCP\\\\Files::postDelete\"]","scope_type":"0","scope_actor_id":""}],"message":"All qualified flow configurations are going to run"}} {"reqId":"qH0sRPJEwBjgZT44bvFs","level":1,"time":"2021-12-03T13:29:59+00:00","remoteAddr":"188.141.219.67","user":"chris","app":"workflowengine","method":"MOVE","url":"/remote.php/dav/files/chris/test2/content/toto1.md","message":"Flow handling for event done","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.3.0","data":{"operation":{"class":"OCA\\WorkflowScript\\Operation","name":"Run script"},"entity":{"class":"OCA\\WorkflowEngine\\Entity\\File","name":"Fichier"},"eventName":"\\OCP\\Files::postRename","message":"Flow handling for event done"}} ```
blizzz commented 11 months ago

systemd may jail you into a different subdirectory within /tmp, like /tmp/systemd-private-123456789abcdef0123456789abcde-php-fpm.service-AB0cdE/