mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
13.98k stars 1.44k forks source link

Nextcloud installation: Cannot write into "config" directory #1885

Open ValdikSS opened 3 years ago

ValdikSS commented 3 years ago

When installer executes sudo -u www-data php /usr/local/lib/owncloud/occ db:add-missing-columns, Nextcloud's php process can't write its configuration file. This is freshly installed and fully updated Ubuntu 18.04.5.

Snippet running setup.sh with set -x:

…

++ hide_output wget -O /tmp/user_external.tgz https://github.com/nextcloud/user_external/releases/download/v1.0.0/user_external-1.0.0.tar.gz
+++ tempfile
++ OUTPUT=/tmp/filelldLyO
++ set +e
++ wget -O /tmp/user_external.tgz https://github.com/nextcloud/user_external/releases/download/v1.0.0/user_external-1.0.0.tar.gz
++ E=0
++ set -e
++ '[' 0 '!=' 0 ']'
++ rm -f /tmp/filelldLyO
++ echo '3bf2609061d7214e7f0f69dd8883e55c4ec8f50a  /tmp/user_external.tgz'
++ sha1sum --check --strict
++ tar -xf /tmp/user_external.tgz -C /usr/local/lib/owncloud/apps/
++ rm /tmp/user_external.tgz
++ chmod 750 /usr/local/lib/owncloud/apps /usr/local/lib/owncloud/config
++ ln -sf /home/user-data/owncloud/config.php /usr/local/lib/owncloud/config/config.php
++ chown -f -R www-data.www-data /home/user-data/owncloud /usr/local/lib/owncloud
++ /bin/true
++ '[' -e /home/user-data/owncloud/owncloud.db ']'
++ sudo -u www-data php /usr/local/lib/owncloud/occ db:add-missing-columns
Cannot write into "config" directory!
This can usually be fixed by giving the webserver write access to the config directory

Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
See https://docs.nextcloud.com/server/20/go.php?to=admin-config
++ '[' '!' -f /home/user-data/owncloud/owncloud.db ']'
++ mkdir -p /home/user-data/owncloud
+++ sha1sum

…
ValdikSS commented 3 years ago

Running this command manually later produces no error. Running php interpreter from www-data user also allows reading and writing of configuration file, as well as creating new files inside config folder.

ctapmex commented 3 years ago

confirm. This line https://github.com/mail-in-a-box/mailinabox/blob/879467d358d375c83225e57056569f305a1d969d/setup/nextcloud.sh#L188 is excess. migration, if needed, takes place at https://github.com/mail-in-a-box/mailinabox/blob/879467d358d375c83225e57056569f305a1d969d/setup/nextcloud.sh#L19

alento-group commented 3 years ago

`Installing Nextcloud (contacts/calendar)... Upgrading Nextcloud --- backing up existing installation, configuration, and database to directory to /home/user-data/owncloud-backup/2021-05-19-19:22:50...

Upgrading to Nextcloud version 20.0.1

Cannot write into "config" directory! This can usually be fixed by giving the webserver write access to the config directory

Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See https://docs.nextcloud.com/server/20/go.php?to=admin-config Nextcloud is already latest version photos 1.2.0 disabled dashboard 7.0.0 disabled activity 2.13.2 disabled Installing Z-Push (Exchange/ActiveSync server)... Installing Mail-in-a-Box system management daemon... `

So just copying the message shown ... it may be helpful to some /shrug.

I would think that we'd want to fix this as I am sure new users to MiaB would find it troubling perhaps??

davidjmeier commented 2 years ago

Just ran into this during an install for the first time. Is this something that the end user needs to go back and fix, or?

Thanks!

bluetardis commented 2 years ago

bump same issue 2022-04-20