mailinabox icon indicating copy to clipboard operation
mailinabox copied to clipboard

Nextcloud installation: Cannot write into "config" directory

Open ValdikSS opened this issue 4 years ago • 5 comments

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 avatar Dec 17 '20 20:12 ValdikSS

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.

ValdikSS avatar Dec 17 '20 21:12 ValdikSS

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

ctapmex avatar Jan 13 '21 06:01 ctapmex

`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??

alento-group avatar May 19 '21 18:05 alento-group

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!

davidjmeier avatar Feb 24 '22 16:02 davidjmeier

bump same issue 2022-04-20

bluetardis avatar Apr 20 '22 02:04 bluetardis