Nextcloud version: 20.0.6
Operating system and version: Debian Buster
nginx version: 1.18.0
for proxy, NC runs dockerized with most current version
PHP version: 7.4.14
The issue you are facing:
When creating a new link share from any user, the share cant be accessed. Nextcloud fails, with an “Internal Server Error” message.
Is this the first time you’ve seen this error?: No, I have had this issue for a while now, persisting across multiple minor versions, I am not sure however if I have had the issue with Nextcloud 19 as well
Steps to replicate it:
- Create a link share of any file with any user
- Send the link to the person you want to share the file with or open it with another browser/private tab
- You are greeted with the Error screen shown above
The output of my Nextcloud log in Admin > Logging:
[index] Error: Exception: Call to a member function getPath() on null at <<closure>>
0. /var/www/html/lib/private/AppFramework/App.php line 152
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Sharin ... {}, "showShare")
1. /var/www/html/lib/private/Route/Router.php line 309
OC\AppFramework\App::main("OCA\\Files_Shar ... r", "showShare", OC\AppFramework\ ... {}, {token: "aQpPgND ... "})
2. /var/www/html/lib/base.php line 1008
OC\Route\Router->match("/s/aQpPgND8BTxMMRP")
3. /var/www/html/index.php line 37
OC::handleRequest()
GET /s/aQpPgND8BTxMMRP
from 172.27.0.1 at 2021-02-05T11:22:35+00:00
Details:
{
"reqId": "pfrOWZNutwyb55nVGizK",
"level": 3,
"time": "2021-02-05T11:22:35+00:00",
"remoteAddr": "172.27.0.1",
"user": "--",
"app": "index",
"method": "GET",
"url": "/s/aQpPgND8BTxMMRP",
"message": {
"Exception": "Exception",
"Message": "Call to a member function getPath() on null",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 152,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareController"
},
"showShare"
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 309,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Files_Sharing\\Controller\\ShareController",
"showShare",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"token": "aQpPgND8BTxMMRP",
"_route": "files_sharing.Share.showShare"
}
]
},
{
"file": "/var/www/html/lib/base.php",
"line": 1008,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/s/aQpPgND8BTxMMRP"
]
},
{
"file": "/var/www/html/index.php",
"line": 37,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"Line": 110,
"Previous": {
"Exception": "Error",
"Message": "Call to a member function getPath() on null",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/private/Encryption/Update.php",
"line": 105,
"function": "getPath",
"class": "OC\\Files\\Filesystem",
"type": "::",
"args": [
345305
]
},
{
"file": "/var/www/html/lib/private/Encryption/HookManager.php",
"line": 39,
"function": "postUnshared",
"class": "OC\\Encryption\\Update",
"type": "->",
"args": [
{
"id": "62",
"itemType": "folder",
"itemSource": 345305,
"shareType": 3,
"shareWith": "",
"itemparent": null,
"uidOwner": "Till",
"fileSource": 345305,
"fileTarget": "/Bunte Butze",
"deletedShares": [
{
"id": "62",
"itemType": "folder",
"itemSource": 345305,
"shareType": 3,
"shareWith": "",
"itemparent": null,
"uidOwner": "Till",
"fileSource": 345305,
"fileTarget": "/Bunte Butze"
}
]
}
]
},
{
"file": "/var/www/html/lib/private/legacy/OC_Hook.php",
"line": 110,
"function": "postUnshared",
"class": "OC\\Encryption\\HookManager",
"type": "::",
"args": [
{
"id": "62",
"itemType": "folder",
"itemSource": 345305,
"shareType": 3,
"shareWith": "",
"itemparent": null,
"uidOwner": "Till",
"fileSource": 345305,
"fileTarget": "/Bunte Butze",
"deletedShares": [
{
"id": "62",
"itemType": "folder",
"itemSource": 345305,
"shareType": 3,
"shareWith": "",
"itemparent": null,
"uidOwner": "Till",
"fileSource": 345305,
"fileTarget": "/Bunte Butze"
}
]
}
]
},
{
"file": "/var/www/html/lib/private/Share20/LegacyHooks.php",
"line": 85,
"function": "emit",
"class": "OC_Hook",
"type": "::",
"args": [
"OCP\\Share",
"post_unshare",
{
"id": "62",
"itemType": "folder",
"itemSource": 345305,
"shareType": 3,
"shareWith": "",
"itemparent": null,
"uidOwner": "Till",
"fileSource": 345305,
"fileTarget": "/Bunte Butze",
"deletedShares": [
{
"id": "62",
"itemType": "folder",
"itemSource": 345305,
"shareType": 3,
"shareWith": "",
"itemparent": null,
"uidOwner": "Till",
"fileSource": 345305,
"fileTarget": "/Bunte Butze"
}
]
}
]
},
{
"file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 264,
"function": "postUnshare",
"class": "OC\\Share20\\LegacyHooks",
"type": "->",
"args": [
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
},
"OCP\\Share::postUnshare",
{
"__class__": "Symfony\\Component\\EventDispatcher\\EventDispatcher"
}
]
},
{
"file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 239,
"function": "doDispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
},
{
"__class__": "Closure"
}
],
"OCP\\Share::postUnshare",
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
}
]
},
{
"file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 73,
"function": "callListeners",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
},
{
"__class__": "Closure"
}
],
"OCP\\Share::postUnshare",
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
}
]
},
{
"file": "/var/www/html/lib/private/EventDispatcher/SymfonyAdapter.php",
"line": 85,
"function": "dispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
},
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
}
]
},
{
"file": "/var/www/html/lib/private/Share20/Manager.php",
"line": 1175,
"function": "dispatch",
"class": "OC\\EventDispatcher\\SymfonyAdapter",
"type": "->",
"args": [
"OCP\\Share::postUnshare",
{
"__class__": "Symfony\\Component\\EventDispatcher\\GenericEvent"
}
]
},
{
"file": "/var/www/html/lib/private/Share20/Manager.php",
"line": 1482,
"function": "deleteShare",
"class": "OC\\Share20\\Manager",
"type": "->",
"args": [
{
"__class__": "OC\\Share20\\Share"
}
]
},
{
"file": "/var/www/html/lib/private/Share20/Manager.php",
"line": 1467,
"function": "checkExpireDate",
"class": "OC\\Share20\\Manager",
"type": "->",
"args": [
{
"__class__": "OC\\Share20\\Share"
}
]
},
{
"file": "/var/www/html/apps/files_sharing/lib/Controller/ShareController.php",
"line": 218,
"function": "getShareByToken",
"class": "OC\\Share20\\Manager",
"type": "->",
"args": [
"aQpPgND8BTxMMRP"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php",
"line": 70,
"function": "isValidToken",
"class": "OCA\\Files_Sharing\\Controller\\ShareController",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
"line": 98,
"function": "beforeController",
"class": "OC\\AppFramework\\Middleware\\PublicShare\\PublicShareMiddleware",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareController"
},
"showShare"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 98,
"function": "beforeController",
"class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareController"
},
"showShare"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 152,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareController"
},
"showShare"
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 309,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Files_Sharing\\Controller\\ShareController",
"showShare",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"token": "aQpPgND8BTxMMRP",
"_route": "files_sharing.Share.showShare"
}
]
},
{
"file": "/var/www/html/lib/base.php",
"line": 1008,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/s/aQpPgND8BTxMMRP"
]
},
{
"file": "/var/www/html/index.php",
"line": 37,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/var/www/html/lib/private/Files/Filesystem.php",
"Line": 901
},
"CustomMessage": "--"
},
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0",
"version": "20.0.6.1",
"id": "601d3010063ef"
}
The output of my config.php file in /path/to/nextcloud
:
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'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,
),
),
'instanceid' => 'xxxxxxxxxxxx',
'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'trusted_proxies' =>
array (
0 => '172.21.0.1',
),
'trusted_domains' =>
array (
0 => 'cloud.llit.eu',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '20.0.6.1',
'overwrite.cli.url' => 'https://cloud.llit.eu',
'overwriteprotocol' => 'https',
'dbname' => 'xxxxxxxx',
'dbhost' => 'xxxxxxx',
'dbport' => 'xxxx',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'xxxxxxxxxxxx',
'dbpassword' => 'xxxxxxxxxxxxxxxxxxxxxx',
'installed' => true,
'maintenance' => false,
'theme' => '',
'loglevel' => 0,
'mail_smtpmode' => 'smtp',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_sendmailmode' => 'smtp',
'mail_smtpsecure' => 'tls',
'mail_from_address' => 'xxxxxxxxx',
'mail_domain' => 'xxxxxxxxxxxxxxxxx',
'mail_smtphost' => 'xxxxxxxxxxxx',
'mail_smtpport' => '25',
'mail_smtpname' => 'xxxxxxxxxxxxxxxxx',
'mail_smtppassword' => 'xxxxxxxxxxxxxxxxxxxxxx',
'app_install_overwrite' =>
array (
0 => 'twofactor_yubikey',
1 => 'keeweb',
2 => 'contacts',
),
'encryption.legacy_format_support' => false,
'encryption.key_storage_migrated' => false,
);
The output of my Apache/nginx/system log:
nginx proxy:
2021/02/05 12:21:13 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/24/0000007248 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /core/js/dist/main.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/core/js/dist/main.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:21:13 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/9/24/0000007249 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /core/js/dist/files_client.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/core/js/dist/files_client.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:21:13 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/0/25/0000007250 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /apps/notifications/js/notifications-main.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/apps/notifications/js/notifications-main.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:21:13 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/1/25/0000007251 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /apps/recommendations/js/main.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/apps/recommendations/js/main.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:21:14 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/2/25/0000007252 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /apps/text/js/files.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/apps/text/js/files.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:21:14 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/3/25/0000007253 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /apps/files/js/dist/sidebar.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/apps/files/js/dist/sidebar.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:21:14 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/4/25/0000007254 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /apps/files_sharing/js/dist/files_sharing_tab.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/apps/files_sharing/js/dist/files_sharing_tab.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:21:14 [warn] 3148#3148: *7745268 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/5/25/0000007255 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /apps/viewer/js/viewer-main.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/apps/viewer/js/viewer-main.js?v=5877aae2-7", host: "cloud.llit.eu"
2021/02/05 12:22:36 [warn] 3148#3148: *7747097 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/6/25/0000007256 while reading upstream, client: 2001:16b8:5013:3900:e5e5:596a:aab6:3f21, server: cloud.llit.eu, request: "GET /core/js/dist/main.js?v=5877aae2-7 HTTP/2.0", upstream: "http://172.27.0.2:80/core/js/dist/main.js?v=5877aae2-7", host: "cloud.llit.eu"
docker logs:
app_1 | 172.27.0.1 - - [05/Feb/2021:12:30:20 +0000] "POST /ocs/v2.php/apps/files_sharing/api/v1/shares HTTP/1.0" 200 1225 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:30:21 +0000] "GET /svg/core/actions/checkmark?color=46ba61&v=1 HTTP/1.0" 200 972 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:30:26 +0000] "GET /svg/core/actions/star-dark?color=fc0&v=1 HTTP/1.0" 200 996 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:30:32 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.0" 304 249 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 127.0.0.1 - - [05/Feb/2021:12:31:34 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.38 (Debian) PHP/7.4.14 (internal dummy connection)"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:35 +0000] "GET /s/xwN5Q2wqiAmDcJZ HTTP/1.0" 500 4806 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /core/js/dist/files_fileinfo.js?v=5877aae2-7 HTTP/1.0" 200 9168 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /apps/files_sharing/js/dist/main.js?v=5877aae2-7 HTTP/1.0" 200 1150 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /apps/encryption/js/encryption.js?v=5877aae2-7 HTTP/1.0" 200 1073 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /apps/files_videoplayer/js/main.js?v=5877aae2-7 HTTP/1.0" 200 3507 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /core/css/guest.css?v=5877aae2-7 HTTP/1.0" 200 6073 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /apps/files_pdfviewer/js/files_pdfviewer-public.js?v=5877aae2-7 HTTP/1.0" 200 8166 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /core/js/dist/files_client.js?v=5877aae2-7 HTTP/1.0" 200 41578 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /core/js/dist/main.js?v=5877aae2-7 HTTP/1.0" 200 440914 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /apps/accessibility/css/user-a82fd95db10ff25dfad39f07372ebe37 HTTP/1.0" 200 4796 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /js/core/merged-template-prepend.js?v=5877aae2-7 HTTP/1.0" 200 3898 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /core/img/background.png?v=2 HTTP/1.0" 200 10085 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:36 +0000] "GET /core/img/logo/logo.svg?v=1 HTTP/1.0" 200 820 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:37 +0000] "GET /core/img/favicon-touch.png HTTP/1.0" 200 3381 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"
app_1 | 172.27.0.1 - - [05/Feb/2021:12:31:37 +0000] "GET /core/img/favicon.ico HTTP/1.0" 200 3740 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0"