I uploaded some stuff earlier today and after that it crashed again. It seems like it looses the connection to my USB drive for some reason?
NextcloudPi diagnostics
{"reqId":"IZo9sADOjL83f7GW00jk","level":2,"time":"2023-05-13T22:31:44+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /media/myCloudDrive/ncdata/data/tmp is not present or writable","userAgent":"--","version":"25.0.3.2","data":[]}
NextcloudPi version v1.52.0
NextcloudPi image NextCloudPi_RaspberryPi_v1.51.0.img
OS Debian GNU/Linux 11. 6.1.21-v8+ (aarch64)
automount yes
USB devices none
datadir /media/myCloudDrive/ncdata/data (doesn't exist)
rootfs usage 3.2G/29G
swapfile /var/swap
dbdir /var/lib/mysql
Nextcloud check error
HTTPD service up
PHP service up
MariaDB service up
Redis service up
HPB service down
Postfix service up
Internet check ok
Public IPv4 ***REMOVED SENSITIVE VALUE***
Public IPv6 ***REMOVED SENSITIVE VALUE***
Port 80 open
Port 443 open
IP ***REMOVED SENSITIVE VALUE***
Gateway ***REMOVED SENSITIVE VALUE***
Interface eth0
Certificates ***REMOVED SENSITIVE VALUE***
NAT loopback no
Uptime 2days
Nextcloud configuration
{"reqId":"jvsD7WiPT2RchWnxw3pg","level":2,"time":"2023-05-13T22:31:48+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /media/myCloudDrive/ncdata/data/tmp is not present or writable","userAgent":"--","version":"25.0.3.2","data":[]}
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.
Cannot create "data" directory.
This can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/25/go.php?to=admin-dir_permissions
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(11): require_once('...')
#2 {main}
HTTPd logs
[Sat May 13 00:00:00.935943 2023] [ssl:warn] [pid 900:tid 548542497856] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sat May 13 00:00:00.938466 2023] [mpm_event:notice] [pid 900:tid 548542497856] AH00489: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Sat May 13 00:00:00.938503 2023] [core:notice] [pid 900:tid 548542497856] AH00094: Command line: '/usr/sbin/apache2'
Database logs
tail: cannot open '/var/log/mysql/*.log' for reading: No such file or directory
Nextcloud logs
tail: cannot open '/media/myCloudDrive/ncdata/data/nextcloud.log' for reading: No such file or directory
Looks like the drive is not mounting correctly, maybe the drive or it’s power source are starting to fail.
I’d would likely try to mount it my (Linux) PC to investigate.
Reading this also makes me realize, that you might want to check the power supply of your Pi. Is it powered by the needed voltage? Not enough and it might just kick your USB drive out of the loop for a moment.
I myself do that from time to time, out of bad habit, and just throw an old and skimpy smartphone charger at my Pi, which is not smart of me.
Its a brand new drive.
Can there be some sort of power save on the drive?
I tried to unplug and replug the drive last time but nextcloud didnt find the files.
Is there some command I can use to try to re mount the drive?
It also only happens after I upload new files
Den sön 14 maj 2023 09:50Oliver_Van via Nextcloud community <noreply@nextcloud.com> skrev:
Yesterday I uploaded som more date and after some time teh server crashed again with teh same error.
The command sudo df -hT gave me the following result:
I would look at the system logs in /var/log just after the event.
-rw-r----- 1 root adm 2,1M May 17 10:34 syslog
-rw-r----- 1 root adm 1,5M May 17 10:34 messages
-rw-r----- 1 root adm 1,5M May 17 10:34 kern.log
I guess its better to do this after a crash but now when everything is fine i found one error message:
Transfer event TRB DMA ptr not part of current TD ep_index 3 comp_code 1
I am a little out of my depth here.
At the same time, I probably would try to add the mount permanently in the fstab file, because for now, it isn’t.
It is more important however to find out why automount is failing, rather then changing the method of mounting the drive. Have you tried checking the connections and changing the cable?
Automount should work fine, unless you want more control over drive mounting or need to add more then one drive.
It is a brand new 14TB drive so I dont think I will need to add more storage for a while
Bu I have tried with another smaller drive before and got the same trouble then as well. Also tried 3 different Pi. The only thing I havent tried is just juse a big sd card as storage but that is not enough storage so thats no use.
As mentioned earlier, I would look at these logs for clues. If you share the content of them via pastebin or similar, others can have a look too.
I would also try another cable. A new drive with a modern usb3 cable/plug, might not work as one expects, on an older pi with usb2 ports. I have stopped using rpi’s for server purposes completely, they were fun for learning and playing around with.