"Cannot write into "config" directory!" during upgrade

Nextcloud version: Installed about two weeks ago and this is my first upgrade. Cannot login at the moment to get the version
Operating system and version: Open Media Vault 5 (Debian)
Apache or nginx version nginx, but not sure which version
PHP version: 7.2, I think.

Hello all, I’m trying to upgrade via the command line, I am very new to this!

All goes well until i get to step 9 of this guide. I don’t think I have any 3rd party applications, so i skip down to step 11, but I’m not sure if I need this, or if I need to change it for my system.

If I ignore it and move on to 12 and 13, after entering sudo -u www-data php occ upgrade, I get this message:

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

That brings me back to looking at step 11!

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

Follow the steps I have listed above

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'trusted_proxies' => 
  array (
    0 => 'swag',
  ),
  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => 'https://blahblahblah.duckdns.org/nextcloud',
  'trusted_domains' => 
  array (
    0 => 'blah.duckdns.org',
  ),
  'instanceid' => 'ocl02uiwlvtt',
  'passwordsalt' => 'lots ofcharacters',
  'secret' => 'asecret',
  'dbtype' => 'mysql',
  'version' => '20.0.5.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextclouddb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_somebody',
  'dbpassword' => 'password',
  'installed' => true,
  'mail_domain' => 'domain.com',
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.domain.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'nextcloud@domain.com',
  'mail_smtppassword' => 'anotherpassword',
  'updater.secret' => 'anothersecret',
);

The output of your Apache/nginx/system log in /var/log/____:

Feb  6 01:10:18 omvpeR310 sshd[32524]: pam_unix(sshd:session): session closed for user root
Feb  6 01:11:33 omvpeR310 sshd[32648]: Accepted password for root from 192.168.1.211 port 62176 ssh2
Feb  6 01:11:33 omvpeR310 sshd[32648]: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb  6 01:15:01 omvpeR310 CRON[32734]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb  6 01:15:03 omvpeR310 CRON[32734]: pam_unix(cron:session): session closed for user root
Feb  6 01:17:01 omvpeR310 CRON[425]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb  6 01:17:02 oFeb  6 01:10:18 omvpeR310 sshd[32524]: Disconnected from user root 192.168.1.37 port 35070
mvpeR310 CRON[425]: pam_unix(cron:session): session closed for user root
Feb  6 01:23:36 omvpeR310 sshd[32648]: Received disconnect from 192.168.1.211 port 62176:11: disconnected by user
Feb  6 01:23:36 omvpeR310 sshd[32648]: Disconnected from user root 192.168.1.211 port 62176
Feb  6 01:23:36 omvpeR310 sshd[32648]: pam_unix(sshd:session): session closed for user root
Feb  6 01:27:34 omvpeR310 sshd[19226]: pam_unix(sshd:session): session closed for user root
Feb  6 01:28:00 omvpeR310 sshd[622]: Accepted password for root from 192.168.1.211 port 62253 ssh2
Feb  6 01:28:00 omvpeR310 sshd[622]: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb  6 01:29:04 omvpeR310 sshd[622]: pam_unix(sshd:session): session closed for user root
Feb  6 01:29:04 omvpeR310 sshd[643]: Accepted password for root from 192.168.1.211 port 62256 ssh2
Feb  6 01:29:04 omvpeR310 sshd[643]: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb  6 01:29:20 omvpeR310 sshd[669]: Accepted password for root from 192.168.1.211 port 62257 ssh2
Feb  6 01:29:20 omvpeR310 sshd[669]: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb  6 01:29:32 omvpeR310 sshd[669]: pam_unix(sshd:session): session closed for user root
Feb  6 01:29:32 omvpeR310 sshd[676]: Accepted password for root from 192.168.1.211 port 62260 ssh2
Feb  6 01:29:32 omvpeR310 sshd[676]: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb  6 01:30:01 omvpeR310 CRON[697]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb  6 01:30:03 omvpeR310 CRON[697]: pam_unix(cron:session): session closed for user root
Feb  6 01:30:33 omvpeR310 sshd[676]: pam_unix(sshd:session): session closed for user root
Feb  6 01:36:19 omvpeR310 sudo:     root : TTY=pts/0 ; PWD=/srv/dev-disk-by-uuid-234ddefe-df8d-4d5e-91f9-8b0375a0d13f/appdata/nextcloud/config/www/nextcloud ; USER=www-data ; COMMAND=/usr/bin/php occ upgrade
Feb  6 01:36:19 omvpeR310 sudo: pam_unix(sudo:session): session opened for user www-data by root(uid=0)
Feb  6 01:36:19 omvpeR310 sudo: pam_unix(sudo:session): session closed for user www-data
Feb  6 01:39:01 omvpeR310 CRON[1036]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb  6 01:39:01 omvpeR310 CRON[1036]: pam_unix(cron:session): session closed for user root
Feb  6 01:45:01 omvpeR310 CRON[1248]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb  6 01:45:04 omvpeR310 CRON[1248]: pam_unix(cron:session): session closed for user root
Feb  6 02:00:01 omvpeR310 CRON[1606]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb  6 02:00:03 omvpeR310 CRON[1606]: pam_unix(cron:session): session closed for user root
Feb  6 02:00:31 omvpeR310 sshd[643]: pam_unix(sshd:session): session closed for user root
Feb  6 02:01:33 omvpeR310 sshd[13528]: pam_unix(sshd:session): session closed for user root
Feb  6 02:02:02 omvpeR310 sshd[1760]: Accepted password for root from 192.168.1.211 port 62415 ssh2
Feb  6 02:02:02 omvpeR310 sshd[1760]: pam_unix(sshd:session): session opened for user root by (uid=0)
Feb  6 02:03:17 omvpeR310 sshd[1781]: Accepted password for root from 192.168.1.211 port 62427 ssh2
Feb  6 02:03:17 omvpeR310 sshd[1781]: pam_unix(sshd:session): session opened for user root by (uid=0)

Above is the last lines of a big file! I hope this is enough info. Sorry, but, like I say - I’m new!

Thanks,
Nick.

There are permission issues with the config folder, could you show them to us?

ls -lisa /path/to/nextcloud/config

No problem and thank you for helping me:

root@omvpeR310:/srv/dev-disk-by-uuid-234ddefe-df8d-4d5e-91f9-8b0375a0d13f/appdata/nextcloud# ls -lisa
total 16
2490372 4 drwxr-xr-x 4 root    root  4096 Jan 20 00:57 .
2490369 4 drwxr-xr-x 5 root    root  4096 Feb  6 00:53 ..
2490373 4 drwxr-xr-x 9 docker1 users 4096 Jan 19 23:09 config
2490374 4 drwxrwx--- 7 docker1 users 4096 Jan 29 21:55 data

oh it’s something with docker, then the www-data user is probably not working. I moved and tagged for the docker experts.

OK, many thanks!

OK, this has been resolved by somebody over on the Open Media Vault Forum, this post onwards should help but you might need to go one page back in the thread. I hope this helps someone.

It turned out that you cannot use the manual upgrade that I was following to upgrade a docker installation of Nextcloud. You live and learn.