Server Error after clicking on download link in shared folder

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 17.0.3
Operating system and version (eg, Ubuntu 20.04): Debian Buster
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.1): 7.3

The issue you are facing:
A user on my Nextcloud has shared a folder using a Share Link. Now, people can click the link and view the folder listing as normal, but whenever one clicks on “Download” on one of the files or folders or even the “Download all files” button at the top, they get the “internal server error” screen.

When you create a new share link from a different user, that link can be used like normal. The original link still doesn’t work, though, but it has been widely distributed so it would be really helpful to get it working again.

Is this the first time you’ve seen this error? (Y/N): yes

Steps to replicate it:

  1. Click on that specific link (not public, so not really reproducible, i know… :frowning: )
  2. Click on any Download button

The output of your Nextcloud log in Admin > Logging:
(these two log entries appear every time I click on “Download”)

Error     index	Exception: Call to a member function getPath() on null

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 126:

    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Sh ... {}, "downloadShare")

    /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

    OC\AppFramework\App::main("OCA\\Files_ ... r", "downloadShare", OC\AppFramew ... {}, { token: "zq ... "})

    <<closure>>

    OC\AppFramework\Routing\RouteActionHandler->__invoke({ token: "zq ... "})

    /var/www/nextcloud/lib/private/Route/Router.php - line 297:

    call_user_func(OC\AppFramew ... {}, { token: "zq ... "})

    /var/www/nextcloud/lib/base.php - line 997:

    OC\Route\Router->match("/s/zqLaPLR4QGBbP2a/download")

    /var/www/nextcloud/index.php - line 42:

    OC::handleRequest()

Cased by Error: Call to a member function getPath() on null

    /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareController.php - line 621:

    OCA\Files_Sharing\Controller\ShareController->singleFileDownloaded(OC\Share20\Share {}, OC\Files\Node\Folder {})

    /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareController.php - line 562:

    OCA\Files_Sharing\Controller\ShareController->fileListDownloaded(OC\Share20\Share {}, [ "Design"], OC\Files\Node\Folder {})

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 170:

    OCA\Files_Sharing\Controller\ShareController->downloadShare("zqLaPLR4QGBbP2a", "Design", "/", "0eubox7b567s")

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 99:

    OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Sh ... {}, "downloadShare")

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 126:

    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Sh ... {}, "downloadShare")

    /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

    OC\AppFramework\App::main("OCA\\Files_ ... r", "downloadShare", OC\AppFramew ... {}, { token: "zq ... "})

    <<closure>>

    OC\AppFramework\Routing\RouteActionHandler->__invoke({ token: "zq ... "})

    /var/www/nextcloud/lib/private/Route/Router.php - line 297:

    call_user_func(OC\AppFramew ... {}, { token: "zq ... "})

    /var/www/nextcloud/lib/base.php - line 997:

    OC\Route\Router->match("/s/zqLaPLR4QGBbP2a/download")

    /var/www/nextcloud/index.php - line 42:

    OC::handleRequest()
Error	PHP	Undefined offset: 0 at /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareController.php#637

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

<?php
$CONFIG = array (
  'instanceid' => '<redacted>',
  'passwordsalt' => '<redacted>',
  'secret' => '<redacted>',
  'trusted_domains' => 
  array (
    0 => '<redacted>',
    1 => '<redacted>',
    2 => '<redacted>',
    3 => '<redacted>',
    4 => '<redacted>',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'overwrite.cli.url' => '<redacted>',
  'dbtype' => 'mysql',
  'version' => '17.0.3.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_root',
  'dbpassword' => '<redacted>',
  'logtimezone' => 'UTC',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'sendmail',
  'mail_from_address' => 'admin+nc',
  'mail_domain' => '<redacted>',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'trashbin_retention_obligation' => '1, 30',
  'updater.release.channel' => 'stable',
  'mysql.utf8mb4' => true,
  'app_install_overwrite' => 
  array (
    0 => 'onlyoffice',
    1 => 'impersonate',
  ),
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'activity_expire_days' => 180,
);

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

10.0.96.54 - - [18/May/2020:13:47:28 +0200] "GET /index.php/s/zqLaPLR4QGBbP2a/download?path=%2F&files=<redacted>&downloadStartSecret=<redacted> HTTP/1.1" 500 10412 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0"

At least, that’s the only apache log entry that I can correlate to this error.

Any help is appreciated - thank you very much! I wasn’t sure if this should be a forum post or a Github issue, but I’ll try this first.

Hey there,

I am facing a similar issue and I wonder if you got your problem resolved in the meantime?

Cheers!