Coder Social home page Coder Social logo

nextcloud / workflow_script Goto Github PK

View Code? Open in Web Editor NEW
67.0 4.0 19.0 634 KB

Rule based processing of files through specified external scripts

Home Page: https://apps.nextcloud.com/apps/workflow_script

License: GNU Affero General Public License v3.0

PHP 89.85% JavaScript 10.15%
nextcloud nextcloud-app

workflow_script's Introduction

Nextcloud Workflow Script app

This app enables Nextcloud to pass on files to external scripts when they were created or changed. By utilizing the workflow engine it allows Nextcloud administrators to define rules upon which matching files are enqueued to be run against a specified script. Eventually, the command is executed in a background job.

Learn more about workflows on https://nextcloud.com/workflow

The settings screen

Placeholders

After enabling this app, rules can be defined in the admin settings, "External scripts" section.

When defining the script, you can specify one of the following placeholders that will be replaced with the appropriate value:

Placeholder Description example value
%e the event type \OCP\Files::postCreate, \OCP\Files::postWrite or \OCP\Files::postRename
%i file id 142430
%a actor's user id bob
%o owner's user id alice
%n nextcloud-relative path alice/files/Pictures/Wonderland/20180717_192103.jpg
%f locally available file /tmp/oc_tmp_m6E6OO-.jpg
%x old nextcloud-relative file path (only on rename and copy) alice/files/Workbench/20180717_192103.jpg

When no placeholder was specified, then the exact command as given is being executed.

Hints

Events for files and folders are triggered by file system operations. An operation like \OCP\Files::postCopy is read, create and write a file.

Action Events
Copy file \OCP\Files::postCopy
\OCP\Files::postCreate
\OCP\Files::postWrite
Create file \OCP\Files::postTouch
\OCP\Files::postCreate
\OCP\Files::postWrite
Delete file \OCP\Files::postDelete
Move file \OCP\Files::postRename
Rename file \OCP\Files::postRename
Update file \OCP\Files::postWrite

Example

All plain text files should be passed to a tool that collects statistics of the writing style of a document and writes them back to a specified mount on the host, in a subfolder that matches the actor's ID, and filename consisting of the basename plus ".style" appended:

pass a file to style and write back the results

style -L de %f > /Lektorat/%a/$(basename %n).style

And after the cron job was run, you'll find the results on the expected place:

$ cat /Lektorat/bob/Sanin\ -\ Artsybashev.txt.style
readability grades:
        Kincaid: 10.2
        ARI: 10.4
        Coleman-Liau: 10.6
        Flesch Index: 55.7/100
        Fog Index: 12.5
        Lix: 39.0 = school year 6
        SMOG-Grading: 6.4
sentence info:
        684404 characters
        143798 words, average length 4.76 characters = 1.56 syllables
        7606 sentences, average length 18.9 words
        47% (3591) short sentences (at most 14 words)
        18% (1390) long sentences (at least 29 words)
        1 paragraphs, average length 7606.0 sentences
        4% (378) questions
        24% (1849) passive sentences
        longest sent 164 wds at sent 339; shortest sent 1 wds at sent 4
word usage:
        verb types:
        to be (2154) auxiliary (1581) 
        types as % of total:
        conjunctions 7% (10560) pronouns 9% (12733) prepositions 8% (10894)
        nominalizations 1% (1638)
sentence beginnings:
        pronoun (1209) interrogative pronoun (306) article (795)
        subordinating conjunction (275) conjunction (701) preposition (529)

Limitations

This app does not work with either encryption method.

workflow_script's People

Contributors

afranke avatar blizzz avatar cchartmann avatar come-nc avatar dependabot[bot] avatar jospoortvliet avatar juliushaertl avatar k1l1 avatar kesselb avatar morrisjobke avatar nextcloud-bot avatar nextcloud-command avatar nickvergessen avatar r0wi avatar skjnldsv avatar vitormattos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

workflow_script's Issues

External script does not work in shared folders

Steps to reproduce

A shares a folder with B. B uploads a file to the folder and the script gets executed.

Expected behaviour

The script gets executed, %i and %f should not be empty.

Actual behaviour

The script gets executed, %i is filled but %f is empty.
When the script is executed by a user in a folder he owns, it works fine.

Workflow Script app

Workflow Script app version: (see apps admin page: /index.php/settings/apps)
workflow_script: 1.3.1

Nextcloud version:
18.0.3

no settings page with nextcloud 17.0.1

I can't see any "external scripts" or "workflow" settings in the admin (or even user) settings.

Might be related or not: I tried to enable this plugin only for the admins group but it failed and the log shows the following:

  | InvalidArgumentException: workflow_script can't be enabled for groups.
/usr/share/webapps/nextcloud/settings/Controller/AppSettingsController.php - line 450: OC\App\AppManager->enableAppForGroups("workflow_script", [ OC\Group\Group {}])
/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 170: OC\Settings\Controller\AppSettingsController->enableApps([ "workflow_script"], [ "admin"])
/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 99: OC\AppFramework\Http\Dispatcher->executeController(OC\Settings\ ... {}, "enableApps")
/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php - line 126: OC\AppFramework\Http\Dispatcher->dispatch(OC\Settings\ ... {}, "enableApps")
/usr/share/webapps/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App::main("OC\\Setting ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})
<<closure>>OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})
/usr/share/webapps/nextcloud/lib/private/Route/Router.php - line 297: call_user_func(OC\AppFramew ... {}, { _route: "s ... "})
/usr/share/webapps/nextcloud/lib/base.php - line 1000: OC\Route\Router->match("/settings/apps/enable")
/usr/share/webapps/nextcloud/index.php - line 42: OC::handleRequest()
-- | --

Getting "no such file or directory" for created file

Steps to reproduce

  1. Configure new flow with the following parameters:
  • When: file created
  • File MIME type matches (custom) "video/mp4"
  • Run script: head -c 8 "%f"
  1. Activate new flow.
  2. Upload an .mp4 file (whether using desktop client or web interface).

Expected behaviour

Should see head result (first eight bytes) in NC's log.

Actual behaviour

Getting head: cannot open "'/data-folder/user-name/files/file-name.mp4'" for reading: No such file or directory error message on logs when job is run.

Workflow Script app

Workflow Script app version: 1.6.0

Server configuration

Operating system: Linux 5.4.0-65-generic #73~18.04.1-Ubuntu SMP PREEMPT Tue Jan 19 09:45:51 UTC 2021 x86_64

Web server: Apache/2.4.38 (Debian) (apache2handler)

Database: MariaDB 10.4.18

PHP version: 7.4.15
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, bcmath, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud Version: 21.0.0 - 21.0.0.18

Where did you install Nextcloud from: Docker Hub

Signing status: Array
(
)

No errors have been found.

List of activated apps:

Enabled:
  - accessibility: 1.7.0
  - activity: 2.14.3
  - breezedark: 21.0.2
  - cloud_federation_api: 1.4.0
  - comments: 1.11.0
  - contactsinteraction: 1.2.0
  - dashboard: 7.1.0
  - dav: 1.17.1
  - federatedfilesharing: 1.11.0
  - federation: 1.11.0
  - files: 1.16.0
  - files_pdfviewer: 2.1.0
  - files_rightclick: 1.0.0
  - files_sharing: 1.13.1
  - files_trashbin: 1.11.0
  - files_versions: 1.14.0
  - files_videoplayer: 1.10.0
  - firstrunwizard: 2.10.0
  - geoblocker: 0.4.6
  - issuetemplate: 0.7.0
  - logreader: 2.6.0
  - lookup_server_connector: 1.9.0
  - maps: 0.1.8
  - metadata: 0.13.0
  - nextcloud_announcements: 1.10.0
  - notifications: 2.9.0
  - oauth2: 1.9.0
  - password_policy: 1.11.0
  - photos: 1.3.0
  - previewgenerator: 3.1.1
  - privacy: 1.5.0
  - provisioning_api: 1.11.0
  - recommendations: 1.0.0
  - serverinfo: 1.11.0
  - settings: 1.3.0
  - sharebymail: 1.11.0
  - support: 1.4.0
  - survey_client: 1.9.0
  - systemtags: 1.11.0
  - text: 3.2.0
  - theming: 1.12.0
  - twofactor_backupcodes: 1.10.0
  - twofactor_gateway: 0.17.0
  - updatenotification: 1.11.0
  - user_status: 1.1.1
  - viewer: 1.5.0
  - weather_status: 1.1.0
  - workflow_script: 1.6.0
  - workflowengine: 2.3.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_ldap

Nextcloud configuration:

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "overwritehost": "alfajordepollo.com.ar",
        "overwriteprotocol": "https",
        "overwritewebroot": "cloud",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "21.0.0.18",
        "overwrite.cli.url": "https:\/\/localhostcloud",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "app_install_overwrite": [
            "twofactor_gateway",
            "issuetemplate"
        ]
    }
}

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

Are you using encryption: no

Server log (data/nextcloud.log)


Unable to create new "Run script" flow - Nextcloud 18

Steps to reproduce

  1. Login to Nextcloud instance
  2. Navigate to: https://MyNextCloudInstance.com/index.php/settings/admin/workflow
  3. Click "Add new flow" in the "Run script" flow.
  4. Choose selection criteria: "File MIME type" is "text/plain"
  5. Enter script to run: "/usr/bin/test.sh %f"
  6. Click "Save"

Expected behaviour

I would expect the app to create a new flow.

Actual behaviour

What happens is the Save button turns dark yellow and says, "X The configuration is invalid". Below the button it says, "No events are chosen."

Server configuration detail

Operating system: Linux 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.3.22

PHP version:

7.3.14-1~deb10u1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, sodium, standard, apache2handler, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, intl, json, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 18.0.1 - 18.0.1.3

Updated from an older Nextcloud/ownCloud or fresh install: Updated from Nextcloud version 17.?

Where did you install Nextcloud from: Original install was Jan 2020 - version 17.x

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.4.0
 - activity: 2.11.0
 - admin_audit: 1.8.0
 - apporder: 0.9.0
 - bookmarks: 2.3.4
 - cloud_federation_api: 1.1.0
 - cms_pico: 1.0.5
 - comments: 1.8.0
 - cookbook: 0.5.7
 - cospend: 0.3.2
 - dav: 1.14.0
 - federatedfilesharing: 1.8.0
 - files: 1.13.1
 - files_automatedtagging: 1.8.0
 - files_pdfviewer: 1.7.0
 - files_retention: 1.7.0
 - files_rightclick: 0.15.2
 - files_sharing: 1.10.1
 - files_trashbin: 1.8.0
 - files_versions: 1.11.0
 - files_videoplayer: 1.7.0
 - firstrunwizard: 2.7.0
 - issuetemplate: 0.6.0
 - logreader: 2.3.0
 - lookup_server_connector: 1.6.0
 - metadata: 0.11.1
 - nextcloud_announcements: 1.7.0
 - notes: 3.1.5
 - notifications: 2.6.0
 - oauth2: 1.6.0
 - password_policy: 1.8.0
 - photos: 1.0.0
 - provisioning_api: 1.8.0
 - recommendations: 0.6.0
 - serverinfo: 1.8.0
 - settings: 1.0.0
 - sharebymail: 1.8.0
 - support: 1.1.0
 - suspicious_login: 3.1.0
 - systemtags: 1.8.0
 - theming: 1.9.0
 - twofactor_backupcodes: 1.7.0
 - twofactor_totp: 4.1.2
 - updatenotification: 1.8.0
 - video_converter: 0.1.3
 - viewer: 1.2.0
 - workflow_pdf_converter: 1.3.1
 - workflow_script: 1.3.1
 - workflowengine: 2.0.0
Disabled:
 - analytics
 - encryption
 - federation
 - files_accesscontrol
 - files_external
 - privacy
 - survey_client
 - text
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "192.168.x.x",
        "myURL.com",
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "18.0.1.3",
    "overwrite.cli.url": "http:\/\/myURL.com\/nextcloud",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "maintenance": false,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_sendmailmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpauth": 1,
    "mail_smtpsecure": "ssl",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "theme": "",
    "loglevel": 2,
    "updater.release.channel": "stable"
}

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

