Nextcloud version 13.0.1
Operating system and version: NextCloudPi v0.53.27, Debian 9.4 on a Raspberry Pi 3b
Apache or nginx version: Apache 2.4.25 (Raspbian)
PHP version: 7.0.27-0+deb9u1
Hello all,
I have installed a 2nd drive (HDD) to backup onto. I made the following steps so far:
1.) putting NC into maintenance mode
2.) unmounting /dev/sda1 (mounted at /media/myCloudDrive), RAID 1 hardware controlled
3.) unplugging the RAID
4.) plugging in the backup HDD
5.) using nc-format-USB to properly format the backup HDD (RAID was unplugged, of course)
6.) plugging the RAID back in
7.) setting up nc-automount
8.) did a reboot
9.) $lsblk showed that my NC RAID was now /dev/sdb1, but properly mounted to /media/myCloudDrive. Backup drive is /dev/sda1 now mounted under /media/myCloudBACKUP
10.) $sudo -u www-data /var/www/nextcloud/occ maintenance:mode --off returned the following error:
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 webserver write access to the root directory. See https://docs.nextcloud.com/server/13/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:148 Stack trace: #0 /var/www/nextcloud/console.php(89): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...') #2 {main}<
A $sudo ls -la /media/myCloudDrive/ncdata returns
-rw-r--r-- 1 www-data www-data 0 Mar 18 22:48 .ocdata
What went wrong here? Any help is appreciated!
Is this the first time you’ve seen this error? Yes
EDIT: That’s funny. As soon as I umount /dev/sdb1 (which is the backup drive), everything goes back to normal operation! As soon as I re-mount it, the above error occurs. I have now tried to mount the cloud drive to /dev/sda and the backup drive to /dev/sdb by rebooting and then hotplugging the backup drive. Succeeded. But here’s what happens when I run nc-backup:
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:148
Stack trace:
#0 /var/www/nextcloud/console.php(89): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once(’/var/www/nextcl…’)
#2 {main}PHP Warning: fileperms(): stat failed for /media/USBdrive/ncdata/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 136
{“reqId”:“7B1BeZ0aEVZ9oMnnO8fT”,“level”:3,“time”:“2018-04-14T14:39:34+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“fileperms(): stat failed for /media/USBdrive/ncdata/nextcloud.log at /var/www/nextcloud/lib/private/Log/File.php#136”,“userAgent”:"–",“version”:“13.0.1.1”}
{“reqId”:“7B1BeZ0aEVZ9oMnnO8fT”,“level”:3,“time”:“2018-04-14T14:39:34+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“chmod(): No such file or directory at /var/www/nextcloud/lib/private/Log/File.php#137”,“userAgent”:"–",“version”:“13.0.1.1”}