[Solved] Upgrade to NC 15 failing

update_problems

#1

Nextcloud version 15.0.0:
Operating system and version Fedora 29 (SeLinux enabled):
Apache or nginx version Apache 2.4.37:
PHP version 7.2.13:

The issue you are facing: Am attempting to complete the upgrade to NC 15 but getting an error:
UnexpectedValueException: The files of the app “files” were not correctly replaced before running the update
Update failed

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

Steps to replicate it:

  1. sudo -u apache php occ upgrade

The output of your Nextcloud log in Admin > Logging:

only one I could find is empty

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

<?php                                                                                                                                                                                                                                      
$CONFIG = array (                                                                                                                                                                                                                          
  'instanceid' => 'instanceid',                                                                                                                                                                                                          
  'passwordsalt' => 'passwordsalt',                                                                                                                                                                                      
  'secret' => 'secret',                                                                                                                                                                          
  'trusted_domains' =>                                                                                                                                                                                                                     
  array (                                                                                                                                                                                                                                  
    0 => 'xxxxxxxxx.duckdns.org',                                                                                                                                                                                                           
  ),                                                                                                                                                                                                                                       
  'datadirectory' => '/mnt/extradasd/qcloud',                                                                                                                                                                                              
  'dbtype' => 'mysql',                                                                                                                                                                                                                     
  'version' => '14.0.3.0',                                                                                                                                                                                                                 
  'overwrite.cli.url' => 'http://xxxxxxxxx.duckdns.org',                                                                                                                                                                                    
  'dbname' => 'nextcloud',                                                                                                                                                                                                                 
  'dbhost' => 'localhost:3306',                                                                                                                                                                                                            
  'dbport' => '',                                                                                                                                                                                                                          
  'dbtableprefix' => 'oc_',                                                                                                                                                                                                                
  'mysql.utf8mb4' => true,                                                                                                                                                                                                                 
  'dbuser' => 'xxxx',                                                                                                                                                                                                                 
  'dbpassword' => 'iMtaDDb2AY3z9hWf8PEZqVT1D0lH86',                                                                                                                                                                                        
  'installed' => true,                                                                                                                                                                                                                     
  'theme' => '',                                                                                                                                                                                                                           
  'loglevel' => 2,                                                                                                                                                                                                                         
  'maintenance' => true,                                                                                                                                                                                                                   
  'mail_from_address' => 'mailfrom',                                                                                                                                                                                                       
  'mail_smtpmode' => 'smtp',                                                                                                                                                                                                               
  'mail_domain' => 'provider.com',                                                                                                                                                                                                           
  'mail_smtpauthtype' => 'LOGIN',                                                                                                                                                                                                          
  'mail_smtpauth' => 1,                                                                                                                                                                                                                    
  'mail_smtphost' => 'smtp.broadband.provider.com',                                                                                                                                                                                          
  'mail_smtpport' => '465',                                                                                                                                                                                                                
  'mail_smtpname' => 'mailfrom@provider.com',                                                                                                                                                                                                
  'mail_smtppassword' => 'smtppassword',                                                                                                                                                                                                        
  'updater.secret' => '$2y$10$Ydbv/wnqBk14CmdK4C2..uWIRsqEW3O7L9mKvM6ZUoMd3hCvxG4k.',                                                                                                                                                      
);

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

error log is empty

Additional Info
I did not have any 3rd party apps so did not copy any of the old “apps” directory contents over (was doing a manual upgrade as per the documentation). After receiving the above error, I then did a copy (option -npR) of the “apps” directory but still received the same error. Stopped and restarted apache and no change in progress.


#2

Hi,

Could you double check the ownership and permissions of the files and folders in your nextcloud directoy?
Maybe during the copy some files have not been created with the ownership of your web server user.

If you’re not 100% sure what I’m talking about, please provide the output of
ls -l

of
/path/to/nextcloud and
/path/to/nextcloud/apps/


#3

As requested:

Nextcloud
[root@DBServe html]# ls -lZ nextcloud
total 136
drwxr-x—. 32 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 3rdparty
drwxrwxrwx. 42 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Dec 7 14:19 apps
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 12063 Dec 10 05:21 AUTHORS
drwxr-x—. 2 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Jan 9 13:31 config
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 3650 Dec 10 05:21 console.php
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 34520 Dec 10 05:21 COPYING
drwxr-x—. 18 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 core
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4979 Dec 10 05:21 cron.php
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 156 Dec 10 05:21 index.html
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 3172 Dec 10 05:21 index.php
drwxr-x—. 6 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 lib
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 283 Dec 10 05:21 occ
drwxr-x—. 2 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 ocs
drwxr-x—. 2 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 ocs-provider
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 2969 Dec 10 05:21 public.php
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 5139 Dec 10 05:21 remote.php
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 26 Dec 10 05:21 robots.txt
drwxr-x—. 12 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 settings
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 2232 Dec 10 05:21 status.php
drwxr-x—. 3 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 themes
drwxr-x—. 2 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Jan 9 13:13 updater
-rw-r-----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 363 Dec 10 05:25 version.php

and

nextcloud/apps
[root@DBServe html]# ls -lZ nextcloud/apps
total 160
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 accessibility
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 activity
drwxrwxrwx. 5 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 admin_audit
drwxrwxrwx. 4 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 cloud_federation_api
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 comments
drwxrwxrwx. 13 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Nov 26 11:48 dashboard
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 dav
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 encryption
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 federatedfilesharing
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 federation
drwxrwxrwx. 11 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files
drwxrwxrwx. 11 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files_external
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files_pdfviewer
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files_sharing
drwxrwxrwx. 8 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files_texteditor
drwxrwxrwx. 11 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files_trashbin
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files_versions
drwxrwxrwx. 7 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 files_videoplayer
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 firstrunwizard
drwxrwxrwx. 12 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 gallery
drwxrwxrwx. 12 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 logreader
drwxrwxrwx. 5 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:47 lookup_server_connector
drwxrwxrwx. 8 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 nextcloud_announcements
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 notifications
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 oauth2
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 password_policy
drwxrwxrwx. 6 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 provisioning_api
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 serverinfo
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 sharebymail
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Nov 26 15:37 spreed
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 support
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 survey_client
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 systemtags
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 theming
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 twofactor_backupcodes
drwxrwxrwx. 9 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Dec 7 14:19 unsplash
drwxrwxrwx. 10 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 updatenotification
drwxrwxrwx. 5 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 user_external
drwxrwxrwx. 12 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 user_ldap
drwxrwxrwx. 8 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Oct 12 02:50 workflowengine


#4

Doing some more searching (and using a different search engine) located the solution to the problem. It seems that the “upload” of the apps directory did not complete initially. To resolve, I deleted the apps directory on the server and then re-uploaded the apps directory from my local machine to the server. Reran the update and all worked fine.