Are you using encryption:

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

Operating system:

Logs

Web server error log
I don't think this is related to this issue - but I suppose it could be.  I did find this line in my web server error log.  It was only listed once in the error log (/var/log/apache2/error.log):

[Tue Feb 18 11:31:41.776200 2020] [php7:warn] [pid 25286] [client x.x.x.x:35626] PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/html/nextcloud/apps/workflowengine/lib/Helper/LogContext.php on line 55

Nextcloud log

Browser log

RunScript_Error

Request: Add way to trigger tasks for immediate action

The scheduled tasks will only be executed on the next cron run.

For testing it would be great if one could trigger it from within the web interface. Alternatively it should be documented how to do through a terminal (=> call cron.php)

Move File to new Location

Hi,
can someone help me, I want to combine PDF Converter and External Script.
So i Upload or Update and Word File. This is converted to PDF and then the PDF needs to be copyed to a new location.

Did someone got this copy part done allready?

Nextcloud 21.0.4 and upload feature

Steps to reproduce

  1. installing Workflow external scripts 1.5.1 into Nextcloud 21.0.4

Expected behaviour

  1. Find "file is uploaded" condition
  2. Find "and is located"
  3. Find "Pick a folder"

Actual behaviour

No "file is uploaded" condition is shown

Workflow Script app

Workflow Script app version: 1.5.1

Server configuration

Operating system: Debian Stretch

Web server: Apache 2.4.25

Database: Maria 10.1.48

PHP version: 7.3.24

Nextcloud Version: 21.0.4

Where did you install Nextcloud from: from official nextcloud download webpage

Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed

No errors have been found.

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

Are you using encryption: no

MY QUESTION:

Installing Workflow external scripts from github solve the issue?

Thanks

Provide placeholder for absolute path

All my scripts work with absolute paths and I use something like /var/www/m.js86.de/files/ocdata/"$1" where the first parameter is %n. However, it should be easy to directly provide a placeholder with the absolute path. (If I understand it correctly, %n is created by using the full path and stripping the base).

No way to save changed command until pressing enter

Found with version 1.1.0

Steps to reproduce

  1. Create rules group and save it
  2. reload the page (F5)
  3. Edit the command.

Expected behaviour

The save button should show up

Actual behaviour

One has to press enter to make the save button to show up.

If page gets refreshed meanwhile, the changes get lost.

Script execution terminated when using systemd timer as cron job scheduler

Steps to reproduce

  1. Use systemd as the cron job scheduler, as per instructions in https://docs.nextcloud.com/server/19/admin_manual/configuration_server/background_jobs_configuration.html#systemd
  2. Set up a workflow script that requires quite some time to run, e.g. sleep 10; echo "finished" > /tmp/flow_output
  3. Trigger the cron job, e.g. from command line systemctl start nextcloudcron.service

Expected behaviour

The workflow script finishes successfully.

Actual behaviour

Nothing happens. No output in /tmp/flow_output.

Workflow Script app

1.4.0

Workaround

Because systemd defaults to kill all the processes of a service unit as soon as the main process has exited, once the php process exits, the child process where the flow script is running will be killed, too. Making systemd only kill the main process but leaving all child processes intact works around this problem (ref: systemd.kill).

Append KillMode=process to the nextcloudcron.service file:

[Unit]
Description=Nextcloud cron.php job

[Service]
User=www-data
ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php
KillMode=process

I'm not sure if this issue should be filed here, or under the server repo, or the documentation repo. I feel that posting it here may save someone who runs into the same problem hours of researching.

Q: NC21 in Docker - Flow Script not Activated

Hi!

I have NC 21 installed in Docker (on Debian Buster), and currently writing custom flow script, it should create a PDF from a given file. Unfortunately, due to some limits of built-in standard features I have to design my own script.
I added custom flow script, based on Tag assignment: “ok” tag assigned to a file - run script.

/opt/CalcSheet2pdf.sh -f %n -o %o

Script copied inside Docker container:

docker cp CalcSheet2pdf.sh xxxxxxxxxx:/opt

Right now (for debug purposes) this script simply outputs line with date to the log file, and does NOTHING else. I can login into docker container, and run this script from within the Bash shell, it outputs log file in /var/log (where I can navigate within docker). So script’s syntax is OK, its “rx” permissions are for everyone.
However, when I assign tag “ok” in NC Web to a file, I can’t find any trace of this script ever luanched. No logs in /var/log in Docker container, and no logs in /var/cloud_data within Docker’s host OS (where NC log file lives).

cat nextcloud.log | grep Calc

results nothing.

Any idea what went wrong?
Thanks in advance.

Run script immediatly after trigger

Currently the scripts are run with the next cron job.
This is not usable for some cases, e.g. I try to lock a file with an other app if it's opened or updated.
I don't want to trigger cron any 10 secounds because there are other jobs like generating previews and file scan etc.
Other APP like https://github.com/nextcloud/files_accesscontrol are grip immediatly.
How can I configure this direct behavior with workflow_script?

Error while processing multiple files

Steps to reproduce

  1. Install workflow_script App
  2. Setup new flow (Admin section) to run /full/path/process_file.sh %n
  3. Add file to fulfill flow condition

process_file.sh:
#!/bin/sh
JPGFILE=$1
NCDATA="/DATEN/nextcloud_data"
FILE="$NCDATA$1"
BASE="${FILE%.}"
FILEPATH="${JPGFILE%/
}"
TARGET="$BASE.pdf"
ocrmypdf -l deu+eng --image-dpi 300 $FILE $TARGET && rm $FILE
php /var/www/cloud.ds-ing.net/nextcloud/occ files:scan --path=$FILEPATH

Expected behaviour

process_file.sh should be run for each of the new files, convert the file into pdf (including OCR) and re-scan the respective directory so that the newly created pdf is visible within nextcloud.

Actual behaviour

For single files, everything works as expected. If multiple files are written between 2 cron.php calls, the script does not work (at least if commands are involved which need a considerable time to finish).

I can't tell if the error is caused by bad configuation or a bug in one of the tools...

Running cron.php manually reveals the following error:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.6/multiprocessing/managers.py", line 177, in accepter
t.start()
File "/usr/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

Traceback (most recent call last):
File "/usr/bin/ocrmypdf", line 11, in
load_entry_point('ocrmypdf==6.1.2', 'console_scripts', 'ocrmypdf')()
File "/usr/lib/python3/dist-packages/ocrmypdf/main.py", line 816, in run_pipeline
logging_factory, name, logger_args)
File "/usr/lib/python3/dist-packages/ruffus/proxy_logger.py", line 343, in make_shared_logger_and_proxy
logger_proxy = manager.setup_logger(logger_name, args)
File "/usr/lib/python3.6/multiprocessing/managers.py", line 662, in temp
token, exp = self._create(typeid, *args, **kwds)
File "/usr/lib/python3.6/multiprocessing/managers.py", line 554, in _create
conn = self._Client(self._address, authkey=self._authkey)
File "/usr/lib/python3.6/multiprocessing/connection.py", line 493, in Client
answer_challenge(c, authkey)
File "/usr/lib/python3.6/multiprocessing/connection.py", line 732, in answer_challenge
message = connection.recv_bytes(256) # reject large message
File "/usr/lib/python3.6/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/usr/lib/python3.6/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "/usr/lib/python3.6/multiprocessing/connection.py", line 383, in _recv
raise EOFError
EOFError
Traceback (most recent call last):
File "/usr/bin/ocrmypdf", line 11, in
load_entry_point('ocrmypdf==6.1.2', 'console_scripts', 'ocrmypdf')()
File "/usr/lib/python3/dist-packages/ocrmypdf/main.py", line 816, in run_pipeline
logging_factory, name, logger_args)
File "/usr/lib/python3/dist-packages/ruffus/proxy_logger.py", line 343, in make_shared_logger_and_proxy
logger_proxy = manager.setup_logger(logger_name, args)
File "/usr/lib/python3.6/multiprocessing/managers.py", line 662, in temp
token, exp = self._create(typeid, *args, **kwds)
File "/usr/lib/python3.6/multiprocessing/managers.py", line 554, in _create
conn = self._Client(self._address, authkey=self._authkey)
File "/usr/lib/python3.6/multiprocessing/connection.py", line 487, in Client
c = SocketClient(address)
File "/usr/lib/python3.6/multiprocessing/connection.py", line 614, in SocketClient
s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

Workflow Script app

Workflow Script app version: (see apps admin page: /index.php/settings/apps)
1.5.0

Server configuration

Operating system: Ubuntu/RedHat/...
Linux 4.15.0 #1 SMP Tue Jun 9 12:58:54 MSK 2020 x86_64 (Ubuntu 18.04)

Web server: Apache/Nginx
Apache/2.4.29 (Ubuntu) (apache2handler)

Database: MySQL/Maria/SQLite/PostgreSQL
mysql 10.1.47

PHP version:
7.4.13
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, apcu, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, intl, json, exif, mysqli, pdo_mysql, apc, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Phar, Zend OPcache

Nextcloud Version: (see admin page)
20.0.4 - 20.0.4.0

Where did you install Nextcloud from:
https://download.nextcloud.com

Signing status:
Array
(
)

List of activated apps:
Enabled:

  • accessibility: 1.6.0
  • audioplayer: 3.0.0
  • calendar: 2.1.3
  • cloud_federation_api: 1.3.0
  • comments: 1.10.0
  • contacts: 3.4.3
  • contactsinteraction: 1.1.0
  • dashboard: 7.0.0
  • dav: 1.16.2
  • deck: 1.2.3
  • documentserver_community: 0.1.8
  • duplicatefinder: 0.0.4
  • federatedfilesharing: 1.10.2
  • federation: 1.10.1
  • files: 1.15.0
  • files_antivirus: 3.1.1
  • files_external: 1.11.1
  • files_fulltextsearch: 20.0.0
  • files_fulltextsearch_tesseract: 20.0.1
  • files_pdfviewer: 2.0.1
  • files_rightclick: 0.17.0
  • files_sharing: 1.12.1
  • files_texteditor: 2.14.0
  • files_trashbin: 1.10.1
  • files_versions: 1.13.0
  • files_videoplayer: 1.9.0
  • firstrunwizard: 2.9.0
  • fulltextsearch: 20.0.0
  • fulltextsearch_elasticsearch: 20.0.0
  • groupfolders: 8.2.0
  • issuetemplate: 0.7.0
  • logreader: 2.5.0
  • lookup_server_connector: 1.8.0
  • maps: 0.1.8
  • nextcloud_announcements: 1.9.0
  • notes: 4.0.2
  • notifications: 2.8.0
  • oauth2: 1.8.0
  • onlyoffice: 6.2.0
  • password_policy: 1.10.1
  • photos: 1.2.1
  • polls: 1.6.3
  • privacy: 1.4.0
  • provisioning_api: 1.10.0
  • quota_warning: 1.9.1
  • serverinfo: 1.10.0
  • settings: 1.2.0
  • side_menu: 1.21.0
  • spreed: 10.0.5
  • support: 1.3.0
  • systemtags: 1.10.0
  • tasks: 0.13.6
  • theming: 1.11.0
  • twofactor_backupcodes: 1.9.0
  • updatenotification: 1.10.0
  • viewer: 1.4.0
  • workflow_ocr: 1.20.1
  • workflow_script: 1.5.0
  • workflowengine: 2.2.0
    Disabled:
  • activity
  • admin_audit
  • apporder
  • bruteforcesettings
  • encryption
  • epubreader
  • flow_notifications
  • recommendations
  • sharebymail
  • survey_client
  • text
  • user_ldap
  • user_status
  • weather_status

Nextcloud configuration:
{
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"localhost",
"server.url"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "20.0.4.0",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"maintenance": false,
"mysql.utf8mb4": true,
"memcache.local": "\OC\Memcache\APCu",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtpauthtype": "PLAIN",
"mail_smtpauth": 1,
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "465",
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"mail_smtpsecure": "ssl",
"overwrite.cli.url": "https://server.url",
"theme": "",
"loglevel": 2,
"logfile": "/var/log/nextcloud.log",
"logtimezone": "Europe/Berlin",
"auth.bruteforce.protection.enabled": false,
"app_install_overwrite": [
"ocr"
]
}

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

