Nextcloud version: 19.01
Operating system and version:
Ubuntu 20.04
Apache or nginx version:
nginx 1.18.0
PHP version:
7.4.9
The issue you are facing:
I am unable to add local external storage
Is this the first time you’ve seen this error?
yes
Steps to replicate it:
- fresh install using this ansible playbook: https://github.com/ReinerNippes/nextcloud/tree/nextcloud-reloaded
- attempt to add external storage
- error
The output of your Nextcloud log in Admin > Logging:
[no app in context] Info: External storage not available: stat() failed
PUT /apps/files_external/globalstorages/2
from 192.168.1.1 by admin at 2020-08-18T15:11:23+00:00
{"reqId":"oDE2tn6eR9GT1Gdus5oI","level":1,"time":"2020-08-18T15:11:23+00:00","remoteAddr":"192.168.1.1","user":"admin","app":"no app in context","method":"PUT","url":"/apps/files_external/globalstorages/2","message":"External storage not available: stat() failed","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0","version":"19.0.1.1","id":"5f3bef9e6a78d"}
[PHP] Error: stat(): stat failed for /media/aslan/work/ at /var/www/nextcloud/lib/private/Files/Storage/Local.php#145
PUT /apps/files_external/globalstorages/2
from 192.168.1.1 by admin at 2020-08-18T15:11:23+00:00
{"reqId":"oDE2tn6eR9GT1Gdus5oI","level":1,"time":"2020-08-18T15:11:23+00:00","remoteAddr":"192.168.1.1","user":"admin","app":"no app in context","method":"PUT","url":"/apps/files_external/globalstorages/2","message":"External storage not available: stat() failed","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0","version":"19.0.1.1","id":"5f3bef9e6a78d"}
These two logs basically repeat about 7 times. I’ve included both the formatted and raw versions.
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'passwordsalt' => '{REDACTED}',
'secret' => '{REDACTED}',
'trusted_domains' =>
array (
0 => 'cloud.aslanfrench.work',
),
'datadirectory' => '/var/nc-data',
'dbtype' => 'pgsql',
'version' => '19.0.1.1',
'overwrite.cli.url' => 'https://cloud.aslanfrench.work',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'nextcloud',
'dbpassword' => '{REDACTED}',
'installed' => true,
'instanceid' => 'occ902x1gtuw',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0,
'password' => '{REDACTED}',
),
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => true,
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\PNG',
1 => 'OC\\Preview\\JPEG',
2 => 'OC\\Preview\\GIF',
3 => 'OC\\Preview\\BMP',
4 => 'OC\\Preview\\XBitmap',
5 => 'OC\\Preview\\MarkDown',
6 => 'OC\\Preview\\MP3',
7 => 'OC\\Preview\\TXT',
8 => 'OC\\Preview\\Illustrator',
9 => 'OC\\Preview\\Movie',
10 => 'OC\\Preview\\MSOffice2003',
11 => 'OC\\Preview\\MSOffice2007',
12 => 'OC\\Preview\\MSOfficeDoc',
13 => 'OC\\Preview\\OpenDocument',
14 => 'OC\\Preview\\PDF',
15 => 'OC\\Preview\\Photoshop',
16 => 'OC\\Preview\\Postscript',
17 => 'OC\\Preview\\StarOffice',
18 => 'OC\\Preview\\SVG',
19 => 'OC\\Preview\\TIFF',
20 => 'OC\\Preview\\Font',
),
'preview_max_x' => 1024,
'preview_max_y' => 768,
'preview_max_scale_facto' => 1,
'auth.bruteforce.protection.enabled' => true,
'trashbin_retention_obligation' => 'auto,7',
'skeletondirectory' => '',
'defaultapp' => 'file',
'activity_expire_days' => 14,
'integrity.check.disabled' => false,
'updater.release.channel' => 'stable',
'loglevel' => 1,
'maintenance' => false,
'theme' => '',
);
The output of your Apache/nginx/system log in /var/log/____
:
Nextcloud error log:
2020/08/17 00:06:24 [error] 1958#1958: *36818 access forbidden by rule, client: 202.142.81.87, server: cloud.aslanfrench.work, request: "GET /.env HTTP/1.1", host: "136.49.174.165", referrer: "https://136.49.174.165/"
2020/08/17 02:59:16 [error] 1958#1958: *37188 access forbidden by rule, client: 13.125.118.177, server: cloud.aslanfrench.work, request: "GET /.git/HEAD HTTP/1.1", host: "wiki.jackalope.tech"
2020/08/17 03:34:50 [error] 1958#1958: *37202 access forbidden by rule, client: 202.142.81.87, server: cloud.aslanfrench.work, request: "GET /.git/config HTTP/1.1", host: "136.49.174.165", referrer: "https://136.49.174.165/"
2020/08/17 03:34:52 [error] 1958#1958: *37204 access forbidden by rule, client: 202.142.81.87, server: cloud.aslanfrench.work, request: "GET /.git/HEAD HTTP/1.1", host: "136.49.174.165", referrer: "https://136.49.174.165/"
2020/08/17 04:08:01 [error] 1958#1958: *37227 access forbidden by rule, client: 202.142.81.87, server: cloud.aslanfrench.work, request: "GET /.env HTTP/1.1", host: "136.49.174.165", referrer: "https://136.49.174.165/"
2020/08/17 10:41:16 [error] 1958#1958: *39031 access forbidden by rule, client: 13.52.97.239, server: cloud.aslanfrench.work, request: "GET /.git/HEAD HTTP/1.1", host: "wiki.jackalope.tech"
2020/08/17 16:00:24 [warn] 1958#1958: *47492 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/7/01/0000000017 while reading upstream, client: 192.168.1.1, server: cloud.aslanfrench.work, request: "GET /remote.php/dav/files/aslan/InstantUpload/Slack/IMG_20200817_155920.jpg HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "cloud.aslanfrench.work"
2020/08/17 17:14:41 [crit] 1958#1958: *51253 SSL_do_handshake() failed (SSL: error:1408F0C6:SSL routines:ssl3_get_record:packet length too long) while SSL handshaking, client: 68.183.188.21, server: 0.0.0.0:443
2020/08/17 18:11:14 [warn] 1958#1958: *52602 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/8/01/0000000018 while reading upstream, client: 192.168.1.1, server: cloud.aslanfrench.work, request: "GET /remote.php/webdav/InstantUpload/Slack/IMG_20200817_155920.jpg HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "cloud.aslanfrench.work"
nginx error log sample:
2020/07/29 04:55:42 [error] 100872#100872: *415 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"
2020/07/29 05:02:57 [error] 100872#100872: *426 open() "/usr/share/nginx/html/nextcloud" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "localhost"
Further Info
When I first tried to add local external storage I received an error in the web ui that said:
smbclient" is not installed. Mounting of "SMB / CIFS", "SMB / CIFS using OC login" is not possible. Please ask your system administrator to install it. nextcloud
I googled this and people were saying this was because smbclient needed to be installed. I installed it and restarted the server. This did not fix the issue. Other people in that thread also said that php-smbclient needed to be installed too so I tried installing that and restarting the server. The problem persisted after restarting the server.
The external storage that I am trying to mount is an HDD that automatically mounted under /media/{username}
.
The server I’m installing on is a desktop computer that I’ve been running Nextcloud off for the past 2 years. I was running 18.04 but after running into some clunky system issues I decided to do a fresh reinstall of the system. I did a fresh install of Ubuntu 20 and ran the latest version of the Reiner Nippes ansible playbook (branch nextcloud-reloaded). Everything went fairly smoothly until I recently decided to hook back up the external storage and ran into this problem.