Apparently the NCP is unable to get the right data-directory (I moved it to a USB stick using nc-datadir), where its working without a problem.
pi@nextcloudpi:/ $ sudo du -shc /media/*
7.0G /media/myCloudUSB
0 /media/USBdrive
7.0G total
The error message is the same if I use the following command that I found here:
pi@nextcloudpi:/ $ sudo -u www-data /var/www/nextcloud/occ config:system:get datadirectory
sudo: /var/www/nextcloud/occ: command not found
The same error appears if I activate fail2ban, but here NCP still manages to activate fail2ban:
udo: /var/www/nextcloud/occ: command not found
System config value loglevel set to string 2
System config value log_type set to string file
fail2ban enabled
Anybody knows why I’m getting this error? Is there an easy fix for it?
So put a sudo at first position. In Linux you always need sudo if you want to chown or chmod.
Explanation for you, cause you said, you are new to linux: chmod: Change Mode. So you give a file, Folder, whatever permissions. If you do a +x you make the file executable. That worked for me. So, do sudo chmod +x occ if it still don´t work, give us please the output from ls -al (in /var/www/nextcloud)
That seems to work! Thank you for the explanation!
pi@nextcloudpi:~ $ sudo chmod +x /var/www/nextcloud/occ
pi@nextcloudpi:~ $ /var/www/nextcloud/occ
-bash: /var/www/nextcloud/occ: Permission denied
pi@nextcloudpi:~ $ sudo /var/www/nextcloud/occ
Console has to be executed with the user that owns the file config/config.php
Current user: root
Owner of config.php: www-data
Try adding 'sudo -u www-data ' to the beginning of the command (without the single quotes)
pi@nextcloudpi:~ $ sudo -u www-data /var/www/nextcloud/occ config:system:get datadirectory
/media/myCloudUSB/ncdata
I don’t know… After first experiencing this error I used nc-backup, flashed NextCloudPi_11-12-17.img on the SD-card (the newer version didn’t allow me to connect to NextcloudpiPanel through SSH), used nc-update and nc-restore but still had the same error…
@nacho,
I am having the same issue. Have not worried about it as I am planning on updating my Board shortly. I will try to change permissions on occ tomorrow.
My only theory is that a update to NCP or an apt-get update/apt-get upgrade changed something. Those are the only two tasks I perform on my NCP box.
In fact, I upgraded to 12.0.4 through the Nextcloud-settings manually prior to ncp-backup (when I was scrolling through all the settings to get to know Nextcloud). I this not recommended? I was unaware of this and didn’t think that this was also being backed-up and restored…
Thanks for the info! Maybe there should be a warning somewhere… Maybe some info/warnings could be integrated in the wizard (for beginners like me)?