Are you using encryption: no

Server log (data/nextcloud.log)

request: Add filter for folders

It would be great to have additionally a rule to filter for folders.

Example:
All my phone photos get uploaded to a folder called PhonePhotos. I want to process them bot not any photos uploaded into any other folder. Of course I can add this into my script, but that is waste of resources.

%n is replaced with the path stripped unicode escape sequence when php version is 8.0

Steps to reproduce

  1. Use latest docker image (docker.io/library/nextcloud:22.2.1) installed php 8.0
  2. Create a file whose name contains non-ASCII characters like 'テスト01.txt'.

Expected behaviour

Placeholder %n is replaced with the path contains unicode escape sequence, e.g. create 'テスト01.txt' then %n is replaced with '\u30b3\u30d4\u30fc01.txt'.

Actual behaviour

Placeholder %n is replaced with the path stripped unicode escape sequence, e.g. create 'テスト01.txt' then %n is replaced with '01.txt'.

Workflow Script app

Workflow Script app version: 1.7.0

Operating system: Debian

Web server: Apache

Database: SQLite

PHP version: 8.0

Nextcloud Version: 22.2.1

Where did you install Nextcloud from: docker

Note

I tested escapeshellarg within Nextcloud 22 on php7.4/8.0, and found that php 8.0 strips unicode escape sequence while php 7.4 does not.

So following code may cause the issue when php version is 8.0.

$command = str_replace('%n', escapeshellarg($ncRelPath), $command);

Run_script never triggered on file change or other trigger

Steps to reproduce

  1. Create any shell script you want to trigger with this workflow. eg.
#!/bin/sh
printenv >> /tmp/nextcloud_script_trigger

Save it in a location where nextcloud can access it and make it executable.

  1. As nextcloud admin create a new run_script workflow that triggers on pretty much any event.

Nextcloud-run_script-trigger

  1. Save the workflow.
  2. Create a file named foo.txt.
  3. Change the contents of the file by editing via nextcloud webinterface.
  4. Change the contents of the file by locally editing the file via sync-client.
  5. Assign a tag to foo.txt
  6. touch the file on a synched client.
  7. Delete foo.txt via Webinterface or sync-client

Test with different regular expressions, make sure to only use lower-case ASCII characters in filenames so we can be sure that nextcloud doesn't trip over any “special characters”.

  • filename matches /^foo\.txt$/i (as in the example given by the web interface when creating a flow)
  • filename matches foo\.txt (same as above but not case insensitive, though our testfile is explicitly lowercase only)
  • filename matches foo.txt (With . as a wildcard, no dice)
  • filename is foo.txt (Explicit and literal exact filename.)
  • filename matches foo.* (to match anything beginning with foo…)
  • filename matches .* (Doesn't trigger as well though we'd expect this one to trigger on literally any file since that matches everything.)

Expected behaviour

Upon change of a file named foo.txt the run_script flow should be triggered and successfully executed.

Actual behaviour

Nothing.

Workflow Script app

Workflow Script app version: (see apps admin page: /index.php/settings/apps)
Multiple Nextcloud 20.0.9.1: Workflow external scripts: 1.5.1
Nextcloud 21.0.1: Workflow external scripts: 1.5.0

To be honest, we never go this to work at all since run_script was introduced. So this is not a recent regression from our point of view, it never worked.

Server configuration

Operating system:
FreeBSD 12.2-RELEASE-p6
Debian 10 (Buster)

Web server: Apache/Nginx
nginx 1.20.0
nginx 1.19.x
nginx 1.18.x
nginx 1.14.2

Database: MySQL/Maria/SQLite/PostgreSQL
MySQL 5.7.33
Postgres 13.2
MariaDB 10.3.27

PHP version:
PHP 7.4.18
PHP 7.4.16
PHP 7.3.27-1~deb10u1
PHP 7.3.x
PHP 7.2.x

Nextcloud Version: (see admin page)
Versions prior to Nextcloud 17 not relevant anymore, but didn't work there as well.
18.x.y
19.x.y
20.0.3-20.0.0
21.0.0-21.0.1

Where did you install Nextcloud from:
Debian package
FreeBSD package
Source

Signing status:

Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.

Result on all Instances this was tested on:
No errors have been found.

List of activated apps:

``` 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 20.0.9

  - accessibility: 1.6.0
  - activity: 2.13.4
  - analytics: 3.4.1
  - calendar: 2.2.1
  - cloud_federation_api: 1.3.0
  - comments: 1.10.0
  - contacts: 3.5.1
  - contactsinteraction: 1.1.0
  - cookbook: 0.8.4
  - dashboard: 7.0.0
  - dav: 1.16.2
  - deck: 1.2.7
  - event_update_notification: 1.2.0
  - external: 3.7.2
  - federatedfilesharing: 1.10.2
  - federation: 1.10.1
  - files: 1.15.0
  - files_accesscontrol: 1.10.2
  - files_automatedtagging: 1.10.1
  - files_fulltextsearch_tesseract: 20.0.1
  - files_pdfviewer: 2.0.1
  - files_retention: 1.9.0
  - files_rightclick: 0.17.0
  - files_sharing: 1.12.2
  - files_trashbin: 1.10.1
  - files_versions: 1.13.0
  - files_videoplayer: 1.9.0
  - firstrunwizard: 2.9.0
  - flow_notifications: 1.0.3
  - groupfolders: 8.2.1
  - integration_discourse: 1.0.0
  - integration_github: 1.0.0
  - integration_gitlab: 1.0.0
  - integration_zammad: 1.0.0
  - logreader: 2.5.0
  - lookup_server_connector: 1.8.0
  - nextcloud_announcements: 1.9.0
  - notifications: 2.8.0
  - oauth2: 1.8.0
  - password_policy: 1.10.1
  - photos: 1.2.3
  - polls: 1.8.3
  - privacy: 1.4.0
  - provisioning_api: 1.10.0
  - quota_warning: 1.9.1
  - ransomware_protection: 1.10.0
  - recommendations: 0.8.0
  - serverinfo: 1.10.0
  - settings: 1.2.0
  - sharebymail: 1.10.0
  - socialsharing_email: 2.2.0
  - spreed: 10.0.7
  - systemtags: 1.10.0
  - tasks: 0.13.6
  - terms_of_service: 1.6.1
  - text: 3.1.0
  - theming: 1.11.0
  - twofactor_backupcodes: 1.9.0
  - twofactor_gateway: 0.17.0
  - twofactor_totp: 5.0.0
  - twofactor_u2f: 6.1.0
  - updatenotification: 1.10.0
  - user_status: 1.0.1
  - user_usage_report: 1.4.2
  - viewer: 1.4.0
  - weather_status: 1.0.0
  - workflow_ocr: 1.20.2
  - workflow_script: 1.5.1
  - workflowengine: 2.2.0

Nextcloud 21.0.1

  - accessibility: 1.7.0
  - activity: 2.14.3
  - bruteforcesettings: 2.1.0
  - calendar: 2.2.1
  - cloud_federation_api: 1.4.0
  - comments: 1.11.0
  - contacts: 3.5.1
  - contactsinteraction: 1.2.0
  - dashboard: 7.1.0
  - dav: 1.17.1
  - federatedfilesharing: 1.11.0
  - federation: 1.11.0
  - files: 1.16.0
  - files_accesscontrol: 1.11.0
  - files_automatedtagging: 1.11.0
  - files_pdfviewer: 2.1.0
  - files_rightclick: 1.0.0
  - files_sharing: 1.13.1
  - files_trashbin: 1.11.0
  - files_versions: 1.14.0
  - files_videoplayer: 1.10.0
  - firstrunwizard: 2.10.0
  - flow_notifications: 1.1.0
  - groupfolders: 9.0.1
  - logreader: 2.6.0
  - lookup_server_connector: 1.9.0
  - nextcloud_announcements: 1.10.0
  - notifications: 2.9.0
  - oauth2: 1.9.0
  - password_policy: 1.11.0
  - photos: 1.3.0
  - privacy: 1.5.0
  - provisioning_api: 1.11.0
  - quota_warning: 1.10.0
  - recommendations: 1.0.0
  - serverinfo: 1.11.0
  - settings: 1.3.0
  - sharebymail: 1.11.0
  - systemtags: 1.11.0
  - text: 3.2.0
  - theming: 1.12.0
  - twofactor_backupcodes: 1.10.0
  - twofactor_totp: 6.0.0
  - twofactor_u2f: 6.1.0
  - updatenotification: 1.11.0
  - user_status: 1.1.1
  - viewer: 1.5.0
  - weather_status: 1.1.0
  - workflow_ocr: 1.21.0
  - workflow_script: 1.6.0
  - workflowengine: 2.3.0

Nextcloud 20.0.9.1

  - accessibility: 1.6.0
  - activity: 2.13.4
  - admin_audit: 1.10.0
  - bruteforcesettings: 2.1.0
  - calendar: 2.2.1
  - cloud_federation_api: 1.3.0
  - cms_pico: 1.0.15
  - comments: 1.10.0
  - contactsinteraction: 1.1.0
  - dashboard: 7.0.0
  - data_request: 1.7.0
  - dav: 1.16.2
  - deck: 1.2.7
  - event_update_notification: 1.2.0
  - external: 3.7.2
  - federatedfilesharing: 1.10.2
  - federation: 1.10.1
  - files: 1.15.0
  - files_automatedtagging: 1.10.1
  - files_markdown: 2.3.3
  - files_pdfviewer: 2.0.1
  - files_rightclick: 0.17.0
  - files_sharing: 1.12.2
  - files_texteditor: 2.14.0
  - files_trashbin: 1.10.1
  - files_versions: 1.13.0
  - firstrunwizard: 2.9.0
  - flow_notifications: 1.0.3
  - forms: 2.2.4
  - groupfolders: 8.2.1
  - integration_zammad: 1.0.0
  - logreader: 2.5.0
  - lookup_server_connector: 1.8.0
  - nextcloud_announcements: 1.9.0
  - notifications: 2.8.0
  - oauth2: 1.8.0
  - password_policy: 1.10.1
  - photos: 1.2.3
  - privacy: 1.4.0
  - provisioning_api: 1.10.0
  - ransomware_protection: 1.10.0
  - recommendations: 0.8.0
  - serverinfo: 1.10.0
  - settings: 1.2.0
  - sharebymail: 1.10.0
  - systemtags: 1.10.0
  - tasks: 0.13.6
  - text: 3.1.0
  - theming: 1.11.0
  - twofactor_backupcodes: 1.9.0
  - twofactor_totp: 5.0.0
  - twofactor_u2f: 6.1.0
  - updatenotification: 1.10.0
  - user_status: 1.0.1
  - viewer: 1.4.0
  - weather_status: 1.0.0
  - workflow_script: 1.5.1
  - workflowengine: 2.2.0

Nextcloud configuration:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Nextcloud 21.0.1

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.example.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "21.0.1.1",
        "overwrite.cli.url": "https:\/\/nextcloud.example.com",
        "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": [
            "bruteforcesettings"
        ],
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_smtpport": "587",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "AT",
        "maintenance": false,
        "theme": "",
        "loglevel": 2
    }
}

Nextcloud 20.0.9.1

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.example.org"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "20.0.9.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "log_type": "owncloud",
        "logfile": "\/usr\/local\/www\/nextcloud_data\/nextcloud.log",
        "loglevel": "3",
        "logdateformat": "c",
        "theme": "",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "mail_sendmailmode": "smtp",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "preview_max_scale_factor": 1,
        "app_install_overwrite": [
            "joplin"
        ]
    }
}

Another Nextcloud 20.0.9.1

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.example.net"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbtype": "pgsql",
        "version": "20.0.9.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "log_type": "owncloud",
        "logfile": "\/usr\/local\/www\/nextcloud_data\/nextcloud.log",
        "loglevel": "3",
        "logdateformat": "c",
        "theme": "",
        "updater.release.channel": "stable",
        "mail_sendmailmode": "smtp"
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
Local storage only.

Are you using encryption: yes/no
Nextcloud E2EE: No.
TLS: Yes

Server log (data/nextcloud.log)

nextcloud.log doesn't log any events.
flow.log is constantly at 0 bytes no matter if flows are triggered (for example the “Automated tagging” flow) or run_script doesn't trigger.

Additional remarks

I've made sure that the script to be executed is not located within a group folder because of #38.

Testing the flow trigger system with “Automated tagging” does work to auto-add a tag upon change of a file. So we're really certain that all of these nextcloud installations are generally ok and they've been working fine otherwise.

Edit

  1. Added info on nextcloud.log and flow.log.
  2. Added another PHP version
  3. Clarified trigger configurations for filename matches and filename is.

suggestion: fallback to exec() instead of shell_exec() in restricted environments.

Please consider usind exec() instead of shell_exec() since it does not work in my environment. A configuration option should suffice.

Steps to reproduce

  1. Activate workflow_script in an environment where shell_exec() is not allowed.
  2. Try to execute a script.
  3. Nothing happens. No obvious error is reported.

Expected behaviour

action should be executed.

Actual behaviour

Error is generated in the logs:

Error PHP shell_exec() has been disabled for security reasons at /web/htdocs/www.huugl.eu/home/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#96

Workflow Script app

**Workflow Script app version:1.2.0

Server configuration

Operating system: Linux
Web server: Apache
Database: MySQL
**PHP version:7.2.2
**Nextcloud Version:17.0.2

Where did you install Nextcloud from: official download

Signing status:

No errors have been found.

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

Are you using encryption: no

Server log (data/nextcloud.log)

```
Error PHP shell_exec() has been disabled for security reasons at /web/htdocs/www.huugl.eu/home/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#96   2020-01-19T22:38:16+0100
Error PHP shell_exec() has been disabled for security reasons at /web/htdocs/www.huugl.eu/home/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#95   2020-01-19T22:38:16+0100
Error PHP shell_exec() has been disabled for security reasons at /web/htdocs/www.huugl.eu/home/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#87   2020-01-19T22:38:16+0100
Error PHP shell_exec() has been disabled for security reasons at /web/htdocs/www.huugl.eu/home/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#79   2020-01-19T22:38:16+0100
</details>

