nextcloud / files_automatedtagging

:bookmark: An app for Nextcloud that assigns tags to newly uploaded files based on some conditions
https://apps.nextcloud.com/apps/files_automatedtagging
52 stars 23 forks source link

occ files:scan doesn't work anymore if the path is not a single file under the root of the user space #526

Closed forsequans closed 2 years ago

forsequans commented 2 years ago

How to use GitHub

Steps to reproduce

1. php occ files:scan your_user
2. php occ files:scan --path="your_user/files
3. php occ files:scan --path="your_user/files/a_subdir

Expected behaviour

All new files should appear in the web interface and the result of the command should be:

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 13      | 5     | 00:00:01     |
+---------+-------+--------------+

Actual behaviour

new files don't apperar in the web interface and the result of the command is: Tell us what happens instead

Exception during scan: The requested uri() cannot be processed by the script '/data/nextcloud/occ')
#0 /data/nextcloud/lib/private/AppFramework/Http/Request.php(810): OC\AppFramework\Http\Request->getRawPathInfo()
nextcloud/server#1 /data/nextcloud/apps/workflowengine/lib/Check/RequestURL.php(75): OC\AppFramework\Http\Request->getPathInfo()
nextcloud/server#2 /data/nextcloud/apps/workflowengine/lib/Check/RequestURL.php(50): OCA\WorkflowEngine\Check\RequestURL->getActualValue()
nextcloud/server#3 /data/nextcloud/apps/workflowengine/lib/Service/RuleMatcher.php(241): OCA\WorkflowEngine\Check\RequestURL->executeCheck('is', 'https://cloud-p...')
nextcloud/server#4 /data/nextcloud/apps/workflowengine/lib/Service/RuleMatcher.php(176): OCA\WorkflowEngine\Service\RuleMatcher->check(Array)
nextcloud/server#5 /data/nextcloud/apps/workflowengine/lib/Service/RuleMatcher.php(124): OCA\WorkflowEngine\Service\RuleMatcher->getMatchingOperations('OCA\\FilesAutoma...', false)
nextcloud/server#6 /data/nextcloud/apps/files_automatedtagging/lib/Operation.php(95): OCA\WorkflowEngine\Service\RuleMatcher->getFlows(false)
nextcloud/server#7 /data/nextcloud/apps/files_automatedtagging/lib/Listener/CacheListener.php(43): OCA\FilesAutomatedTagging\Operation->checkOperations(Object(OCA\Files_Trashbin\Storage), 214662, 'files/NoMachine')
nextcloud/server#8 /data/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php(76): OCA\FilesAutomatedTagging\Listener\CacheListener->handle(Object(OCP\Files\Cache\CacheEntryUpdatedEvent))
nextcloud/server#9 /data/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(251): OC\EventDispatcher\ServiceEventListener->__invoke(Object(OCP\Files\Cache\CacheEntryUpdatedEvent), 'OCP\\Files\\Cache...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
nextcloud/server#10 /data/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'OCP\\Files\\Cache...', Object(OCP\Files\Cache\CacheEntryUpdatedEvent))
nextcloud/server#11 /data/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(86): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(OCP\Files\Cache\CacheEntryUpdatedEvent), 'OCP\\Files\\Cache...')
nextcloud/server#12 /data/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(98): OC\EventDispatcher\EventDispatcher->dispatch('OCP\\Files\\Cache...', Object(OCP\Files\Cache\CacheEntryUpdatedEvent))
nextcloud/server#13 /data/nextcloud/lib/private/Files/Cache/Cache.php(415): OC\EventDispatcher\EventDispatcher->dispatchTyped(Object(OCP\Files\Cache\CacheEntryUpdatedEvent))
nextcloud/server#14 /data/nextcloud/lib/private/Files/Cache/Scanner.php(400): OC\Files\Cache\Cache->update(214662, Array)
nextcloud/server#15 /data/nextcloud/lib/private/Files/Cache/Scanner.php(392): OC\Files\Cache\Scanner->scanChildren('files/NoMachine', true, 3, 214662, true)
nextcloud/server#16 /data/nextcloud/lib/private/Files/Cache/Scanner.php(392): OC\Files\Cache\Scanner->scanChildren('files', true, 3, 3371, true)
nextcloud/server#17 /data/nextcloud/lib/private/Files/Cache/Scanner.php(341): OC\Files\Cache\Scanner->scanChildren('', true, 3, 3369, true)
nextcloud/server#18 /data/nextcloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan('', true, 3)
nextcloud/server#19 /data/nextcloud/apps/files/lib/Command/Scan.php(158): OC\Files\Utils\Scanner->scan('/your_user', true, NULL)
nextcloud/server#20 /data/nextcloud/apps/files/lib/Command/Scan.php(214): OCA\Files\Command\Scan->scanFiles('your_user', '/your_user', Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
nextcloud/server#21 /data/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud/server#22 /data/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud/server#23 /data/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud/server#24 /data/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud/server#25 /data/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /data/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud/server#27 /data/nextcloud/console.php(100): OC\Console\Application->run()
nextcloud/server#28 /data/nextcloud/occ(11): require_once('/data/nextcloud...')

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 13      | 5     | 00:00:01     |
+---------+-------+--------------+

