Photos uploaded via public upload not accessible (with encryption module)

Nextcloud version (eg, 10.0.2):

11.0.3

Operating system and version (eg, Ubuntu 16.04):

Ubuntu 16.04 (Shared host at ALL-INKL)

Apache or nginx version (eg, Apache 2.4.25):

Apache 2 (exact version not known)

PHP version (eg, 5.6):

7.1

Is this the first time you’ve seen this error?:

Yes

Can you reliably replicate it? (If so, please outline steps):

  1. Install Nextcloud 11.0.3
  2. Enable Encryption module.
  3. Create a new folder.
  4. Share folder with “Allow upload and editing” enabled.
  5. Upload photos via link.

The issue you are facing:

The uploaded photos appear both in the public and internal file list, but are not accessible.
Previews are not being shown (or generated) and opening the files yields a 500 Internal Server Error (Firefox displays a “File not found” error message).

The output of your Nextcloud log in Admin > Logging:
(see next posts)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***,
  'trusted_domains' =>
  array (
    0 => '***',
  ),
  'datadirectory' => '/www/htdocs/w0123456/nextcloud/data',
  'overwrite.cli.url' => '***',
  'dbtype' => 'mysql',
  'version' => '11.0.3.2',
  'dbname' => '***',
  'dbhost' => '***',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '***',
  'dbpassword' => '***',
  'logtimezone' => 'UTC',
  'installed' => true,
  'updater.secret' => '***',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);

The output of your Apache/nginx/system log in /var/log/____:

Unfortunately, I cannot access it due to being on a shared host.

Error 1/3: When uploading a photo:

Error 2/3: When trying to downloading the photo:

Error 3/3: When opening the folder with the files in gallery mode:

Could be related to PHP 7.1, @oparoz can you help?

I just downgraded to PHP 7.0.14 and indeed cannot reproduce the issue.

Update: I was wrong, the issue persists.

I have the same (?) problem, with the latest NC111, as well as now with the NC 12.0 beta1 and PHP5.6 as well as PHP7.0

I (sometimes) get a Bad-Signature-Thing in my log (here with a PDF, this really affects all files uploaded via a share link):

OCP\Encryption\Exceptions\GenericEncryptionException: Bad Signature

  1. /owncloud/htdocs/apps/encryption/lib/Crypto/Crypt.php - line 463: OCA\Encryption\Crypto\Crypt->checkSignature(‘fa2MI63pXBKoMkG
’, ‘\xD8\x8D\xD8s\xC4;T\xEAq\x02\x1D\x08b\xDC\xFF
’, ‘ede122ad14ce3d1
’)

  2. /owncloud/htdocs/apps/encryption/lib/Crypto/Encryption.php - line 372: OCA\Encryption\Crypto\Crypt->symmetricDecryptFileContent(‘fa2MI63pXBKoMkG
’, ‘\xD8\x8D\xD8s\xC4;T\xEAq\x02\x1D\x08b\xDC\xFF
’, ‘AES-256-CTR’, 0, 0)

  3. /owncloud/htdocs/lib/private/Files/Stream/Encryption.php - line 460: OCA\Encryption\Crypto\Encryption->decrypt(*** sensitive parameters replaced ***)

  4. /owncloud/htdocs/lib/private/Files/Stream/Encryption.php - line 291: OC\Files\Stream\Encryption->readCache()

  5. [internal function] OC\Files\Stream\Encryption->stream_read(8192)

  6. /owncloud/htdocs/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php - line 83: fread(Resource id #44, 8192)

  7. /owncloud/htdocs/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php - line 91: Icewind\Streams\Wrapper->stream_read(8192)

  8. [internal function] Icewind\Streams\CallbackWrapper->stream_read(8192)

  9. /owncloud/htdocs/lib/private/Files/View.php - line 436: fread(Resource id #47, 8192)

  10. /owncloud/htdocs/lib/private/legacy/files.php - line 308: OC\Files\View->readfile(’/sharetest/0712
’)

  11. /owncloud/htdocs/lib/private/legacy/files.php - line 120: OC_Files getSingleFile(Object(OC\Files\View), ‘/sharetest’, ‘07129178.pdf’, Array)

  12. /owncloud/htdocs/apps/files_sharing/lib/Controller/ShareController.php - line 530: OC_Files get(’/sharetest’, ‘07129178.pdf’, Array)

  13. [internal function] OCA\Files_Sharing\Controller\ShareController->downloadShare(‘CwQUsOX1M4RykSo’, ‘07129178.pdf’, ‘/’, ‘’)

  14. /owncloud/htdocs/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)

  15. /owncloud/htdocs/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Files_Sharing\Controller\ShareController), ‘downloadShare’)

  16. /owncloud/htdocs/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files_Sharing\Controller\ShareController), ‘downloadShare’)

  17. /owncloud/htdocs/lib/public/AppFramework/App.php - line 136: OC\AppFramework\App main(‘ShareController’, ‘downloadShare’, Object(OC\AppFramework\DependencyInjection\DIContainer))

  18. /owncloud/htdocs/core/routes.php - line 129: OCP\AppFramework\App->dispatch(‘ShareController’, ‘downloadShare’)
    [internal function] OC\Route\Router->{closure}(Array)

  19. /owncloud/htdocs/lib/private/Route/Router.php - line 299: call_user_func(Object(Closure), Array)

  20. /owncloud/htdocs/lib/base.php - line 976: OC\Route\Router->match(’/s/CwQUsOX1M4Ry
’)

  21. /owncloud/htdocs/index.php - line 40: OC handleRequest()
    {main}

For the time being, I have disabled uploads via links, but it would be great, if we could get to the bottom of this.

Hope they will fix this soon.

Same Problem here with newest Version 11.0.3 and beta 12.

waiting for fix :slight_smile:

:white_check_mark: This bug is fixed in version 12.0.0 (just verified after upgrading my instance).