Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Arduous opened this issue Oct 18, 2020 · 7 comments

Comments

@Arduous
Copy link

Arduous commented Oct 18, 2020

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


@mlsxlist
Copy link

I am seeing the same issue. I scan a document as PDF with a HP multifunctional printer and store it in a directory i.e. /var/www/nextcloud/data/user/files/scaninbox shared via samba. I would like to execute a script that OCRs the PDF and adds a text layer so it can be searched via elastic search. Unfortunately the script is never executed although sudo -u www-data php -f /var/www/nextcloud/cron.php is executed.

@k1l1
Copy link
Contributor

k1l1 commented Oct 28, 2020

@mlsxlist Do you use nextcloud for storing the file? Or do you store it using the operating system for that? In latter case, have you tried adding the file to nextcloud afterwards?
sudo -u www-data -s /usr/bin/php /var/www/nextcloud/occ scan userxyz/files/scan/test.txt

@benjaminfrombe
Copy link

same issue here, running occ files:scan (--all / user / --path) does not trigger the workflow. I would like to achieve exactly the same thing:

my scanner uploads the pdf via ftp, and I would like to run a workflow to OCR the pdf.

it does work when I upload the pdf using the normal UI.

@mlsxlist
Copy link

@mlsxlist Do you use nextcloud for storing the file? Or do you store it using the operating system for that? In latter case, have you tried adding the file to nextcloud afterwards?
sudo -u www-data -s /usr/bin/php /var/www/nextcloud/occ scan userxyz/files/scan/test.txt

I run "occ scan" as a cron job, but it does no trigger the workflow.

@k1l1
Copy link
Contributor

k1l1 commented Nov 14, 2020

Do you know if a workflow is triggered if you add the file via the webdav api?
eg. try to use something like
curl -X PUT "https://mycloud.net/remote.php/webdav/folder/file.txt" –data-binary @"file.txt" -u myusername

@benjaminfrombe
Copy link

yes it is, that's currently my workaround

@XueSheng-GIT
Copy link

I'm using a samba share as external_storage to access scanned hardcopies (my printer/scanner is only able to use samba as network storage). Would be great if files:scan would emit a postCreate to get flows triggered for external storages.

Unfortunately I cannot use webdav with my printer/scanner. Is there any other workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants