Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updater fails to complete #2737

Closed
mentalinc opened this issue Dec 17, 2016 · 55 comments
Closed

Updater fails to complete #2737

mentalinc opened this issue Dec 17, 2016 · 55 comments

Comments

@mentalinc
Copy link

Updater fails at the following point

Move new files in place
Could not rmdir /media/ownclouddrive/updater-oc8651su36ek/downloads/nextcloud/apps/comments/l10n

Steps to reproduce:
have datastore mounted via fstab (forgive me for still using owncloud naming)
//SERVERNAME/owncloud/ /media/ownclouddrive/ cifs uid=33,gid=33,defaults,file_mode=0770,dir_mode=0770,rw,username=owncloud-nas,password=XXXXXXX,domain=XXXXXX,noserverino 0 0

user with uid=33 is www-data
from config file
'datadirectory' => '/media/ownclouddrive',

Attempt to update using the built in updater will progress successfully to this point then fail (everytime).
Not sure what the issue is however...

I can do a cp from root account and copies the files fine.
cp -rf /media/ownclouddrive/updater-oc8651su36ek/downloads/nextcloud /var/www

I then just manually finish the process by setting maintenance mode off in config file and carrying on with upgrade via website.

Filled in most of the below

Server configuration

Operating system:
Ubuntu 16.04.1 LTS
Web server:
Server version: Apache/2.4.18 (Ubuntu) (apt-get updated)
Database:
mariadb?
PHP version:
PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
Nextcloud version: (see Nextcloud admin page)
10.0.2 (also happened when updating from v9.0.52) I was hopeful this was fixed in v 10

Updated from an older Nextcloud/ownCloud or fresh install:
updating from 10.0.2
Where did you install Nextcloud from:
from updater app.

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

The content of config/config.php:

'oc8651su36ek', 'passwordsalt' => '', 'secret' => '', 'trusted_domains' => array ( 0 => 'xxxxxxxx', ), 'datadirectory' => '/media/ownclouddrive', 'overwrite.cli.url' => 'xxxxxxxxx', 'dbtype' => 'mysql', 'version' => '9.1.2.2', 'dbname' => 'nextcloud', 'dbhost' => '127.0.0.1', 'dbtableprefix' => 'oc_', 'dbuser' => 'oc_mentalinc', 'dbpassword' => '', 'logtimezone' => 'xxx', 'installed' => true, 'trashbin_retention_obligation' => 'auto,10', 'updater.release.channel' => 'beta', 'maintenance' => false, 'theme' => '', 'loglevel' => 2, 'updater.secret' => 'xxxxxxxxxxxxxxxx', ); ``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder or Insert your config.php content here (Without the database password, passwordsalt and secret) ``` **Are you using external storage, if yes which one:** local/smb/sftp/... smb to windows 2016 server **Are you using encryption:** yes/no no **Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/... no #### LDAP configuration (delete this part if not used)
LDAP config ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your Nextcloud installation folder Without access to your command line download the data/owncloud.db to your local computer or access your SQL server remotely and run the select query: SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap'; Eventually replace sensitive data as the name/IP-address of your LDAP server or groups. ```
### Client configuration **Browser:** chrome 55 **Operating system:** windows 10
@schiessle
Copy link
Member

Does the webserver has permission to delete /media/ownclouddrive/updater-oc8651su36ek/downloads/nextcloud/apps/comments/l10n ? At first sight it looks like a permission issue, cc @LukasReschke @MorrisJobke for more in depth knowledge about the updater

@mentalinc
Copy link
Author

I does seem permissions issue but the www-data user has 0770 access so should be able to delete the folder in the script.

root@nextcloud:/media/ownclouddrive/updater-oc8651su36ek/downloads/nextcloud/apps/comments#ls -la
drwxrwx--- 2 www-data www-data 0 Dec 18 08:20 lib

Files are still on the share per the download programme as I just cp them to the correct location.

@MorrisJobke
Copy link
Member

root@nextcloud:/media/ownclouddrive/updater-oc8651su36ek/downloads/nextcloud/apps/comments#ls -la
drwxrwx--- 2 www-data www-data 0 Dec 18 08:20 lib

@mentalinc This is the folder lib - what are the permissions of l10n?

@mentalinc
Copy link
Author

root@nextcloud:/media/ownclouddrive/updater-oc8651su36ek/downloads/nextcloud/apps/comments# ls -la
total 8
drwxrwx--- 2 www-data www-data 0 Dec 18 08:22 .
drwxrwx--- 2 www-data www-data 8192 Dec 18 08:22 ..
drwxrwx--- 2 www-data www-data 0 Dec 18 08:22 l10n
drwxrwx--- 2 www-data www-data 0 Dec 18 08:20 lib

@MorrisJobke
Copy link
Member

could you give me an ls -la of the config directory and it's content?

ls -la /path/to/nextcloud/config

@mentalinc
Copy link
Author

The nextcloud config folder
drwxr-x--- 2 www-data www-data 4096 Dec 18 08:39 config

and the contents
root@nextcloud:/var/www/nextcloud/config# ls -la
total 60

drwxr-x--- 2 www-data www-data 4096 Dec 18 08:39 .
drwxr-x--- 16 root www-data 4096 Dec 18 08:59 ..
-rw-r----- 1 www-data www-data 778 Dec 20 08:15 config.php
-rw-r----- 1 www-data www-data 41687 Dec 18 08:26 config.sample.php
-rw-r----- 1 www-data www-data 225 Dec 18 08:26 .htaccess

and the nextcloud dir
drwxr-x--- 16 root www-data 4096 Dec 18 08:59 nextcloud

Is root being the owner of the nextcloud dir the issue?

@MorrisJobke
Copy link
Member

Is root being the owner of the nextcloud dir the issue?

Usually not. We check for the owner of the config.php file. So this looks good. Sadly I have no idea why this folder can't be deleted, because it was previously just created by the very same user (it must be - because this happens in the extract step).

@MorrisJobke
Copy link
Member

Is maybe the filesystem full or some SELinux config in place?

@mentalinc
Copy link
Author

Drive is mapped to an NTFS Server 2016 share per the fstab above

File system isn't full

df -h
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 0 2.0G 0% /dev
tmpfs 394M 21M 373M 6% /run
/dev/sda1 12G 3.0G 8.1G 27% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
//server/owncloud/ 24T 20T 4.2T 83% /media/ownclouddrive
tmpfs 394M 0 394M 0% /run/user/1000

@caco3
Copy link

caco3 commented Dec 30, 2016

I had the same issue on a FreeBSD server in the extraction step.
I then deleted all the updater folders and tried again.
Extraction when through well, but then it hangs wit the same issue in "Delete old files":
Could not rmdir /home/***/www/nextcloud_test/updater/../apps/comments

Since I don't know the exact file it is failing on, I can't check its permission, how ever the permissions should be ok!

This is the part of the log:

2016-12-30T15:31:23+0100 2XS2KtFCbq [info] startStep("8")
2016-12-30T15:31:23+0100 2XS2KtFCbq [info] deleteOldFiles()
2016-12-30T15:31:24+0100 2XS2KtFCbq [error] POST request failed with other exception
2016-12-30T15:31:24+0100 2XS2KtFCbq [error] Exception: Exception
Message: Could not rmdir /home/***/www/nextcloud_test/updater/../apps/comments
Code:0
Trace:
#0 /home/***/www/nextcloud_test/updater/index.php(707): Updater->recursiveDelete('/home/***/...')
#1 /home/***/www/nextcloud_test/updater/index.php(1135): Updater->deleteOldFiles()
#2 {main}
File:/home/***/www/nextcloud_test/updater/index.php
Line:688

