R0Wi-DEV / workflow_ocr

This is a Nextcloud Workflow App which enables you to process files via OCR on serverside.
GNU Affero General Public License v3.0
79 stars 6 forks source link

Cannot decrypt file but encryption is not enabled and file is not shared. #254

Closed m1raculix closed 3 months ago

m1raculix commented 3 months ago

Describe the bug DecryptionFailedException Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you. Error while generating metadata for fileid 159215

sudo -u www-nextcloud php occ encryption:status

System

How to reproduce

Steps to reproduce the behavior:

  1. Upload a PDF which triggers the configured flow
  2. Encryption is disables, file is readable by user
  3. Flow is configured at the user who uploaded the file.
  4. Neither file nor folder is shared
  5. See error

Screenshots

If applicable, add screenshots to help explain your problem.

Server log

{"reqId":"NUmcOxK16KqKD9pPua6q","level":2,"time":"2024-06-11T20:03:31+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Error while generating metadata for fileid 159272","userAgent":"--","version":"29.0.2.2","exception":{"Exception":"OC\Encryption\Exceptions\DecryptionFailedException","Message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Stream/Encryption.php","line":517,"function":"decrypt","class":"OCA\Encryption\Crypto\Encryption","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/private/Files/Stream/Encryption.php","line":316,"function":"readCache","class":"OC\Files\Stream\Encryption","type":"->"},{"function":"stream_read","class":"OC\Files\Stream\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":240,"function":"stream_get_contents"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":253,"function":"file_get_contents","class":"OC\Files\Storage\Wrapper\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1171,"function":"file_get_contents","class":"OC\Files\Storage\Wrapper\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":584,"function":"basicOperation","class":"OC\Files\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/File.php","line":54,"function":"file_get_contents","class":"OC\Files\View","type":"->"},{"file":"/var/www/nextcloud/apps/photos/lib/Listener/SizeMetadataProvider.php","line":64,"function":"getContent","class":"OC\Files\Node\File","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":86,"function":"handle","class":"OCA\Photos\Listener\SizeMetadataProvider","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":230,"function":"__invoke","class":"OC\EventDispatcher\ServiceEventListener","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":59,"function":"callListeners","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":98,"function":"dispatch","class":"OC\EventDispatcher\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/FilesMetadata/FilesMetadataManager.php","line":114,"function":"dispatchTyped","class":"OC\EventDispatcher\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":107,"function":"refreshMetadata","class":"OC\FilesMetadata\FilesMetadataManager","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\Core\BackgroundJobs\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\Core\BackgroundJobs\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":88,"function":"scanFolder","class":"OC\Core\BackgroundJobs\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/core/BackgroundJobs/GenerateMetadataJob.php","line":74,"function":"scanFilesForUser","class":"OC\Core\BackgroundJobs\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OC\Core\BackgroundJobs\GenerateMetadataJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\BackgroundJob\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\BackgroundJob\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":176,"function":"execute","class":"OCP\BackgroundJob\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/encryption/lib/Crypto/Encryption.php","Line":352,"Hint":"Diese Datei kann nicht entschlüsselt werden, es handelt sich wahrscheinlich um eine geteilte Datei. Bitte kontaktiere den Eigentümer der Datei und bitte darum, die Datei noch einmal mit dir zu teilen.","message":"Error while generating metadata for fileid 159272","exception":[],"CustomMessage":"Error while generating metadata for fileid 159272"},"id":"666892aa7180f"}

Paste relevant server log lines here. Make sure to trim sensitive information.

Browser log

not applicable

Additional context

I uploaded this file after disabling encryption, before, I found out that encryption was enabled, but never used it. I have a quite old installation, running since 2016.

R0Wi commented 3 months ago

Are you sure this error is related to the OCR workflow? I can only see the Photos App in the stacktrace, I'm not able to see any reference to this apps code.

Did you try disabling the OCR app and try to reproduce the issue?

m1raculix commented 3 months ago

You are right, its not an OCR issue, OCR works like a charm! Thanks for developing it!

R0Wi commented 3 months ago

Glad to hear that you like the app. Cheers :-)