Updater fails with Could not rmdir: /var/www/html/nextcloud/updater/...3rdparty

Nextcloud version (eg, 20.0.5): 27.0.0
Operating system and version (eg, Ubuntu 20.04): Rocky Linux 9.2 (Blue Onyx)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.53
PHP version (eg, 7.4): 8.2.8

The issue you are facing:

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

Steps to replicate it:

  1. Have run this on and identical installation (different data)
  2. Execute sudo -u apache php --define apc.enable_cli=1 updater/updater.phar --no-interaction -vvv
  3. Fails with:

Nextcloud Updater - version: v26.0.0beta2-9-g64e2e4c dirty

Current version is 27.0.0.

Update to Nextcloud 27.1.0 available. (channel: “stable”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-27.1.0.zip
Open changelog :arrow_upper_right:

Updater run in non-interactive mode.

Start update

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[:heavy_check_mark:] Check for expected files
[:heavy_check_mark:] Check for write permissions
[:heavy_check_mark:] Create backup
[:heavy_check_mark:] Downloading
[:heavy_check_mark:] Verify integrity
[:heavy_check_mark:] Extracting
[:heavy_check_mark:] Enable maintenance mode
[:heavy_check_mark:] Replace entry points
[ ] Delete old files …PHP Warning: rmdir(/var/www/html/nextcloud/updater/…/3rdparty): Permission denied in phar:///var/www/html/nextcloud/updater/updater.phar/lib/Updater.php on line 887
[✘] Delete old files failed
Could not rmdir: /var/www/html/nextcloud/updater/…/3rdparty

Update failed. To resume or retry just execute the updater again.

The output of your Nextcloud log in Admin > Logging:

Nextcloud not accessible to access Admin Log

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

<?php
$CONFIG = array (
  'passwordsalt' => 'XXXXXXXXXXXXXXXXXS',
  'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'www.youngforever.com.au',
    2 => 'nextcloud.youngforever.com.au',
    3 => 'nextcloud.youngforever.au',
    4 => '192.168.5.2',
  ),
  'datadirectory' => '/data/youngdata',
  'dbtype' => 'mysql',
  'version' => '27.0.0.8',
  'overwrite.cli.url' => 'http://nextcloud.youngforever.com.au',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => 'xxxxxxxxxxxx',
  'installed' => true,
  'instanceid' => 'occhmk8kzusp',
  'maintenance' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'theme' => '',
  'loglevel' => 2,
  'default_phone_region' => 'AU',
  'app_install_overwrite' =>
  array (
    0 => 'documentserver_community',
    1 => 'impersonate',
  ),
  'enable_previews' => true,
  'preview_max_x' => 4096,
  'preview_max_y' => 4096,
  'preview_max_filesize_image' => 150,
  'preview_max_memory' => 256,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);

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

HTTP Logs contain no current data, since upgrade failed.

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Nothing in Log since update started.

That looks like something got messed up with the ownership/permissions of your file tree.

What is the output of:

ls -la /var/www/html/nextcloud

Do all files and folders (including ‘.’ at the top) belong to the user apache?

If not, run:

sudo chown -R apache:apache /var/www/html/nextcloud

and start the updater again.

I hope this helps,

much luck!

Hi there, I tried sudo chown -R apache:apache /var/www/html/nextcloud and it doesn’t know who apache:apache is.

Here is the result of ls -la /var/www/html/nextcloud:

drwxr-xr-x 15 www-data www-data 4096 Aug 14 12:43 .
drwxr-xr-x 4 www-data www-data 4096 Sep 8 18:52 …
drwxr-xr-x 45 www-data www-data 4096 Aug 14 12:43 3rdparty
drwxr-xr-x 72 www-data www-data 4096 Sep 17 21:40 apps
-rw-r–r-- 1 www-data www-data 23796 Aug 14 12:43 AUTHORS
drwxr-xr-x 2 www-data www-data 4096 Aug 14 13:20 config
-rw-r–r-- 1 www-data www-data 4095 Aug 14 12:43 console.php
-rw-r–r-- 1 www-data www-data 34520 Aug 14 12:43 COPYING
drwxr-xr-x 24 www-data www-data 4096 Aug 14 12:43 core
-rw-r–r-- 1 www-data www-data 6317 Aug 14 12:43 cron.php
drwxr-xr-x 2 www-data www-data 4096 Jul 6 18:44 data
drwxr-xr-x 2 www-data www-data 12288 Aug 14 12:43 dist
-rw-r–r-- 1 www-data www-data 3257 Aug 14 13:20 .htaccess
-rw-r–r-- 1 www-data www-data 156 Aug 14 12:43 index.html
-rw-r–r-- 1 www-data www-data 3456 Aug 14 12:43 index.php
drwxr-xr-x 6 www-data www-data 4096 Aug 14 12:43 lib
-rw-r–r-- 1 www-data www-data 283 Aug 14 12:43 occ
drwxr-xr-x 2 www-data www-data 4096 Aug 14 12:43 ocm-provider
drwxr-xr-x 2 www-data www-data 4096 Aug 14 12:43 ocs
drwxr-xr-x 2 www-data www-data 4096 Aug 14 12:43 ocs-provider
-rw-r–r-- 1 www-data www-data 3187 Aug 14 12:43 public.php
-rw-r–r-- 1 www-data www-data 5597 Aug 14 12:43 remote.php
drwxr-xr-x 4 www-data www-data 4096 Aug 14 12:43 resources
-rw-r–r-- 1 www-data www-data 26 Aug 14 12:43 robots.txt
-rw-r–r-- 1 www-data www-data 2452 Aug 14 12:43 status.php
drwxr-xr-x 3 www-data www-data 4096 Aug 14 12:43 themes
drwxr-xr-x 2 www-data www-data 4096 Jul 6 18:13 updater
-rw-r–r-- 1 www-data www-data 101 Aug 14 12:43 .user.ini
-rw-r–r-- 1 www-data www-data 383 Aug 14 12:43 version.php

Does anything look out of whack? The updater fails at this point:

Initializing

Current version is 27.0.2.

apache is not your webserver user.
Your webserver user is www-data

So you have to call it this way:

sudo -u www-data php (...etc)

much luck

1 Like