workflow_script
workflow_script copied to clipboard
File access trigger not working
Steps to reproduce
- Create a workflow with trigger "file access"
- Filter: "filename like /.*/"
- Script: "echo '%e %i %a' >> /path/to/a/file"
- Open a file in web or webdav or sync with desktop client
- Run 'sudo -u www-data php -f /var/www/nextcloud/cron.php' on cli
Expected behaviour
The file should contain a line with the file operation file id and the user name.
Actual behaviour
There are nothing happened. No log entries. Appears on NC 20 and NC 21 Trigger with file create, change, delete and rename are working fine.
Workflow Script app
Workflow Script app version: 1.5.1 & 1.6.0
Server configuration
Operating system: Ubuntu 20.04.2
Web server: Apache v2.4.41
Database: MySQL8 v8.0.23-0ubuntu0.20.04.1
PHP version: v7.4.16,
Nextcloud version: (see Nextcloud admin page) 20.0.10 & 21.0.2
did you check the flow.log in data dir?
It seems that flow.log is not be filled by workflow_script. There is not one entry by this app. Watching with tail -f flow.log and doing the described steps not showing anything including the actions that are working properly (create, change etc.) The app files_accesscontrol is writing to this log if an access is prevented.
ah, i think the loglevel should be set to 1 for this.
Ok, now flow.log is receiving information about the workflow stuff. But with loglevel 1 there are again no information about the action "access file". I tried with loglevel 0 and I got the following output from opening a text file in web ui. Again, there are no information from workflow_script ... :-(
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:20+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"Flow activation: rules were requested","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"scopes":[{"scope":"admin"},{"scope":"user","uid":"[email protected]"}],"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"Flow activation: rules were requested"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"No flow configurations is going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"No flow configurations is going to run"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"Flow activation: rules were requested","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"scopes":[{"scope":"admin"},{"scope":"user","uid":"[email protected]"}],"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"Flow activation: rules were requested"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"No flow configurations is going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"No flow configurations is going to run"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"Flow activation: rules were requested","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"scopes":[{"scope":"admin"},{"scope":"user","uid":"[email protected]"}],"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"Flow activation: rules were requested"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"No flow configurations is going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"No flow configurations is going to run"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"Flow activation: rules were requested","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"scopes":[{"scope":"admin"},{"scope":"user","uid":"[email protected]"}],"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"Flow activation: rules were requested"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"No flow configurations is going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"No flow configurations is going to run"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"Flow activation: rules were requested","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"scopes":[{"scope":"admin"},{"scope":"user","uid":"[email protected]"}],"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"Flow activation: rules were requested"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"No flow configurations is going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"No flow configurations is going to run"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"Flow activation: rules were requested","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"scopes":[{"scope":"admin"},{"scope":"user","uid":"[email protected]"}],"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"Flow activation: rules were requested"}}
{"reqId":"cmhhdn8YHuzIbow0blxG","level":0,"time":"2021-05-26T18:20:21+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"GET","url":"/apps/files_texteditor/ajax/loadfile?filename=1377.txt&dir=%2F","message":"No flow configurations is going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\FilesAccessControl\Operation","name":"Zugriff auf Datei verhindern"},"message":"No flow configurations is going to run"}}
As a counterpart, here are the logs from saving a change to a file:
{"reqId":"VdUlQDZRF0n5LrYRBpg7","level":1,"time":"2021-05-26T18:17:02+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"PUT","url":"/apps/files_texteditor/ajax/savefile","message":"All qualified flow configurations are going to run","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"entity":{"class":"OCA\WorkflowEngine\Entity\File","name":"Datei"},"operation":{"class":"OCA\WorkflowScript\Operation","name":"Run script"},"configuration":[{"id":"8","class":"OCA\WorkflowScript\Operation","name":"","checks":"[10]","operation":"/nc-config/lock-file %i %a %e","entity":"OCA\WorkflowEngine\Entity\File","events":"["\\OCP\\Files::postTouch","\\OCP\\Files::postWrite"]","scope_type":"0","scope_actor_id":""}],"message":"All qualified flow configurations are going to run"}}
{"reqId":"VdUlQDZRF0n5LrYRBpg7","level":1,"time":"2021-05-26T18:17:02+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"PUT","url":"/apps/files_texteditor/ajax/savefile","message":"Flow handling for event done","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\WorkflowScript\Operation","name":"Run script"},"entity":{"class":"OCA\WorkflowEngine\Entity\File","name":"Datei"},"eventName":"\OCP\Files::postWrite","message":"Flow handling for event done"}}
{"reqId":"VdUlQDZRF0n5LrYRBpg7","level":1,"time":"2021-05-26T18:17:02+00:00","remoteAddr":"x.x.x.x","user":"[email protected]","app":"workflowengine","method":"PUT","url":"/apps/files_texteditor/ajax/savefile","message":"Flow handling for event done","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.2.1","data":{"operation":{"class":"OCA\WorkflowScript\Operation","name":"Run script"},"entity":{"class":"OCA\WorkflowEngine\Entity\File","name":"Datei"},"eventName":"\OCP\Files::postWrite","message":"Flow handling for event done"}}
Any updates on this? Having the same problem...