2016-12-30T15:31:24+0100 2XS2KtFCbq [info] rollbackChanges("8")
2016-12-30T15:31:24+0100 2XS2KtFCbq [info] unlink .step
2016-12-30T15:31:24+0100 2XS2KtFCbq [info] rollbackChanges - step >= 7
2016-12-30T15:31:24+0100 2XS2KtFCbq [info] end of  rollbackChanges()```

@MorrisJobke
Copy link
Member

/home/***/www/nextcloud_test/updater/../apps/comment

It is the permission of /home/***/www/nextcloud_test/apps/comment.

Weird. @caco3 Is this a mount point for any external storage (as in NFS or Samba viua /etc/fstab) or just a normal partition?

@caco3
Copy link

caco3 commented Jan 2, 2017

@MorrisJobke: It is a shared webspace, I don't have any mount points configured.
I have a Dropbox Account as external memory, but I don't see the connection to the mentioned error message.

@MorrisJobke
Copy link
Member

@MorrisJobke: It is a shared webspace, I don't have any mount points configured.
I have a Dropbox Account as external memory, but I don't see the connection to the mentioned error message.

Yes - sounds valid. @LukasReschke Any idea why a removal of a file fails only for some files in a subdirectory that was just created by the updater itself?

@caco3
Copy link

caco3 commented Jan 19, 2017

It happened again with the update to 11.0.1 (note I didn't expect it to be solved).
The sad thing how ever is that the installation is broken afterwards :(
It only shows "Update in process." and I couldn't find a way to get it working again (deactivating maintenance mode of course didn't work)...
So my usual solution is to wipe the installation and extract a new tar.gz.

@mentalinc
Copy link
Author

Agree had the same issue.
I do a cp -rf from the extracted download to /var/www/
I then edit the .config.php to take it out of maintenance mode.
run the permissions script again
and then the occ upgrade command (or from webui)

and the upgrade is done and working fine.

I vote of a don't fail the upgrade because the extracted files cant be deleted. leave the files give me a info notice at the end to manually clean it up if I want at the end...

@caco3
Copy link

caco3 commented Feb 28, 2017

Today I tried to update from 11.0.1 to 11.0.2, again with an access error:

Could not rmdir /home/*****/www/nextcloud/updater/../apps/comments

To make sure, I first deleted the update folder () and tried again, same outcome.
This means that the script itself created the folder but then failed again to remove it, although it has the required rights:

[me@s4:~/owncloud_me] $ ls -l
total 3340
[..] 
drwxr-xr-x   4 me  me     4096 Feb 28 23:30 updater-5083050d6af67
-rw-r--r--   1 me  me    27880 Feb 28 23:30 updater.log
[..] 


[me@s4:~/owncloud_me] $ cd updater-5083050d6af67/

[me@s4:~/owncloud_me/updater-5083050d6af67] $ ls -l
total 8
drwxr-x---  3 me  me  4096 Feb 28 23:27 backups
drwxr-x---  3 me  me  4096 Feb 28 23:30 downloads


[me@s4:~/owncloud_me/updater-5083050d6af67] $ cd downloads/

[me@s4:~/owncloud_me/updater-5083050d6af67/downloads] $ 

[me@s4:~/owncloud_me/updater-5083050d6af67/downloads] $ ls -l
total 4
drwxr-xr-x  14 me  me  4096 Feb 28 23:30 nextcloud

[me@s4:~/owncloud_me/updater-5083050d6af67/downloads] $ cd nextcloud/

[me@s4:~/owncloud_me … 083050d6af67/downloads/nextcloud] $ ls -l
total 148
drwxr-xr-x  29 me  me   4096 Feb 28 23:29 3rdparty
-rw-r--r--   1 me  me   8868 Feb 28 23:29 AUTHORS
drwxr-xr-x  41 me  me   4096 Feb 28 23:30 apps
[..] 

[me@s4:~/owncloud_me … 083050d6af67/downloads/nextcloud] $ cd apps/

[me@s4:~/owncloud_me … 0d6af67/downloads/nextcloud/apps] $ ls -l
total 156
[..] 
drwxr-xr-x   8 me  me  4096 Feb 28 23:29 comments
[..] 

@eyysee
Copy link

eyysee commented Mar 3, 2017

@caco3 this may have something to do with the CIFS share you are using. I have come across the same problem whilst having the data folder on a CIFS share, but when local do not have the problem.

@caco3
Copy link

caco3 commented Mar 3, 2017

@eyysee Why do you think i have CIFS?
See my server details in one of my post above. I have a BSD server and am not avare of any mounted shares (beside dropbox as external storage)

[me@s4:~] $ uname -a
FreeBSD s4.server.*****.ch 10.3-RELEASE-p3 FreeBSD 10.3-RELEASE-p3 #12 r300097M: Wed May 18 00:39:17 UTC 2016     root@port10.adm.*****.ch:/usr/obj/usr/src/sys/*****  amd64
[

[me@s4:~] $ /sbin/mount
[..]
10.0.4.19:/vol/cust019/me on /home/me (nfs, nosuid)
[..]

@eyysee
Copy link

eyysee commented Mar 3, 2017

@caco3 - whoops, for some reason, thought you were the OP.

@mentalinc ^^

@mentalinc
Copy link
Author

@eyysee Any suggestions on what can be changed so a CIFS share can be used?
Do I need to change the config somewhere?

Otherwise seems there is a bug with NextCloud updater where the data folder is on CIFS that should be investigated?

@mentalinc
Copy link
Author

Below are the various commands I have to run at the various failure points. based on the errors.
Eventually once it downloads the file, I just copy it to the /var/www location, mannually edit config to take out of maintenance mode. and it all works.
but maybe just adding in a few of these commands to the updater on failures could solve the issues?

sudo su
sh /home/mentalinc/updateNextPermissions.sh
rm -r /var/www/nextcloud/assets/
rmdir --ignore-fail-on-non-empty /media/ownclouddrive/updater-oc8651su36ek/downloads/
mkdir /media/ownclouddrive/updater-oc8651su36ek/downloads/
cp -rf /media/ownclouddrive/updater-oc8651su36ek/downloads/nextcloud /var/www
nano /var/www/nextcloud/config/config.php
sh /home/mentalinc/nextPermissions.sh
sudo -u www-data php /var/www/nextcloud/occ upgrade

@caco3
Copy link

caco3 commented Mar 4, 2017

I guess it got stated before, but I do no see why a failing removal of a temporary folder should lead to an update error (and possibly even to a corrupted NC installation). Wouldn't it be sufficient to show a warning so the user should remove the folder manually?
As is now it is a real show stopper!

@eyysee
Copy link

eyysee commented Mar 6, 2017

@mentalinc when testing on a local mount, everything works as expected however as with you, when mounted as CIFS and the correct permissions applied to the mount, it gives me the same error whereby it cannot remove the temporary update directories. However saying that, if I keep clicking 'retry' then it does end up removing the directories... weird! Not sure why it's temporarily failing.

Here is what I have applied for the CIFS mount:
//SERVER/CIFS-MOUNT /LOCAL/MOUNT cifs credentials=/path/to/creds,file_mode=0640,dir_mode=0750,nounix,noserverino,uid=33,gid=33,sec=ntlm 0 0

@mentalinc
Copy link
Author

Still no progress in 11.0.3
Same errors in all the same places. the manual steps I used above still do the trick, but a one click button would be so much better

Can the code be changed to at least not fail?

@stjosh
Copy link

stjosh commented May 22, 2017

Same issue for me (currently testing the 12.0 beta and RC releases)... however, it also seems I'm with the same hosting provider as @caco3 is, the environment looks strangely familiar. ;-)

@caco3
Copy link

caco3 commented May 22, 2017

@stjosh: I am @ Hostpoint (in Switzerland)

@skyynet
Copy link

skyynet commented May 23, 2017

Same problem here updating from 11.0.2 to 12.0.0.
Could not rmdir /home/***/www/nextcloud/updater/../apps/comments

I have a bad feeling every time I start the updater and it was never wrong. It would be great if this issue could be solved as it leads to outdated nc instances all over the world because people stick with their working systems before breaking them while updating.

@eyysee
Copy link

eyysee commented May 23, 2017

Not ideal but if you keep clicking on "retry" then the install will eventually complete but I am experiencing the same issue still.

@MariaHimmelfahrt
Copy link

Hi.

I'm not sure if this is the same problem. I tried to migrate from OwnCloud and I stuck in Step 10. Something could not delete (which is created by the updater). Hosting is shared web hosting at Strato (SunOs).
At a frist step it would be helpful to fix the problem (HOW?) and restart/rerun the updater. Or I have a manual list what to do. What should I delete, what should I move, where? Is there a concept draft of how the updater works and steps?
The documentation and the log file are too less verbose in this case. Where could I find "how to proceed"?
Logfile here: https://help.nextcloud.com/t/migration-from-owncloud-fails-process-stucks-at-step-10-help/15156

Thanks a lot in advance for any advice!

@stjosh
Copy link

stjosh commented Jul 10, 2017

@MariaHimmelfahrt Well, as @eyysee already mentioned, if it's really the issue identified (and hopefully fixed by this pull request), you just have to be patient end click "update" again and again until it succeeds. From the logs linked, I think this should do the trick.

Alternatively, you may want to try the manual update procedure as proposed by @caco3 .

@MariaHimmelfahrt
Copy link

@stjosh & @caco3
Thanks a lot! Wow - this was really quick reaction!

@stjosh: Sorry, but I didn't get the desc really well. As I understand, the tree passing "delete" went wrong. Therefore, why could I not do this manually (What exact to delete?) and restart the updater or help the updater to proceed? Why does nobody describes such a procedure - what I'm getting wrong?

@caco3 :=> May I ask you for closer description? II did not understand exactly what to do, because the manual was too short and I have no good orientation in the file structure.

rename the NC folder << ? which folder exactly? I do have many folders
Upload the new zip file << ? which zip-file?
extract it // OK - I know wht to do ;)
copy the config and the apps from the old folder to the new folder << which is "old" and which is "new" folder? => May I ask you for closer description?
run migration (reload NC in browser) << ? Not the updater "index.php". I should reload the entry web page ? I didn't get this.

As well, my installation stucks in Step 10 (Maybe rolledback to Step 7) Now I don't know what is what, what is OwnCloud - old and NextCloud - new structures. Maybe you could give me some orientation.

Thanks in advance!

@stjosh
Copy link

stjosh commented Jul 10, 2017

@MariaHimmelfahrt Ah - I must have missed the point that you're actually trying to migrate from OwnCloud. Nevertheless, this should not make much of a difference.

  • Regarding the "clicking the update button" solution: All you need to do is really simply clicking the update button again and again and you should get a little further in the update process each time you do so until it eventually succeeds. However, I must admit that this is a bit cumbersome and might take quite a while. (The reason why this works is that the updater struggles to delete folders with many files in them. It deletes only most of the files and then tries to delete the folder which fails, because the folder is not empty. If you just run the update again, the remaining files will be deleted and then also the folder, so the updater can get a bit further until it hits the next folder with too many files...).

  • caco3's approach:

    1. rename your current ownCloud root-folder to something else
    2. download the latest NextCloud release from the NextCloud website
    3. upload it to the hosting and extract it - name the folder the same as your "old" installation was named before renaming it in step i
    4. Copy config.php and all non-existing sub-folders of "apps" from your renamed ownCloud folder to your new nextcloud folder
    5. Open your URL (yes, really just index.php!) in the Browser and run the migration script (you'll be prompted to do so because index.php realizes that the DB version does not match the files installed)
    6. Once you verified that everything is working, you might want to delete your old (and now useless) ownCloud folder

Hope that helps.

@caco3
Copy link

caco3 commented Aug 17, 2017

So... this are just some notes so you know how many time you typically have to press "retry" :)

Tried update from 12.0.0 to 12.0.2:
clicked around 12 times on "retry"
    => every time it came a bit further
Until this error showed up: 
    core/shipped.json is not available
Checking: there is no folder "core" in my installation...
    => just for fun uploaded the core folder from the 12.0.2 tar file
2 more times "retry" in "Delete old files" step
13 more times "retry" in "Move new files in place" step

hazzzaaaaaaa!!!
First time ever a web based update completed :)
But still waiting for the merge of the pull request nextcloud/updater#121

@MorrisJobke
Copy link
Member

Will be fixed with the next updater in stable12. nextcloud/updater#132

@MorrisJobke MorrisJobke added this to the Nextcloud 12.0.3 milestone Aug 20, 2017
@tcm300
Copy link

tcm300 commented Dec 16, 2017

Hi
While updating from 12.0.3 to 12.0.4 i had still to restart the updater to do some file deletions and had to upload shipped.json to delete by the script to continue the webupdater.
Is this issue not fixed in 12.0.3?

@caco3
Copy link

caco3 commented Dec 16, 2017

Sadly I have to say that I also still had issues :(

Below the log:

Delete old files
    Could not rmdir: /home/****/www/nextcloud/updater/../core/doc/admin/_images
    Could not rmdir: /home/****/www/nextcloud/updater/../3rdparty/rackspace/php-opencloud/lib/OpenCloud/Common/Exceptions
    core/shipped.json is not available (=> uploaded it manually)

Move new files in place
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/core/doc/admin/_images
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/settings/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/3rdparty/rackspace/php-opencloud/lib/OpenCloud/Common/Exceptions
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/3rdparty/aws/aws-sdk-php/src
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/encryption/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_trashbin/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_pdfviewer/vendor/pdfjs/web/images
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_pdfviewer/vendor/pdfjs/web/cmaps
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_texteditor/js/core/vendor/ace-builds/src-noconflict
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_texteditor/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/comments/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_external/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/activity/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/systemtags/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/updatenotification/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_sharing/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/gallery/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/user_ldap/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files_versions/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/files/l10n
    Could not rmdir /home/****/owncloud_****/updater-5083050d6af67/downloads/nextcloud/apps/firstrunwizard/l10n

@mentalinc
Copy link
Author

Still an issue in 13 Beta as well
Need to click retry update a million times before it eventually completes.

@mentalinc
Copy link
Author

It worked!
Upgraded from Beta 13 v4 to RC1 worked with no issues. didn't have to retry at all

@marcelstoer
Copy link

What an ordeal! Just went through upgrading from 12.0.4 to 12.0.5 and got stuck with this as well.

Had to click "Retry" dozens of times, had to manually recreate (an empty) core/shipped.json a couple of times in the process and eventually the file integrity check failed because some images were missing (re-added them manually).

@tcm300
Copy link

tcm300 commented Feb 2, 2018

Huff, I did the same, and got a messy installation :-(.
The ressources folder was missing and most of the apps.
Manually coping helped but now I've issues with folder and filepermissions...
How can I fix permissions without SSH-console?

@johnramsden
Copy link

It's just occurred to me on FreeBSD updating from 12.0.3 - 12.0.5. I've had the web updater fail every time I have tried it.

Move new files in place
Could not rmdir /mnt/data/updater-ocb4qm9xj692/downloads/nextcloud/settings/l10n

@caco3
Copy link

caco3 commented Feb 6, 2018

@MorrisJobke Please reopen this issue again as it is clearly not solved yet!

I did some digging in the updaters code.
I believe the problem is based on the deletion of non-empty folders.
I tried to fix it by adding a $this->recursiveDelete(..); calls before the rmdir() in the functions deleteOldFiles() moveWithExclusions() and recursiveDelete() itself.
This how ever lead to a runtime termination due to too many iterations (too many files open).
IMHO a confirmation that the deletion routine is not working as expected.
I thought the recursive iterating could be improved by sorting the folders lists, but was unable to get it working. maybe it sorts the wrong way.

Since I now already upgraded, I can't test it any longer.

See my tries here: caco3/updater@f249e8b#diff-828e0013b8f3bc1bb22b4f57172b019d

@MorrisJobke
Copy link
Member

Please open a new issue for this and reference this issue. The original issue was solved your issue seem to look like this but maybe is slightly different. Thanks

@BloodyIron
Copy link

I just upgraded ownCloud 9.1.4 -> NC 10.0.6 -> NC 11.0.8 -> NC 12.0.7 -> NC 13.0.2

And EVERY single step of the way I had the rmdir permission issue. I have the data folder on an SMB (you're referring to it as CIFS, but the protocol is actually SMB, CIFS is just old nomenclature) mounted share. It has 0770 folders and files, and www-data user AND group owns it recursively. So the permissions should be there for rmdir to work, but it only seemed to be on specific folders, and always the same folders, for every step of the way.

I REALLY hope this gets fixed. I'm on 13.0.2 now (just finishing up validation) and to endure this each time an upgrade happens is just PAIN.

I know it's centric to me using an SMB share for the data folder, and I can't quite figure out why it complains about specific folders. Perhaps this is an order of operations issue? Maybe copy all the files over to the new location, THEN delete them from source?

@caco3
Copy link

caco3 commented May 14, 2018

@BloodyIron This issue is closed! If you have useful information (logs, your config, ...), add them to nextcloud/updater#158!

I personally don't think its an issue on the data folder since that one does not get altered during an update. The log should say more => data/updater.log

@BloodyIron
Copy link

The data folder is where the updates were downloaded to, and then copied from, every. single. version. upgrade. I did. I don't know why you think otherwise, because that's the behaviour I saw, and I followed the recommended upgrade steps. I literally watched it working in the data folders (under an updater section).

@jult
Copy link

jult commented Jul 20, 2020

Good grief, this still exists.

Create backup  
Could not rmdir /nxt/nc_data/updater-ock5tdx30nt4/backups/nextcloud-18.0.6.0/

and yes, /nxt is a CIFS share on the VM's host system where nc is in a guest vm, but since the updater creates it, it should also be able to delete it. I have no issues using the share with anything otherwise.

Can't you just make it dialog-dependent, to make that backup during updates? It's silly to force one upon the users, since most already have an active backup script somewhere doing the same.

2020-07-21T00:14:49+0200 GvJre4W6fF [error] Exception: Exception
Message: Could not rmdir /nxt/nc_data/updater-ock5tdx30nt4/backups/nextcloud-18.0.6.0/
Code:0
Trace:
#0 /var/www/nextcloud/updater/index.php(476): Updater->recursiveDelete('/nxt/nc_data/up...')
#1 /var/www/nextcloud/updater/index.php(1336): Updater->createBackup()
#2 {main}
File:/var/www/nextcloud/updater/index.php
Line:894

@jult
Copy link

jult commented Jul 22, 2020

of course, no response. The simplest of solutions, just skip the backup, a goto line, and it could not be implemented!

@MorrisJobke
Copy link
Member

of course, no response. The simplest of solutions, just skip the backup, a goto line, and it could not be implemented!

Keep in mind to be a bit more patient here. This is an open source project with a community of people providing help for free. If you need help in a timely manner, then think about the Nextcloud subscription: https://nextcloud.com/enterprise/

ref nextcloud/updater#282

@jult
Copy link

jult commented Jul 23, 2020

Sure, I realize that. I'll make my own script. The manual option (this one here: https://docs.nextcloud.com/server/13.0.0/admin_manual/maintenance/manual_upgrade.html ) always works fine, so I'm shell-scripting what that does. I don't really understand why nobody else ever did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests