Opening a shared file or folder over a share link without an account results in an internal server error

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, 20.0.5): 27.1.5
Operating system and version (eg, Ubuntu 20.04): Ubuntu Server 22.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.58
PHP version (eg, 7.4): 7.4

The issue you are facing:
Opening a shared file or folder over a share link without an account results in an internal server error.

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

Steps to replicate it:

  1. Create a file or folder public share link in the files tab
  2. Open the link in a browser that is not logged into the nextcloud

The output of your Nextcloud log in Admin > Logging:

{"reqId":"IA2t7CnMybLLlORnaQU4","level":3,"time":"2024-02-29T10:07:38+00:00","remoteAddr":"172.19.0.1","user":"--","app":"index","method":"GET","url":"/s/rExiSB4CESHsWiF","message":"Exception thrown: Exception","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Falkon/23.08.5 QtWebEngine/5.15.2 Chrome/87.0.4280.144 Safari/537.36","version":"27.1.5.1","exception":{"Exception":"Exception","Message":"OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given in file '/var/www/html/custom_apps/files_reader/lib/Listeners/LoadViewerListener.php' line 32","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files_Sharing\\Controller\\ShareController"],"showShare"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\ShareController","showShare",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["rExiSB4CESHsWiF","files_sharing.Share.showShare"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/s/rExiSB4CESHsWiF"]},{"file":"/var/www/html/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given","Code":0,"Trace":[{"function":"__construct","class":"OCA\\Files_Reader\\Listeners\\LoadViewerListener","type":"->","args":[["OC\\AppFramework\\Services\\InitialState"],["OC\\AllConfig"],null]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"newInstanceArgs","class":"ReflectionClass","type":"->","args":[[["OC\\AppFramework\\Services\\InitialState"],["OC\\AllConfig"],null]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[["ReflectionClass","OCA\\Files_Reader\\Listeners\\LoadViewerListener"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":494,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/var/www/html/lib/private/ServerContainer.php","line":155,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php","line":70,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->","args":[["OCA\\Viewer\\Event\\LoadViewer"],"OCA\\Viewer\\Event\\LoadViewer",["Symfony\\Component\\EventDispatcher\\EventDispatcher"]]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[[["Closure"],["Closure"],["Closure"],["Closure"],["Closure"],"And 2 more entries, set log level to debug to see all entries"],"OCA\\Viewer\\Event\\LoadViewer",["OCA\\Viewer\\Event\\LoadViewer"]]},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":94,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[["OCA\\Viewer\\Event\\LoadViewer"],"OCA\\Viewer\\Event\\LoadViewer"]},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":106,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->","args":["OCA\\Viewer\\Event\\LoadViewer",["OCA\\Viewer\\Event\\LoadViewer"]]},{"file":"/var/www/html/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php","line":238,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->","args":[["OCA\\Viewer\\Event\\LoadViewer"]]},{"file":"/var/www/html/apps/files_sharing/lib/Controller/ShareController.php","line":378,"function":"renderPage","class":"OCA\\Files_Sharing\\DefaultPublicShareTemplateProvider","type":"->","args":[["OC\\Share20\\Share"],"rExiSB4CESHsWiF",""]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"showShare","class":"OCA\\Files_Sharing\\Controller\\ShareController","type":"->","args":[""]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files_Sharing\\Controller\\ShareController"],"showShare"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files_Sharing\\Controller\\ShareController"],"showShare"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\ShareController","showShare",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["rExiSB4CESHsWiF","files_sharing.Share.showShare"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/s/rExiSB4CESHsWiF"]},{"file":"/var/www/html/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/files_reader/lib/Listeners/LoadViewerListener.php","Line":32},"CustomMessage":"Exception thrown: Exception"}}

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

