Upgrade cannot create backup in Samba Datadirectory

Nextcloud version (eg, 20.0.5): 22.0.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.4): 7.4.3

The issue you are facing:

When running the updater, either using WebGUI or commandline, I get stuck at “Create backup”.
My datadirectory is located on a external fileserver and is mounted to the the Nextcloud server at /mnt/nextcloud . www-data:www-data is the owner of that folder and I have no issues reading/wrighting files to it from within nextcloud.
The share is mounted to that folder in fstab with

When running the updater it gets stuck at Creating Backup with the following errormessage:

Could not copy "/var/www/nextcloud/config/config.php.backup" to "/mnt/nextcloud/data/updater-oc8yxc9l94g1/backups/nextcloud-".

Source /var/www/nextcloud/config/config.php.backup is not readable.

Destination /mnt/nextcloud/data/updater-oc8yxc9l94g1/backups/nextcloud- is not writable

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Setup Nextcloud with the datadirectory located in a folder mounted as SMB storage
  2. Run updater in commandline or web-gui

The output of your Nextcloud log in Admin > Logging:

No log entries was created as a result of this.

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

$CONFIG = array (
  'passwordsalt' => '<REDACTED>',
  'secret' => '<REDACTED>',
  'trusted_domains' =>
  array (
    0 => '<REDACTED>',
    1 => '<REDACTED>',
    2 => '<REDACTED>',
  'trusted_proxies' =>
  array (
    0 => '<REDACTED>',
    1 => '<REDACTED>',
  'datadirectory' => '/mnt/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '<REDACTED>',
  'skeletondirectory' => '',
  'defaultapp' => 'files',
  'default_phone_region' => '<REDACTED>',
  'overwritehost' => '<REDACTED>',
  'overwriteprotocol' => 'https',
  'dbname' => '<REDACTED>',
  'dbhost' => '<REDACTED>',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '<REDACTED>',
  'dbpassword' => '<REDACTED>',
  'installed' => true,
  'mail_from_address' => '<REDACTED>',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '<REDACTED>',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '<REDACTED>',
  'mail_smtpport' => '<REDACTED>',
  'mail_smtpname' => '<REDACTED>',
  'mail_smtppassword' => '<REDACTED>',
  'mail_smtpsecure' => 'ssl',
  'instanceid' => '<REDACTED>',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'maintenance' => false,
  'updater.secret' => '<REDACTED>',

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

Please post:

 ls -l /var/www/nextcloud/config/config.php.backup
ls -l /mnt/nextcloud/data/updater-oc8yxc9l94g1/backups/nextcloud-

(only the dir config itself)

Please post additional your update command you used including username.

Thank you for responding.
This is the output of the commands above. Please note that I needed to run the second command with sudo to get output if that may have anything to do with it. Probably because only www-data has access to the datafolder.

-rw-r----- 1 root root 576 Jul 14 16:37 /var/www/nextcloud/config/config.php.backup
total 64
-rwxrwx--- 1 www-data www-data     0 Oct 30 13:41 CAN_INSTALL
-rwxrwx--- 1 www-data www-data 59645 Oct 30 13:41 config.sample.php

I was running the following command from the docs from my admin account.

sudo -u www-data php /var/www/nextcloud/updater/updater.phar

The owner of first link is root:root and must changed for dirs and files with chown to www-data:www-data . Search the web.

1 Like