Wrong parameter value for workflow script

Since upgrade of Nextcloud from 19.0.6 to 19.0.8, a previously working workflow script gets the wrong file name with the %n parameter. It gets the name of the temporary upload file (a path in /tmp) which obviously isn't available anymore when the script is run (in cron.php). If I understand https://github.com/nextcloud/workflow_script#placeholders correctly, the temp name is supposed to appear in the %f variable, not %n. The script worked for a long time, back in the day the plugin was named 'workflow external script'.

Steps to reproduce

  1. set up an external script that gets the %n parameter
  2. upload a file that satifies the condition of 1
  3. verify that %n is the store-relative path of the uploaded file
  4. update Nextcloud to 19.0.8
  5. upload a second file
  6. you'll see that %n now contains the temp file name.

Expected behaviour

The script should get the store-relative filename in %n, as documented.

Actual behaviour

The script gets the name of the temporary file in %n

Workflow Script app

  • workflow_script: 1.4.1
  • workflowengine: 2.1.0

Server configuration

Nextcloud 19.0.8

Operating system: Debian

Web server: Nginx 1.14.2

Database: MySQL 10.3.27

PHP version: php-fpm 7.4.14

Nextcloud Version: 19.0.8.1

Where did you install Nextcloud from: unknown

Signing status: empty

List of activated apps:

Enabled:

  • accessibility: 1.5.0
  • activity: 2.12.1
  • admin_audit: 1.9.0
  • bruteforcesettings: 2.0.1
  • calendar: 2.0.4
  • checksum: 0.4.5
  • cloud_federation_api: 1.2.0
  • comments: 1.9.0
  • contactsinteraction: 1.0.0
  • dav: 1.15.0
  • deck: 1.2.4
  • federatedfilesharing: 1.9.0
  • federation: 1.9.0
  • files: 1.14.0
  • files_external: 1.10.0
  • files_pdfviewer: 1.8.0
  • files_rightclick: 0.16.0
  • files_sharing: 1.11.0
  • files_trashbin: 1.9.0
  • files_versions: 1.12.0
  • files_videoplayer: 1.8.0
  • firstrunwizard: 2.8.0
  • logreader: 2.4.0
  • lookup_server_connector: 1.7.0
  • nextcloud_announcements: 1.8.0
  • notes: 3.6.4
  • notifications: 2.7.0
  • oauth2: 1.7.0
  • password_policy: 1.9.1
  • photos: 1.1.0
  • privacy: 1.3.0
  • provisioning_api: 1.9.0
  • recommendations: 0.7.0
  • serverinfo: 1.9.0
  • settings: 1.1.0
  • sharebymail: 1.9.0
  • sharelisting: 0.3.0
  • support: 1.2.1
  • survey_client: 1.7.0
  • systemtags: 1.9.0
  • tasks: 0.13.6
  • text: 3.0.1
  • theming: 1.10.0
  • theming_customcss: 1.6.0
  • twofactor_backupcodes: 1.8.0
  • updatenotification: 1.9.0
  • user_ldap: 1.9.1
  • viewer: 1.3.0
  • workflow_script: 1.4.1
  • workflowengine: 2.1.0
    Disabled:
  • encryption

Nextcloud configuration:

{
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"REMOVED SENSITIVE VALUE"
"127.0.0.1"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "19.0.8.1",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"ldapIgnoreNamingRules": false,
"proxy": "REMOVED SENSITIVE VALUE",
"log_type": "syslog",
"logfile": "",
"loglevel": "2",
"log_authfailip": true,
"logtimezone": "Europe/Berlin",
"enable_previews": true,
"forcessl": true,
"singleuser": false,
"maintenance": false,
"appstoreenabled": true,
"has_internet_connection": true,
"supportedDatabases": [
"mysql",
"pgsql",
"oci"
],
"secret": "REMOVED SENSITIVE VALUE",
"share_folder": "/Shared",
"updatechecker": false,
"theme": "",
"memcache.local": "\OC\Memcache\APCu",
"overwrite.cli.url": "REMOVED SENSITIVE VALUE",
"mail_smtpmode": "smtp",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "25",
"ldapProviderFactory": "\OCA\User_LDAP\LDAPProviderFactory",
"updater.release.channel": "stable",
"default_language": "de_DE",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_smtpauthtype": "LOGIN",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mysql.utf8mb4": true,
"app_install_overwrite": [
"workflow_script",
"calendar",
"spgverein"
]
}
Are you using external storage, if yes which one: CIFS, SFTP

Are you using encryption: no

Server log (data/nextcloud.log)

Nothing.

File access trigger not working

Steps to reproduce

  1. Create a workflow with trigger "file access"
  2. Filter: "filename like /.*/"
  3. Script: "echo '%e %i %a' >> /path/to/a/file"
  4. Open a file in web or webdav or sync with desktop client
  5. 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

Limit number of running scripts

Is there any option how limit number of running scripts? For example flow do converting a video and this can be huge load for server.

can a script be used to rename files on upload?

Steps to reproduce

I've tried to find documentation on this question, but couldn't find anything. So I want to ask here: Is it possible to use a simple script to rewrite (some) file locations as they get uploaded?

I'm using a google pixel phone with auto-uploading enabled. The camera puts portrait pictures into a subfolder, which makes it quite hard to browse through these pictures in any tool other than the google pictures app. The nextcloud gallery also suffers a lot from this. See e.g.: https://support.google.com/pixelphone/thread/12756704?hl=en

So I'm left with workarounds for this android limitation. Currently, I'm running a manual script to rename these files every now and then and then rescan the whole data folder. I'm hoping that a workflow script could improve this situation somehow?

Expected behaviour

Documentation on whether one can move an input file, or whether this will require a rescan then afterwards?

Actual behaviour

I don't want to experiment with this without any documentation. So I don't know if it actually works or not?

Workflow Script app

1.3.1

Server configuration

Operating system: nextcloudpi

Web server: Apache

Database: MySQL

PHP version: 7.3.14

Nextcloud Version: 18.0.4

Where did you install Nextcloud from: nextcloudpi

Automatically Convert video on files in folder

How could I use this workflow to run the NC Convert Video app on any file that is uploaded to a folder drop? If running the Convert Video app is not possible, is there an equivalent script that uses ffmpeg?

Where to get flows?

The only available flow I see is "Write to Conversation". The video shows several others and a button to add more (which I don't have). How do I find and add additional flows?

Documentation wrong (no-parameter use case)

Version 1.1.0 has wrong behaviour documentation. It states:

If you do not use any of the following placeholders, the file path will be added to the provided command.

How ever this is not true! No parameter is appended!

Where to put the script ?

Pass files to external scripts for processing outside of Nextcloud

What I understand is that I drop an executable script in a sub-folder of nextcloud.
./path/to/myscript.sh

and in the field I fill in the path like this:
path/to/myscript %n

Well, it's not working, and the documentation doesn't help me. How can I do ?

NB: my nextcloud is in a docker container.

Placeholders %n and %f both return local path

Steps to reproduce

  1. Setup a flow script to triggger passing in %n and %f placeholders.

Expected behaviour

Only the %f placeholder should return tmp/... path.

Actual behaviour

Both the %n and %f placeholders return the same tmp/... path value.
Prior to upgrading to v20, these placeholders returned the correct relative and local paths respectively.

Workflow Script app

Workflow Script app version: 1.5.1

Server configuration

Operating system: Debian GNU/Linux 10 (buster)

Web server: Apache

Database: AWS Aurora

PHP version: 7.4.13

Nextcloud Version: (see admin page) 20.0.4

Where did you install Nextcloud from: Docker

getPath() on null - undefined variable in Operation.php

Steps to reproduce

  1. rename or move a file
  2. error message is displayed

Expected behaviour

renaming/moving the file without an error message

Actual behaviour

Message popup (top right corner) is displayed saying " Cannot move " or "Cannot rename ".
Error messages in the logging app:

[remote] Error: Error: Call to a member function getPath() on null at <>

  1. /var/www/nextcloud/apps/workflowengine/lib/AppInfo/Application.php line 114
    OCA\WorkflowScript\Operation->onEvent("*** sensitive parameter replaced ", " sensitive parameter replaced ***", OCA\WorkflowEngine\Service\RuleMatcher {})
  2. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 247
    OCA\WorkflowEngine\AppInfo\Application->OCA\WorkflowEngine\AppInfo{closure}("*** sensitive parameters replaced ***")
  3. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners([Closure {}], "*** sensitive parameter replaced ", " sensitive parameter replaced ***")
  4. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 80
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch("*** sensitive parameter replaced ", " sensitive parameter replaced ***")
  5. /var/www/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php line 63
    OC\EventDispatcher\EventDispatcher->dispatch("*** sensitive parameter replaced ", " sensitive parameter replaced ***")
  6. /var/www/nextcloud/lib/private/Files/Node/HookConnector.php line 147
    OC\EventDispatcher\SymfonyAdapter->dispatch("*** sensitive parameter replaced ", " sensitive parameter replaced ***")
  7. /var/www/nextcloud/lib/private/legacy/hook.php line 111
    OC\Files\Node\HookConnector->postRename({oldpath: "/Doku ... "})
  8. /var/www/nextcloud/lib/private/Files/View.php line 849
    OC_Hook::emit("OC_Filesystem", "post_rename", {oldpath: "/Doku ... "})
  9. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php line 440
    OC\Files\View->rename("/Dokumente/test2.md", "/Dokumente/Dokumente/test2.md")
  10. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 158
    OCA\DAV\Connector\Sabre\Directory->moveInto("test2.md", "files/martin/Dokumente/test2.md", OCA\DAV\Connector\Sabre\File {})
  11. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 642
    Sabre\DAV\Tree->move("files/martin/Dokumente/test2.md", "files/martin/Do ... d")
  12. <>
    Sabre\DAV\CorePlugin->httpMove(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
  13. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpMove"], [Sabre\HTTP\Requ ... }])
  14. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:MOVE", [Sabre\HTTP\Requ ... }])
  15. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
  16. /var/www/nextcloud/apps/dav/lib/Server.php line 319
    Sabre\DAV\Server->exec()
  17. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
  18. /var/www/nextcloud/remote.php line 165
    require_once("/var/www/nextcl ... p")

[PHP] Error: Undefined variable: node at /var/www/nextcloud/apps/workflow_script/lib/Operation.php#203

MOVE /remote.php/dav/files//Dokumente/Neues%20Textdokument2.md
from 10.0.0.33 by at 2020-03-04T07:21:01+00:00

Workflow Script app

1.3.1

Server configuration

Operating system: Ubuntu/RedHat/...
Linux 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l

Web server: Apache/Nginx
Apache (fpm-fcgi)

Database: MySQL/Maria/SQLite/PostgreSQL
mysql 10.3.15

PHP version:
7.3.4-2
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, sodium, standard, cgi-fcgi, mysqlnd, PDO, xml, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, json, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud Version: (see admin page)
18.0.1 - 18.0.1.3

Where did you install Nextcloud from:
nextcloudpi

Signing status:
Array
(
[user_external] => Array
(
[INVALID_HASH] => Array
(
[appinfo/info.xml] => Array
(
[expected] => 06b250c3a2c2ae01c8a2c4b963d6449c99645dca36ee197c3aa513fb7ac3e90e42dc1408ee6957408d85f9f9a973b8983719e9c15125d42211d43f0853c7bf75
[current] => e5da848ca44b3b60abb1c99a3d26455d78464f94ea1f5f522b07d642096a771dcde9a1a5289e271805292659edc42925a86b5d6ad22ffa98b79ecec5bfed69ff
)

                [lib/smb.php] => Array
                    (
                        [expected] => 283a99667fd865e54423d575953423bc6e15862b7683885cb5675aafdb3b2cbc1400a1318ec81cdbd90ce827c3f839aa6daf6a0f6e3ac6bd2742947498dd14f9
                        [current] => 1c12005d92f88017564fb4135a532810aab33ffab22eac67c19501a59d213518e417cceb83f5e9ea4b448ea81fff3149da37eefb0100a61bce3140ce67f8decc
                    )

            )

    )

)

List of activated apps:

  • accessibility: 1.4.0
  • activity: 2.11.0
  • admin_audit: 1.8.0
  • apporder: 0.9.0
  • calendar: 2.0.2
  • cloud_federation_api: 1.1.0
  • cms_pico: 1.0.5
  • comments: 1.8.0
  • contacts: 3.2.0
  • dav: 1.14.0
  • deck: 0.8.0
  • external: 3.5.0
  • federatedfilesharing: 1.8.0
  • federation: 1.8.0
  • files: 1.13.1
  • files_external: 1.9.0
  • files_external_gdrive: 0.4.0
  • files_external_onedrive: 1.0.7
  • files_fulltextsearch: 1.4.1
  • files_markdown: 2.2.0
  • files_mindmap: 0.0.17
  • files_pdfviewer: 1.7.0
  • files_rightclick: 0.15.2
  • files_sharing: 1.10.1
  • files_trackdownloads: 1.7.0
  • files_trashbin: 1.8.0
  • files_versions: 1.11.0
  • files_videoplayer: 1.7.0
  • firstrunwizard: 2.7.0
  • fulltextsearch: 1.4.1
  • fulltextsearch_elasticsearch: 1.5.0
  • issuetemplate: 0.6.0
  • keeweb: 0.6.2
  • logreader: 2.3.0
  • lookup_server_connector: 1.6.0
  • maps: 0.1.5
  • metadata: 0.11.1
  • music: 0.13.0
  • news: 14.1.3
  • nextcloud_announcements: 1.7.0
  • nextcloudpi: 0.0.1
  • notes: 3.1.5
  • notifications: 2.6.0
  • oauth2: 1.6.0
  • occweb: 0.0.7
  • password_policy: 1.8.0
  • photos: 1.0.0
  • previewgenerator: 2.2.0
  • privacy: 1.2.0
  • provisioning_api: 1.8.0
  • recommendations: 0.6.0
  • serverinfo: 1.8.0
  • settings: 1.0.0
  • sharebymail: 1.8.0
  • socialsharing_diaspora: 2.0.0
  • spreed: 8.0.5
  • support: 1.1.0
  • survey_client: 1.6.0
  • systemtags: 1.8.0
  • talk_simple_poll: 1.1.0
  • tasks: 0.11.3
  • text: 2.0.0
  • theming: 1.9.0
  • twofactor_backupcodes: 1.7.0
  • unsplash: 1.1.5
  • updatenotification: 1.8.0
  • user_external: 0.8.0
  • user_ldap: 1.8.0
  • viewer: 1.2.0
  • workflow_script: 1.3.1
  • workflowengine: 2.0.0
    Disabled:
  • encryption
  • gallery
  • ocr
  • previewgenerator.orig
  • social

Nextcloud configuration:

{
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": {
"0": "localhost",
"5": "nextcloudpi.local",
"7": "nextcloudpi",
"8": "nextcloudpi.lan",
"1": "10.0.0.15",
"2": "10.0.0.16"
...
},
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "18.0.1.3",
"overwrite.cli.url": "https://mgwb-nc.crabdance.com/",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"instanceid": "REMOVED SENSITIVE VALUE",
"memcache.local": "\OC\Memcache\Redis",
"memcache.locking": "\OC\Memcache\Redis",
"redis": {
"host": "REMOVED SENSITIVE VALUE",
"port": 0,
"timeout": 0,
"password": "REMOVED SENSITIVE VALUE"
},
"tempdirectory": "/media/USBdrive/ncdata/tmp",
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_domain": "REMOVED SENSITIVE VALUE",
"preview_max_x": "2048",
"preview_max_y": "2048",
"jpeg_quality": "60",
"overwriteprotocol": "https",
"maintenance": false,
"logfile": "/media/USBdrive/ncdata/nextcloud.log",
"loglevel": "2",
"log_type": "file",
"theme": "",
"mail_sendmailmode": "smtp",
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "OCA\User_LDAP\LDAPProviderFactory",
"mail_smtpauth": 1,
"mail_smtpsecure": "ssl",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "465",
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"app_install_overwrite": [
"files_external_gdrive",
"files_external_onedrive",
"occweb"
]
}

Are you using external storage, if yes which one: local/smb/sftp/...
local

Are you using encryption:
no

Server log (data/nextcloud.log)

{"reqId":"Xl9W3VbEE-rJGT6vQLe3LgAACRY","level":3,"time":"2020-03-04T07:21:01+00:00","remoteAddr":"10.0.0.33","user":"","app":"remote","method":"MOVE","url":"/remote.php/dav/files//Dokumente/Neues%20Textdokument2.md","message":{"Exception":"Error","Message":"Call to a member function getPath() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/workflowengine/lib/AppInfo/Application.php","line":114,"function":"onEvent","class":"OCA\WorkflowScript\Operation","type":"->","args":["*** sensitive parameter replaced "," sensitive parameter replaced ",{"class":"OCA\WorkflowEngine\Service\RuleMatcher"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":247,"function":"OCA\WorkflowEngine\AppInfo\{closure}","class":"OCA\WorkflowEngine\AppInfo\Application","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->","args":[[{"class":"Closure"}]," sensitive parameter replaced "," sensitive parameter replaced "]},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":80,"function":"dispatch","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->","args":[" sensitive parameter replaced "," sensitive parameter replaced "]},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php","line":63,"function":"dispatch","class":"OC\EventDispatcher\EventDispatcher","type":"->","args":[" sensitive parameter replaced "," sensitive parameter replaced "]},{"file":"/var/www/nextcloud/lib/private/Files/Node/HookConnector.php","line":147,"function":"dispatch","class":"OC\EventDispatcher\SymfonyAdapter","type":"->","args":[" sensitive parameter replaced "," sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/lib/private/legacy/hook.php","line":111,"function":"postRename","class":"OC\Files\Node\HookConnector","type":"->","args":[{"oldpath":"/Dokumente/Neues Textdokument2.md","newpath":"/Dokumente/Neues Textdokument.md"}]},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":849,"function":"emit","class":"OC_Hook","type":"::","args":["OC_Filesystem","post_rename",{"oldpath":"/Dokumente/Neues Textdokument2.md","newpath":"/Dokumente/Neues Textdokument.md"}]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php","line":143,"function":"rename","class":"OC\Files\View","type":"->","args":["/Dokumente/Neues Textdokument2.md","/Dokumente/Neues Textdokument.md"]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":151,"function":"setName","class":"OCA\DAV\Connector\Sabre\Node","type":"->","args":["Neues Textdokument.md"]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":642,"function":"move","class":"Sabre\DAV\Tree","type":"->","args":["files//Dokumente/Neues Textdokument2.md","files//Dokumente/Neues Textdokument.md"]},{"function":"httpMove","class":"Sabre\DAV\CorePlugin","type":"->","args":[{"absoluteUrl":"https:///remote.php/dav/files//Dokumente/Neues%20Textdokument2.md","class":"Sabre\HTTP\Request"},{"class":"Sabre\HTTP\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"class":"Sabre\DAV\CorePlugin"},"httpMove"],[{"absoluteUrl":"https:///remote.php/dav/files//Dokumente/Neues%20Textdokument2.md","class":"Sabre\HTTP\Request"},{"class":"Sabre\HTTP\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\Event\EventEmitter","type":"->","args":["method:MOVE",[{"absoluteUrl":"https:///remote.php/dav/files//Dokumente/Neues%20Textdokument2.md","class":"Sabre\HTTP\Request"},{"class":"Sabre\HTTP\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\DAV\Server","type":"->","args":[{"absoluteUrl":"https:///remote.php/dav/files//Dokumente/Neues%20Textdokument2.md","class":"Sabre\HTTP\Request"},{"class":"Sabre\HTTP\Response"}]},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":319,"function":"exec","class":"Sabre\DAV\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\DAV\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/remote.php","line":165,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/workflow_script/lib/Operation.php","Line":203,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0","version":"18.0.1.3"}

[Feature Request] Support for Projects

As of Nextcloud 16 it is now possible to add Files, Deck cards and start Talk conversations around Projects. Automating this process with the Workflow app would be really useful! See also this more general issue related to Project Management.

Example:

Thanks for all your good work and consideration!

Workflow not being run

Steps to reproduce

  1. Install a fresh nextcloud instance (i.e. Docker 15.0.0-apache) and the workflow_script app
  2. Setup a workflow rule group without any rules (and therefore matching all files being uploaded or updated or renamed) and set a command (i.e. 'echo "%e %i %a %o %n %f %x" >> /tmp/1.log')
  3. Upload a file

Expected behaviour

I would expect that the workflow is run and that a file /tmp/1.log is created.

Actual behaviour

Nothing happens.
I tried to debug it a bit and for me it looks like the hooks (i.e. postCreate) are not being called.

Workflow Script app

Workflow Script app version: 1.0.0

Server configuration

Operating system: Ubuntu

Web server: Apache

Database: MySQL

PHP version: 7.2.13

Nextcloud Version: 15.0.0

Where did you install Nextcloud from: Docker 15.0.0-apache

Signing status:

No errors have been found.

List of activated apps:

``` Enabled: - accessibility: 1.1.0 - activity: 2.8.2 - cloud_federation_api: 0.1.0 - comments: 1.5.0 - dav: 1.8.0 - federatedfilesharing: 1.5.0 - federation: 1.5.0 - files: 1.10.0 - files_pdfviewer: 1.4.0 - files_sharing: 1.7.0 - files_texteditor: 2.7.0 - files_trashbin: 1.5.0 - files_versions: 1.8.0 - files_videoplayer: 1.4.0 - firstrunwizard: 2.4.0 - gallery: 18.2.0 - logreader: 2.0.0 - lookup_server_connector: 1.3.0 - nextcloud_announcements: 1.4.0 - notifications: 2.3.0 - oauth2: 1.3.0 - password_policy: 1.5.0 - provisioning_api: 1.5.0 - serverinfo: 1.5.0 - sharebymail: 1.5.0 - support: 1.0.0 - survey_client: 1.3.0 - systemtags: 1.5.0 - theming: 1.6.0 - twofactor_backupcodes: 1.4.1 - updatenotification: 1.5.0 - workflow_script: 1.0.0 - workflowengine: 1.5.0 Disabled: - admin_audit - encryption - files_external - user_external - user_ldap ```

Nextcloud configuration:

``` { "system": { "htaccess.RewriteBase": "\/", "memcache.local": "\\OC\\Memcache\\APCu", "apps_paths": [ { "path": "\/var\/www\/html\/apps", "url": "\/apps", "writable": false }, { "path": "\/var\/www\/html\/custom_apps", "url": "\/custom_apps", "writable": true } ], "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "15.0.0.10", "overwrite.cli.url": "https:\/\/cloudstage.w4it.at", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "filelocking.enabled": true, "memcache.distributed": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": "***REMOVED SENSITIVE VALUE***", "timeout": "***REMOVED SENSITIVE VALUE***", "dbindex": "***REMOVED SENSITIVE VALUE***" }, "mail_smtpmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "***REMOVED SENSITIVE VALUE***", "ldapIgnoreNamingRules": false, "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory", "loglevel": 2, "maintenance": false, "theme": "", } } ```

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

Are you using encryption: no

Server log (data/nextcloud.log)

``` EMPTY ```

add possibility to define an activity text for each workflow which will be written to the activity stream

Enhancement request

For compliance reasons, it would be nice to be able to define an activity text for each workflow which then will be written to the activity stream of a user. Alternatively a text returned by the external script could be written to the activity stream. This would allow to get notice of the processing done by a workflow script. It should be possible to use the available place holders in that text string.

Example: Imagine you've created an external script which converts an uploaded 3gp-video to a mp4-video. As soon as you uploaded a file a message like "You have created xvz-video.3gp" is being logged. Next an external script is executed which converts the file to a mp4-video (xyz-video.mp4) and the original file is being deleted.

As a result you will see a file named "xyz-video.mp4" on your server but not the file "xyz-video.3gp" anymore. Currently the activity stream doesn't contain any entry about the external script execution nor the file renaming and how/why it has happened.

Enhancements

Thanks for this plugin!

Would you consider:

  1. Command execution for created folders,
  2. Filtering by operation,
  3. Better path variable support for Local External Storages?

File `%f` not found by script

Steps to reproduce

  1. Set up a script that reads the file specified such as the following
#!/usr/bin/env python3
from PIL import Image
import sys, os

print("Opening image",sys.argv[1])
f = open(sys.argv[1]).read()
  1. Add rule along the lines of /path/to/script.py %f >> /tmp/test_output
  2. Trigger rule

Expected behaviour

The script should execute without error and a line should be logged to /tmp/test_output

Actual behaviour

The following error is thrown

  File "/path/to/script", line 20, in <module>
    f = open(sys.argv[1]).read()
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/oc_tmp_0f9O8Q-.png'

Vexingly this works if the path to my script is replaced by head -c 10 for example.

Server configuration detail

Operating system: Linux 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64

Webserver: Apache/2.4.29 (Ubuntu) (apache2handler)

Database: mysql 5.7.27

PHP version:

7.2.19-0ubuntu0.18.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, apache2handler, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, intl, json, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 16.0.3 - 16.0.3.0

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array
(
[files_rightclick] => Array
(
[EXTRA_FILE] => Array
(
[README.md] => Array
(
[expected] =>
[current] => cf73849388838de5037624e53303618579b164ec69fd55834ce4c5332ae33f778839e36298cbcc8ede90620927e076dbb8883479754e4c09b0491b15bf7653f3
)

            )

    )

)

List of activated apps
Enabled:
 - accessibility: 1.2.0
 - admin_audit: 1.6.0
 - bookmarks: 1.0.8
 - bruteforcesettings: 1.4.0
 - calendar: 1.7.0
 - cloud_federation_api: 0.2.0
 - comments: 1.6.0
 - contacts: 3.1.3
 - dav: 1.9.2
 - encryption: 2.4.0
 - federatedfilesharing: 1.6.0
 - federation: 1.6.0
 - files: 1.11.0
 - files_pdfviewer: 1.5.0
 - files_rightclick: 0.13.0
 - files_sharing: 1.8.0
 - files_versions: 1.9.0
 - files_videoplayer: 1.5.0
 - firstrunwizard: 2.5.0
 - gallery: 18.3.0
 - issuetemplate: 0.5.0
 - logreader: 2.1.0
 - lookup_server_connector: 1.4.0
 - metadata: 0.9.0
 - nextcloud_announcements: 1.5.0
 - notifications: 2.4.1
 - oauth2: 1.4.2
 - passman: 2.3.2
 - password_policy: 1.6.0
 - privacy: 1.0.0
 - provisioning_api: 1.6.0
 - recommendations: 0.4.0
 - serverinfo: 1.6.0
 - sharebymail: 1.6.0
 - support: 1.0.0
 - survey_client: 1.4.0
 - systemtags: 1.6.0
 - theming: 1.7.0
 - twofactor_backupcodes: 1.5.0
 - updatenotification: 1.6.0
 - user_usage_report: 1.1.2
 - viewer: 1.0.0
 - workflow_script: 1.1.0
 - workflowengine: 1.6.0
Disabled:
 - activity
 - files_external
 - files_texteditor
 - files_trashbin
 - previewgenerator
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        ***REMOVED SENSITIVE VALUE***
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "16.0.3.0",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "UTC",
    "installed": true,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpdebug": true,
    "loglevel": 0,
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtpsecure": "tls",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "theme": "",
    "memcache.local": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379
    },
    "mail_sendmailmode": "smtp",
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "htaccess.RewriteBase": "\/",
    "updater.secret": "***REMOVED SENSITIVE VALUE***",
    "app_install_overwrite": [
        "calendar"
    ]
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0

Operating system: Ubuntu 18.04

Workflow only runs without rules

Steps to reproduce

  1. Create an external script that does "logger %e %n" without any rules -> it logs
  2. Add a rule, any rule. It stops working

Expected behaviour

It should process the rules and when it has a positive, it should fire.

Actual behaviour

I tried the following:
filename match /^img-[0-9]{8}-wa[0-9]{4}.jpe?g$/i (this one works flawlessly with automatic tagging)
file system tag is tagged with whatsapp (the tagging itself, based on above rule, works).

Workflow Script app

Workflow Script app version: (see apps admin page: /index.php/settings/apps)
1.2.0

nextcloud 17.0.2, nginx, php7.3-fpm, redis on raspbian 10 on rpi4.

Request: Run certain commands only once for multiple files

Currently a task is added to the scheduler for every individual file.
This can be inefficient.

Example:

  1. The camera uploads a larger group of photos within a short time.
  2. Each photo creates a task
  3. All tasks get run one after the other on the next cron run.

Most scripts need to have the occ files:scan after their work, how ever that can be slow.

Idea:

Add a way that a script only gets run after all other tasks in one cron intrerval got run.

Cant run python scripts

I want to run a python script called from a bash script, which is called from workflow script.
I verify in my for this purpose created logfiles, that the bash scripts gets triggered, but stops when the python script should start.
When I start the script by manually, the scripts and subscripts run as expected.

Also, I could not enable the direct call of a Python script through workflow.

Is it possible to call python scripts at all?

Steps to reproduce

  1. create python script which is executable from www-data
  2. create bash script which is executable from www-data and call python script in it.
  3. check functionality by starting manually

Expected behaviour

execute python script called from bash script

Actual behaviour

bash script runs up to the point, where the python script starts and then stops.

Workflow Script app

Workflow Script app version: (see apps admin page: /index.php/settings/apps)
1.5.1

Server configuration

Operating system:
manjaro

Web server:
Nginx

Database:
Maria

PHP version:
7.4.14

Nextcloud Version: (see admin page)
20.0.5

Where did you install Nextcloud from:
pacman

Signing status:

No errors have been found.

List of activated apps:

``` Enabled: - accessibility: 1.6.0 - activity: 2.13.4 - admin_audit: 1.10.0 - analytics: 3.2.0 - breezedark: 20.0.3 - bruteforcesettings: 2.0.1 - calendar: 2.1.3 - cloud_federation_api: 1.3.0 - contacts: 3.4.3 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.2 - deck: 1.2.3 - documentserver_community: 0.1.8 - federatedfilesharing: 1.10.2 - federation: 1.10.1 - files: 1.15.0 - files_fulltextsearch: 20.0.0 - files_fulltextsearch_tesseract: 20.0.1 - files_markdown: 2.3.1 - files_pdfviewer: 2.0.1 - files_rightclick: 0.17.0 - files_sharing: 1.12.2 - files_trashbin: 1.10.1 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - flow_notifications: 1.0.3 - fulltextsearch: 20.0.0 - fulltextsearch_elasticsearch: 20.0.0 - groupfolders: 8.2.0 - impersonate: 1.7.0 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - nextcloud_announcements: 1.9.0 - notes: 4.0.2 - notifications: 2.8.0 - oauth2: 1.8.0 - onlyoffice: 6.2.0 - password_policy: 1.10.1 - photos: 1.2.3 - privacy: 1.4.0 - provisioning_api: 1.10.0 - ransomware_protection: 1.8.0 - serverinfo: 1.10.0 - settings: 1.2.0 - sharebymail: 1.10.0 - spreed: 10.0.5 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - tasks: 0.13.6 - text: 3.1.0 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - updatenotification: 1.10.0 - viewer: 1.4.0 - weather_status: 1.0.0 - workflow_script: 1.5.1 - workflowengine: 2.2.0 Disabled: - camerarawpreviews - circles - comments - encryption - end_to_end_encryption - files_external - integration_github - integration_gitlab - integration_moodle - mail - printer - recommendations - socialsharing_email - talk_simple_poll - user_ldap - user_status - workflow_ocr
</details>

**Nextcloud configuration:**

<details>

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

</details>

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

**Are you using encryption:**
no

### Server log (data/nextcloud.log)
<details>

Insert your server log here

</details>

Clarification needed: How to change file in nextcloud

Could you clarify: Which path to use for modifying the file?
Is the file copied back after using %t? Or do I have to use the relative file path for nextcloud?

I am currently trying to auto-normalize all uploaded audio-files.

Resize uploaded image on specific directory and security aspects

Hi Devs,
I would like to auto-resize every images uploaded into specific NC directory "Test".
I've been seen more than one way on NC forum, and often some of these examples don't seem to consider the security aspect of this operation.

If possible, please could you show a secure and working example related to this case?

Many thanks!

Davide

File deleted script is not triggered

Steps to reproduce

  1. Create external scripts
  2. Select "file deleted"
  3. Filtered with request time from 00:00 to 23:59

The script is a bash script that run a curl command to request a resource from a server.
When I select "File Create" the script is triggered. When I select "File deleted" the script is not triggered.

Expected behaviour

A script should be run

Actual behaviour

The script is not triggered

Workflow Script app

Workflow Script app version: 1.5.1

Server configuration

Web server: Apache

Database: MySQL

PHP version: 7.4.15

Nextcloud Version: 20.0.6/20.0/19.0

Where did you install Nextcloud from: nextcloud docker

Signing status:

No errors have been found.

List of activated apps:

Nextcloud configuration:

'/', 'memcache.local' => '\\OC\\Memcache\\APCu', 'apps_paths' => array ( 0 => array ( 'path' => '/var/www/html/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/var/www/html/custom_apps', 'url' => '/custom_apps', 'writable' => true, ), ), 'overwritehost' => 'localhost:80', 'overwriteprotocol' => 'http', 'overwritewebroot' => '/nextcloud', 'instanceid' => 'ocjc1r7ao4qq', 'passwordsalt' => 'ErP0lgBD/7c6lmJ+sBXxs4TCGyh2Oq', 'secret' => '***', 'trusted_domains' => array ( 0 => '***', ), 'datadirectory' => '/var/www/html/data', 'dbtype' => 'mysql', 'version' => '20.0.6.1', 'overwrite.cli.url' => 'http://***/***', 'dbname' => '***', 'dbhost' => '***', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => '***', 'dbpassword' => '***', 'installed' => true, ); **Are you using encryption:** no ### Server log (data/nextcloud.log) {"reqId":"GAqB0n37yt1RrcUsry2O","level":3,"time":"2021-02-06T11:46:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"RwC08sKfEMV4st7kEIRi","level":3,"time":"2021-02-06T11:47:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"VsD3qulhOcWTV2LKcWQD","level":3,"time":"2021-02-06T11:48:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"wpJ1dBT4XWhwV29DikZ3","level":3,"time":"2021-02-06T11:49:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"i4yWJSbJfEZ19rCGkxdb","level":2,"time":"2021-02-06T11:49:09+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"i4yWJSbJfEZ19rCGkxdb","level":2,"time":"2021-02-06T11:49:09+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"orOFiY1zzaAmfPgr69aQ","level":3,"time":"2021-02-06T11:50:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"q7sUZb01dVa9sZosoCA0","level":3,"time":"2021-02-06T11:51:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"9AhKGDCGyIkqPyMlz6PW","level":3,"time":"2021-02-06T11:52:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"EnJ0CvgNWjaAAPJFV1Xx","level":3,"time":"2021-02-06T11:53:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"RjoDE8vr7H61XuP188Lb","level":3,"time":"2021-02-06T11:54:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""} {"reqId":"Y7RyMHNfLpRx3255Zs5g","level":2,"time":"2021-02-06T11:54:08+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"Y7RyMHNfLpRx3255Zs5g","level":2,"time":"2021-02-06T11:54:08+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"ycPQHLUjyXbiyXY4bJ54","level":2,"time":"2021-02-06T11:54:09+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"ycPQHLUjyXbiyXY4bJ54","level":2,"time":"2021-02-06T11:54:09+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"MLvdCPWXat0f6xl4NHZD","level":2,"time":"2021-02-06T11:54:09+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"MLvdCPWXat0f6xl4NHZD","level":2,"time":"2021-02-06T11:54:09+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"Aw1MmjPk52kgW595NQWC","level":2,"time":"2021-02-06T11:54:15+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"Aw1MmjPk52kgW595NQWC","level":2,"time":"2021-02-06T11:54:15+00:00","remoteAddr":"172.25.0.4","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Host localhost was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","version":""} {"reqId":"0ijaI4lRkTo4K90V3GVE","level":3,"time":"2021-02-06T11:55:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":42,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":"20.0.6.1"}

File created trigger is not fired when the file is created locally on the server

Hello,

I have a MFP that is configured to scan and push pdf files to a SMB folder within the data files of an user on the Nextcloud server
The file permission and ownership (www-data) are taken care of. It seems that the "File created" event is not triggered.

Steps to reproduce

  1. Create a flow that performs some action on file named test.txt with the trigger "File created"
  2. A test.txt file is created within the web UI or a synchronized folder
  3. Force cron execution
    sudo -u www-data php -f /var/www/nextcloud/cron.php
  4. Verify that the flow performs adequately
  5. Create a file directly on the server with e.g.:
    echo "Hello, world!" | sudo -u www-data tee /var/www/nextcloud/data/userxyz/files/scan/test.txt
  6. Force cron execution
    sudo -u www-data php -f /var/www/nextcloud/cron.php

Expected behaviour

The flow is triggered and performs per expectations.

Actual behaviour

The flow is not triggered

Workflow Script app

Workflow Script app version: (see apps admin page: /index.php/settings/apps)
Operating system: Linux 5.7.0-0.bpo.2-amd64 #1 SMP Debian 5.7.10-1~bpo10+1 (2020-07-30) x86_64

Webserver: Apache (apache2handler)

Database: mysql 10.3.23

PHP version:

7.3.19-1~deb10u1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, sodium, standard, apache2handler, mysqlnd, PDO, xml, apcu, bcmath, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, json, exif, memcache, msgpack, mysqli, pdo_mysql, apc, posix, readline, recode, redis, shmop, SimpleXML, smbclient, snmp, sockets, ssh2, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, Phar, memcached, libsmbclient, Zend OPcache

Nextcloud version: 19.0.4 - 19.0.4.2

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.5.0
 - activity: 2.12.1
 - admin_audit: 1.9.0
 - audioplayer: 2.12.0
 - bookmarks: 3.4.3
 - bruteforcesettings: 2.0.1
 - calendar: 2.0.4
 - cloud_federation_api: 1.2.0
 - comments: 1.9.0
 - contacts: 3.4.0
 - contactsinteraction: 1.0.0
 - dav: 1.15.0
 - deck: 1.1.2
 - dropit: 0.4.0
 - federatedfilesharing: 1.9.0
 - federation: 1.9.0
 - files: 1.14.0
 - files_antivirus: 3.0.0
 - files_external: 1.10.0
 - files_frommail: 0.4.0
 - files_pdfviewer: 1.8.0
 - files_rightclick: 0.16.0
 - files_sharing: 1.11.0
 - files_trashbin: 1.9.0
 - files_versions: 1.12.0
 - files_videoplayer: 1.8.0
 - firstrunwizard: 2.8.0
 - groupfolders: 7.1.0
 - issuetemplate: 0.7.0
 - keeweb: 0.6.3
 - logreader: 2.4.0
 - lookup_server_connector: 1.7.0
 - mail: 1.4.1
 - maps: 0.1.6
 - metadata: 0.12.0
 - nextcloud_announcements: 1.8.0
 - notes: 3.6.4
 - notifications: 2.7.0
 - oauth2: 1.7.0
 - onlyoffice: 6.0.2
 - password_policy: 1.9.1
 - photos: 1.1.0
 - privacy: 1.3.0
 - provisioning_api: 1.9.0
 - ransomware_detection: 0.8.0
 - recommendations: 0.7.0
 - serverinfo: 1.9.0
 - settings: 1.1.0
 - sharebymail: 1.9.0
 - socialsharing_email: 2.1.0
 - spreed: 9.0.4
 - support: 1.2.1
 - survey_client: 1.7.0
 - systemtags: 1.9.0
 - tasks: 0.13.4
 - text: 3.0.1
 - theming: 1.10.0
 - twofactor_backupcodes: 1.8.0
 - twofactor_nextcloud_notification: 2.3.0
 - twofactor_totp: 5.0.0
 - twofactor_u2f: 6.0.0
 - unsplash: 1.1.6
 - updatenotification: 1.9.0
 - viewer: 1.3.0
 - workflow_script: 1.4.0
 - workflowengine: 2.1.0
Disabled:
 - breezedark
 - encryption
 - user_ldap
 - user_saml

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
       removed
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "trashbin_retention_obligation": "auto, 30",
    "version": "19.0.4.2",
    "overwrite.cli.url": "removed",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "mail_smtpmode": "smtp",
    "mail_smtpsecure": "ssl",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpauth": 1,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "filelocking.enables": true,
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0
    },
    "maintenance": false,
    "theme": "",
    "loglevel": 2,
    "filesystem_check_changes": 1,
    "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
    "updater.release.channel": "stable",
    "mysql.utf8mb4": true,
    "mail_sendmailmode": "smtp",
    "app_install_overwrite": [
        "calendar",
        "dropit",
        "files_frommail"
    ]
}


Scan output created files to the nextcloud database

Steps to reproduce

  1. create a flow closely following the documentation example which creates a new output file
  2. script puts the new output file into the nextcloud directory structure
  3. file cannot be seen within nextcloud unless manual occ files:scan is run

Expected behaviour

Feature to scan output files or documentation recommendation (or warning against) this use case.

Actual behaviour

Handling this use case is currently entirely up to the user. This may be the right behaviour, a note in the documentation would be appreciated.

Workflow Script app

Workflow Script app version: 1.7.0

Server configuration

Operating system: Ubuntu 20.04

Web server: Apache2

Database: Maria

PHP version: 7.3

Nextcloud Version: 22.1.1

Where did you install Nextcloud from: Followed docs install

Naming of this app

Is naming this files_ actually good? Because I also don't like files_texteditor - texteditor should be enough. And then naming it files_external_* is also not that good, because files_external_* is usually something like the dropbox or drive integration.

Could we change it to something like execute_script or something? Or trigger_script?

cc @nextcloud/designers for the creative part of naming things ;)

imagemagick convert script doesn't work

Steps to reproduce

  1. Install external scripts
  2. Add automated tagging to uploaded files
  3. Run the command 'convert %x -interlace plane -strip -quality 80 -resize 1000x1000> $(basename %x)_1.jpg' on files that are tagged accordingly to step 2.

Expected behaviour

Image files should be converted according to command settings and have it's original name with the suffix '_1'. This works properly when the command is run directly at the server.

Actual behaviour

Nothing happens at all - flow log is empty. The automated tagging applies, but not the external script.

Workflow Script app

Workflow Script app version: 1.4.0

Server configuration

Operating system: Ubuntu Server 20.04 LTS

Web server: Nginx

Database: MariaDB 10.3.22

PHP version: 7.4.3

Nextcloud Version: 19.0.3

Where did you install Nextcloud from: Nextcloud

Signing status:

No errors have been found.

List of activated apps:

``` Enabled: - accessibility: 1.5.0 - activity: 2.12.0 - admin_audit: 1.9.0 - analytics: 2.5.0 - bruteforcesettings: 2.0.1 - cloud_federation_api: 1.2.0 - contactsinteraction: 1.0.0 - dav: 1.15.0 - federatedfilesharing: 1.9.0 - files: 1.14.0 - files_automatedtagging: 1.9.0 - files_external: 1.10.0 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - metadata: 0.12.0 - notifications: 2.7.0 - oauth2: 1.7.0 - password_policy: 1.9.1 - provisioning_api: 1.9.0 - serverinfo: 1.9.0 - settings: 1.1.0 - sharebymail: 1.9.0 - systemtags: 1.9.0 - text: 3.0.1 - theming: 1.10.0 - theming_customcss: 1.6.0 - twofactor_backupcodes: 1.8.0 - updatenotification: 1.9.0 - viewer: 1.3.0 - workflow_script: 1.4.0 - workflowengine: 2.1.0 ```

Nextcloud configuration:

``` "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "19.0.3.1", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "activity_expire_days": 14, "auth.bruteforce.protection.enabled": true, "blacklisted_files": [ ".htaccess", "Thumbs.db", "thumbs.db" ], "cron_log": true, "enable_previews": true, "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\Movie", "OC\\Preview\\PDF", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown" ], "filesystem_check_changes": 0, "filelocking.enabled": "true", "htaccess.RewriteBase": "\/", "integrity.check.disabled": false, "knowledgebaseenabled": false, "logfile": "\/var\/nc_data\/nextcloud.log", "loglevel": 2, "logtimezone": "Europe\/Stockholm", "log_rotate_size": 104857600, "maintenance": false, "memcache.local": "\\OC\\Memcache\\APCu", "memcache.locking": "\\OC\\Memcache\\Redis", "overwriteprotocol": "https", "preview_max_x": 1024, "preview_max_y": 768, "preview_max_scale_factor": 1, "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0 }, "quota_include_external_storage": false, "share_folder": "\/Shares", "skeletondirectory": "\/var\/www\/nextcloud\/default-files", "theme": "", "trashbin_retention_obligation": "auto, 7", "updater.release.channel": "stable" ```

Are you using external storage, if yes which one: Testing on Local but the plan is to have this applied on files in external storage (SMB)

Are you using encryption: no

Server log (data/nextcloud.log)

``` Insert your server log here ```

Flow with external script stopped working (The configuration is invalid)

Steps to reproduce

  1. Create a flow with Run Script
  2. Add any condition to it
  3. Add a run script, eg. true
  4. Press the save button

Expected behaviour

The button changes to active

Actual behaviour

The button changes to The configuration is invalid

Server configuration detail

Operating system: Linux 4.4.59+ #24922 SMP PREEMPT Mon Aug 19 12:13:37 CST 2019 x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.3.21

PHP version:

7.3.14
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud version: 18.0.0 - 18.0.0.10

Updated from an older Nextcloud/ownCloud or fresh install: Latest docker container

Where did you install Nextcloud from: Docker container

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.4.0
 - activity: 2.11.0
 - cloud_federation_api: 1.1.0
 - comments: 1.8.0
 - dav: 1.14.0
 - federatedfilesharing: 1.8.0
 - federation: 1.8.0
 - files: 1.13.1
 - files_pdfviewer: 1.7.0
 - files_rightclick: 0.15.2
 - files_sharing: 1.10.1
 - files_trashbin: 1.8.0
 - files_versions: 1.11.0
 - files_videoplayer: 1.7.0
 - firstrunwizard: 2.7.0
 - issuetemplate: 0.6.0
 - keeweb: 0.6.1
 - logreader: 2.3.0
 - lookup_server_connector: 1.6.0
 - nextcloud_announcements: 1.7.0
 - notifications: 2.6.0
 - oauth2: 1.6.0
 - password_policy: 1.8.0
 - photos: 1.0.0
 - privacy: 1.2.0
 - provisioning_api: 1.8.0
 - ransomware_protection: 1.6.0
 - recommendations: 0.6.0
 - serverinfo: 1.8.0
 - settings: 1.0.0
 - sharebymail: 1.8.0
 - support: 1.1.0
 - survey_client: 1.6.0
 - systemtags: 1.8.0
 - text: 2.0.0
 - theming: 1.9.0
 - twofactor_backupcodes: 1.7.0
 - updatenotification: 1.8.0
 - viewer: 1.2.0
 - workflow_script: 1.3.1
 - workflowengine: 2.0.0
Disabled:
 - admin_audit
 - bruteforcesettings
 - encryption
 - files_external
 - files_fulltextsearch
 - fulltextsearch
 - onlyoffice
 - user_ldap

Configuration (config/config.php)
{
    "htaccess.RewriteBase": "\/",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
 **REMOVED SENSITIVE VALUE***
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "18.0.0.10",
    "overwrite.cli.url": "**REMOVED SENSITIVE VALUE***",
    "overwriteprotocol": "https",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "loglevel": 2,
    "maintenance": false,
    "theme": "",
    "app_install_overwrite": [
        "dscrenamer",
        "onlyoffice",
        "keeweb"
    ]
}

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

Are you using encryption:

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

Operating system: Ubuntu

Logs

Web server error log
-
Nextcloud log
no log entry related to this issue
Browser log

Missing/inconsistent user documentation

Version 1.1.0 lacks some user documentation:

  • Description in config is incomplete. It states "If you do not use any of the following placeholders", how ever there is no list of any placeholders (you will find them only in the https://github.com/nextcloud/workflow_script/blob/master/README.md
  • The behaviour of a rules group without any rule is not explained (AFAIK => it applies to all files)
  • A rule using a match seems to expect regex, how ever it should be explained further, preferably with examples.
  • There should be more examples (more trivial ones)

External scripts being killed

Steps to reproduce

  1. activate 'workflow external scripts' app
  2. create a rule that calls an external script
  3. trigger the event that will call the external script
  4. wait until the next cron.php schedule

Expected behaviour

Scripts should be started upon next cron.php schedule, and should be allowed to finish

Actual behaviour

External script gets killed by SIGTERM some milliseconds after start

Workflow Script app

Workflow Script app version: (see apps admin page: /index.php/settings/apps)
1.2.0

Server configuration

Operating system: Ubuntu/RedHat/...

Debian 8

Web server: Apache/Nginx
Apache 2.4,

Database: MySQL/Maria/SQLite/PostgreSQL
Postgresql 9.5

PHP version:
7.3.15 FPM (deb.sury.org)

Nextcloud Version: (see admin page)
17.0.3

Where did you install Nextcloud from:
tarball, updated since long ago

Signing status:
ok

List of activated apps:

Enabled:
  - accessibility: 1.3.0
  - activity: 2.10.1
  - admin_audit: 1.7.0
  - bruteforcesettings: 1.5.0
  - checksum: 0.4.4
  - circles: 0.17.10
  - cloud_federation_api: 1.0.0
  - comments: 1.7.0
  - dav: 1.13.0
  - deck: 0.8.0
  - dicomviewer: 1.2.1
  - end_to_end_encryption: 1.3.0
  - federatedfilesharing: 1.7.0
  - federation: 1.7.0
  - files: 1.12.0
  - files_accesscontrol: 1.7.0
  - files_automatedtagging: 1.7.0
  - files_downloadactivity: 1.6.0
  - files_fulltextsearch: 1.3.6
  - files_pdfviewer: 1.6.0
  - files_sharing: 1.9.0
  - files_trashbin: 1.7.0
  - files_versions: 1.10.0
  - files_videoplayer: 1.6.0
  - firstrunwizard: 2.6.0
  - fulltextsearch: 1.3.8
  - fulltextsearch_elasticsearch: 1.4.1
  - gallery: 18.4.0
  - groupfolders: 5.0.5
  - logreader: 2.2.0
  - lookup_server_connector: 1.5.0
  - metadata: 0.11.1
  - music: 0.13.0
  - nextcloud_announcements: 1.6.0
  - notifications: 2.5.0
  - oauth2: 1.5.0
  - password_policy: 1.7.0
  - previewgenerator: 2.2.0
  - privacy: 1.1.0
  - provisioning_api: 1.7.0
  - radio: 0.6.6
  - richdocuments: 3.5.2
  - serverinfo: 1.7.0
  - sharebymail: 1.7.0
  - sharelisting: 0.2.0
  - spreed: 7.0.2
  - support: 1.0.1
  - systemtags: 1.7.0
  - text: 1.1.1
  - theming: 1.8.0
  - theming_customcss: 1.5.0
  - twofactor_backupcodes: 1.6.0
  - twofactor_totp: 4.1.2
  - updatenotification: 1.7.0
  - viewer: 1.2.0
  - workflow_script: 1.2.0
  - workflowengine: 1.7.0

Nextcloud configuration:

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes/no
no

Server log (data/nextcloud.log)

no errors

Remarks

I've written a shell script that only logs the signals it receives (only those that can be trapped at all). Some milliseconds after start the script receives a SIGTERM. I suspect systemd's cron implementation is sending this signal when the main PHP process (of cron.php) exits. This will be very quick given the fact that external scripts are called asynchronously, see lib/BackgroundJobs/Launcher.php#71. 90s later, systemd sends SIGKILL to all processes in that process group (and this is logged in systemd's journal).

With a similar configuration but with a native cron this doesn't occur: external scripts survive the termination of cron.php, which is the expected behaviour.

Please advise what to do in this situation.

Workflow script called multiple times

Steps to reproduce

Context: I'm wanting to create a script to automatically convert videos. I wasn't seeing my script get triggered so I added 2 workflows for testing and had the script just log information when I noticed odd behavior. This is what I found.

  1. Install a vanilla nextcloud/vm instance of NextCloud
  2. Enable Workflow
  3. Add a workflow script on file upload (i.e. creation):
    • When: File Created
    • and User group membership is member of Users
    • Run script: nc_video_converter upload %e %n %f
      4.Add a workflow script on tag:
    • When: Tag assigned
    • and User group membership is member of Users
    • Run script: nc_video_converter tag %e %n %f
  4. Create a nc_video_converter script on the server
    • sudo vim /usr/bin/nc_video_converter
      #!/bin/bash
      echo "Running converter..." >> /var/log/nc_video_converter
      echo "$@" >> /var/log/nc_video_converter
      
    • sudo chmod +x /usr/bin/nc_video_converter
    • (not sure if this is needed?) sudo chown www-data:www-data /usr/bin/nc_video_converter
  5. Create a user assigned to the Users group
  6. Login as that user and upload a file
  7. Notice the /var/log/nc_video_converter file shows:
    Running converter...
    tag OCP\SystemTag\ISystemTagObjectMapper::assignTags /myusername/files/Screen Shot 2020-04-02 at 4.02.43 PM.png /tmp/oc_tmp_6Z7GGl-.png
    Running converter...
    upload OCP\SystemTag\ISystemTagObjectMapper::assignTags /myusername/files/Screen Shot 2020-04-02 at 4.02.43 PM.png /tmp/oc_tmp_XjOYL4-.png
    
  8. Add a tag to a file
  9. Notice the /var/log/nc_video_converter file shows:
    Running converter...
    tag \OCP\Files::postCreate /myusername/files/Screen Shot 2020-04-02 at 4.02.33 PM.png /tmp/oc_tmp_Jd9L2p-.png
    Running converter...
    upload \OCP\Files::postCreate /myusername/files/Screen Shot 2020-04-02 at 4.02.33 PM.png /tmp/oc_tmp_5evyop-.png
    

Expected behaviour

I expect that when I upload a file that only the workflow for the file upload would be triggered.

I expect that when I tag a file that only the workflow for the tag would be triggered.

Actual behaviour

When I upload a file both the file upload AND the tag workflows were triggered. Interestingly, though, you can see that both workflows printed the same event name: OCP\SystemTag\ISystemTagObjectMapper::assignTags.

When I tag a file both both workflows were triggered. Interestingly, both workflows printed the same event name \OCP\Files::postCreate.

Workflow Script app

Workflow Script app version: 1.3.1

Server configuration

Operating system: Ubuntu 18.04 LTS (Linux ubuntu-bionic 4.15.0-91-generic)

Web server: Apache

Database: PostgreSQL

PHP version: PHP 7.2.24-0ubuntu0.18.04.3 (cli)

Nextcloud Version: 18.0.3

Where did you install Nextcloud from: github.com/nextcloud/vm using the virtualbox example

Signing status:

No errors have been found.

List of activated apps:

Enabled:
  - accessibility: 1.4.0
  - activity: 2.11.0
  - admin_audit: 1.8.0
  - cloud_federation_api: 1.1.0
  - comments: 1.8.0
  - dav: 1.14.0
  - federatedfilesharing: 1.8.0
  - federation: 1.8.0
  - files: 1.13.1
  - files_pdfviewer: 1.7.0
  - files_rightclick: 0.15.2
  - files_sharing: 1.10.1
  - files_trashbin: 1.8.0
  - files_versions: 1.11.0
  - files_videoplayer: 1.7.0
  - firstrunwizard: 2.7.0
  - logreader: 2.3.0
  - lookup_server_connector: 1.6.0
  - nextcloud_announcements: 1.7.0
  - notifications: 2.6.0
  - oauth2: 1.6.0
  - password_policy: 1.8.0
  - photos: 1.0.0
  - privacy: 1.2.0
  - provisioning_api: 1.8.0
  - recommendations: 0.6.0
  - serverinfo: 1.8.0
  - settings: 1.0.0
  - sharebymail: 1.8.0
  - support: 1.1.0
  - survey_client: 1.6.0
  - systemtags: 1.8.0
  - text: 2.0.0
  - theming: 1.9.0
  - twofactor_backupcodes: 1.7.0
  - updatenotification: 1.8.0
  - video_converter: 0.1.3
  - viewer: 1.2.0
  - workflow_script: 1.3.1
  - workflowengine: 2.0.0
Disabled:
  - encryption
  - files_external
  - user_ldap

Nextcloud configuration:

``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

</details>

**Are you using external storage, if yes which one:** local/smb/sftp/...

**Are you using encryption:** yes/no

### Server log (data/nextcloud.log)
<details>

(not available)


</details>

Does the input field accept regular expressions?

version workflow external scripts 1.4.0, nextcloud server 19.0.2

in
'if file created and filename is " "', does the input field accept regular expressions? Only when I enter a static name eg. "testfile.txt" my script gets executed. Entering "test*.txt" oder "test.*.txt" doesn't match for "testfile.txt". Is a special syntax needed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.