<?php
$CONFIG = array (
  'one-click-instance' => true,
  'one-click-instance.user-limit' => 100,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'appsallowlist' => 
  array (
  ),
  'check_data_directory_permissions' => false,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'nextcloud-aio-redis',
    'password' => '[####]',
    'port' => 6379,
  ),
  'overwritehost' => 'nextcloud.[####]',
  'overwriteprotocol' => 'https',
  'passwordsalt' => '[####]',
  'secret' => '[####]',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'nextcloud.ourdns.zone',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '27.1.5.1',
  'overwrite.cli.url' => 'https://nextcloud.ourdns.zone/',
  'dbname' => 'nextcloud_database',
  'dbhost' => 'nextcloud-aio-database',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_nextcloud',
  'dbpassword' => '[####]',
  'installed' => true,
  'instanceid' => 'ocmhubwedgab',
  'maintenance' => false,
  'loglevel' => '2',
  'log_type' => 'file',
  'logfile' => '/var/www/html/data/nextcloud.log',
  'log_rotate_size' => '10485760',
  'log.condition' => 
  array (
    'apps' => 
    array (
      0 => 'admin_audit',
    ),
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'enabledPreviewProviders' => 
  array (
    1 => 'OC\\Preview\\Image',
    2 => 'OC\\Preview\\MarkDown',
    3 => 'OC\\Preview\\MP3',
    4 => 'OC\\Preview\\TXT',
    5 => 'OC\\Preview\\OpenDocument',
    6 => 'OC\\Preview\\Movie',
    7 => 'OC\\Preview\\Krita',
    0 => 'OC\\Preview\\Imaginary',
  ),
  'enable_previews' => true,
  'upgrade.disable-web' => true,
  'mail_smtpmode' => 'smtp',
  'trashbin_retention_obligation' => 'auto, 30',
  'versions_retention_obligation' => 'auto, 30',
  'activity_expire_days' => '30',
  'simpleSignUpLink.shown' => false,
  'share_folder' => '/Shared',
  'one-click-instance.link' => 'https://nextcloud.com/all-in-one/',
  'upgrade.cli-upgrade-link' => 'https://github.com/nextcloud/all-in-one/discussions/2726',
  'updatedirectory' => '/nc-updater',
  'allow_local_remote_servers' => true,
  'davstorage.request_timeout' => 3600,
  'htaccess.RewriteBase' => '/',
  'dbpersistent' => false,
  'files_external_allow_create_new_local' => false,
  'trusted_proxies' => 
  array (
    0 => '127.0.0.1',
    1 => '::1',
  ),
  'preview_imaginary_url' => 'http://nextcloud-aio-imaginary:9000',
  'app_install_overwrite' => 
  array (
    0 => 'folderplayer',
    1 => 'radio',
    2 => 'files_reader',
    3 => 'solitaire',
    4 => 'files_external_ipfs',
    5 => 'nextcloud-videoplayer',
  ),
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_from_address' => 'noreply',
  'mail_domain' => '[####]',
  'mail_smtphost' => '[####]',
  'mail_smtpname' => '[####]',
  'mail_smtppassword' => '[####]',
  'mail_smtpport' => '465​',
  'mail_smtpsecure' => 'ssl',
);

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

caddy    | {"level":"error","ts":1709198011.457703,"logger":"http.log.error.log0","msg":"read tcp 172.90.0.100:37132->172.90.0.1:11000: read: connection reset by peer","request":{"remote_ip":"89.1.154.150","remote_port":"42992","proto":"HTTP/1.1","method":"GET","host":"nextcloud.#####","uri":"/apps/richdocuments/settings/fonts.json","headers":{"Date":["Thu, 29 Feb 2024 09:13:31"],"User-Agent":["COOLWSD HTTP Agent 23.05.9.1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"","server_name":"nextcloud.#####"}},"duration":0.000565662,"status":502,"err_id":"b4j6m8ba1","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
caddy    | {"level":"error","ts":1709199244.4279833,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"http2: stream closed"}
caddy    | {"level":"info","ts":1709199797.7403238,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
caddy    | {"level":"info","ts":1709199797.744463,"logger":"tls","msg":"finished cleaning storage units"}

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

This app seems to cause your problems…

1 Like

It appears you’ve force enabled several incompatible apps (the above list) at some point. Some of them may no longer be enabled, but I’d suggest reviewing this list of apps in case some still are enabled. If any are, confirm they’re truly compatible with Nextcloud v27 (e.g. check their app store entry). You can also clear this list from your config in order to avoid incompatible apps from being enabled during future Server updates.

I would first uninstall all the incompatible and perhaps other unused apps.

Thanks for the advice, i ran app:disable files_reader in occ and now it works flawlessly again! Issue solved!