Server configuration

Operating system: Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster

Web server: Apache HTTP Server: apache2 2.4.38-3+deb10u3

Database: mariadb-server 1:10.3.27-0+deb10u1

PHP version: php7.3 7.3.14-1~deb10u1

Nextcloud version: (see Nextcloud admin page) 21.0.5 (also exists in 20.0.10)

Updated from an older Nextcloud/ownCloud or fresh install: Updated from 20.0.10

No errors have been found.

List of activated apps:

App list - accessibility: 1.7.0 - activity: 2.14.3 - admin_audit: 1.11.0 - announcementcenter: 5.0.1 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contactsinteraction: 1.2.0 - dashboard: 7.1.0 - data_request: 1.8.0 - dav: 1.17.1 - deck: 1.4.5 - drop_account: 1.0.2 - external: 3.8.2 - extract: 1.3.2 - federatedfilesharing: 1.11.0 - files: 1.16.0 - files_antivirus: 3.2.2 - files_automatedtagging: 1.11.0 - files_downloadactivity: 1.11.1 - files_fulltextsearch: 21.0.4 - files_pdfviewer: 2.1.0 - files_readmemd: 1.2.0 - files_retention: 1.10.2 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_texteditor: 2.14.0 - files_trackdownloads: 1.10.0 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - firstrunwizard: 2.10.0 - forms: 2.3.0 - fulltextsearch: 21.0.3 - fulltextsearch_elasticsearch: 21.0.2 - group_everyone: 0.1.8 - groupquota: 0.1.6 - impersonate: 1.8.0 - 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 - privacy: 1.5.0 - provisioning_api: 1.11.0 - quota_warning: 1.11.0 - ransomware_protection: 1.11.0 - registration: 1.3.0 - serverinfo: 1.11.0 - settings: 1.3.0 - sharebymail: 1.11.0 - sharingpath: 0.4.3 - suspicious_login: 4.0.0 - systemtags: 1.11.0 - terms_of_service: 1.7.1 - text: 3.2.0 - theming: 1.12.0 - theming_customcss: 1.9.0 - twofactor_backupcodes: 1.10.0 - updatenotification: 1.11.0 - user_ldap: 1.11.0 - user_retention: 1.4.0 - user_status: 1.1.1 - user_usage_report: 1.5.0 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.1 Disabled: - encryption - federation - files_external - files_lock - login_notes - photos - recommendations - support - survey_client

Nextcloud configuration:

Config report { "system": { "default_phone_region": "FR", "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud-preprod.sequans.com" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "21.0.5.1", "overwrite.cli.url": "https:\/\/cloud-preprod.sequans.com", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "ldapIgnoreNamingRules": false, "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory", "ldapUserCleanupInterval": 2, "filelocking.enabled": true, "memcache.local": "\\OC\\Memcache\\APCu", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0 }, "htaccess.RewriteBase": "\/", "maintenance": false, "theme": "", "loglevel": 1, "logfile": "\/data\/nextcloud\/log\/nextcloud.log", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtptimeout": 30, "updater.release.channel": "stable", "trashbin_retention_obligation": "auto,15", "force_language": "en", "knowledgebaseenabled": false, "logtimezone": "Europe\/Paris", "enable_previews": true, "skeletondirectory": "", "session_lifetime": 1600, "session_keepalive": false, "remember_login_cookie_lifetime": 0, "app_install_overwrite": [ "impersonate", "quota_warning", "files_downloadactivity", "sharerenamer", "defaultgroup", "drop_account", "files_readmemd" ], "mysql.utf8mb4": true, "data-fingerprint": "bc3bf5328e316244a72c5929e640bf1f", "updater.secret": "***REMOVED SENSITIVE VALUE***" } }

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

Are you using encryption: no

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

LDAP configuration (delete this part if not used)

LDAP config

Web server error log

Web server error log No logs reported

Nextcloud log (data/nextcloud.log)

Nextcloud log No logs reported
kesselb commented 2 years ago

Would you mind to share php -v?

forsequans commented 2 years ago
PHP 7.3.27-1-deb10u1 (cli) (built: Feb 13 2021 16:31:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.27, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.27-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies
forsequans commented 2 years ago

After test I found that as soon as an automated tagging rule using "Request URL" as filter is set, this bug happen once the rule is deleted the occ scan works fine