nextcloud / nextcloud/workflow_script

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

Open
#65 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
89
Forks
19
Avg merge
6h 38m
Merged PRs (30d)
3

Description

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"
    ]
}


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the difference between a file created through the web UI or synchronized folder and one written directly under the user's data directory. Run cron.php after each case and inspect the workflow_script and workflowengine behavior. Done means the File created trigger also fires for the locally created file, with coverage for the reported scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.