nextcloud / updater

:arrows_counterclockwise: The updater app to keep your Nextcloud up-to-date
GNU Affero General Public License v3.0
45 stars 33 forks source link

NC updater 15.0.2 still fails on Delete old files (core/shipped.json is not available) #222

Open devplan44 opened 5 years ago

devplan44 commented 5 years ago

This is quite old and hasn't been fixed: NC updater 15.0.2 still fails on Delete old files (core/shipped.json is not available)

  1. I had to add "'maintenance' => false," to config.php -- otherwise the updater wouln't make it past the Backupstep. (Why don't we add some smart interactive choices?)
  2. Nearly every step has a parsing error. (Why can't the updater wait a bit more?!!)
  3. Updater doesn't make it past the Delete old files step because of missing core/shipped.json

I see that I am not the only one. The Updater index.php needs some MAJOR overhaul.

Screenshot from 2019-04-11 23-24-10

Snipped from updater log. (domain name changed) 2019-04-11T21:06:48+0000 DQkRuGYe3N [info] rollbackChanges("9") 2019-04-11T21:06:48+0000 DQkRuGYe3N [info] unlink .step 2019-04-11T21:06:48+0000 DQkRuGYe3N [info] rollbackChanges - step >= 7 2019-04-11T21:06:48+0000 DQkRuGYe3N [info] end of rollbackChanges() 2019-04-11T21:06:48+0000 3q1nnwSQwU [info] request to updater 2019-04-11T21:06:48+0000 3q1nnwSQwU [info] currentStep() 2019-04-11T21:06:48+0000 3q1nnwSQwU [info] POST request for step "9" 2019-04-11T21:06:49+0000 3q1nnwSQwU [info] startStep("9") 2019-04-11T21:06:49+0000 3q1nnwSQwU [info] deleteOldFiles() 2019-04-11T21:06:49+0000 3q1nnwSQwU [error] POST request failed with other exception 2019-04-11T21:06:49+0000 3q1nnwSQwU [error] Exception: Exception Message: core/shipped.json is not available Code:0 Trace:

0 /customers/2/3/6/mydomain.de/httpd.www/nextcloud/updater/index.php(1337): Updater->deleteOldFiles()

1 {main}

File:/customers/2/3/6/mydomain.de/httpd.www/nextcloud/updater/index.php Line:891

MorrisJobke commented 5 years ago

@devplan44 Does this always happen with the file core/shipped.json?

MorrisJobke commented 5 years ago
  1. I had to add "'maintenance' => false," to config.php -- otherwise the updater wouln't make it past the Backupstep. (Why don't we add some smart interactive choices?)

That is weird - it should not be needed and many instances out there also don't have this.

MorrisJobke commented 5 years ago

2. Nearly every step has a parsing error. (Why can't the updater wait a bit more?!!)

That means your Webserver killed the request - very little we can do here. You need to configure the webserver to have a higher timeout.

MorrisJobke commented 5 years ago

Could you try to run it from CLI? Does it work there? (because this is basically the same code without the fragile concept of webserver timeouts.

RobertBuhren commented 5 years ago

Similar Issue here (ver. 15.0.2). Command line update to 16.0.1 says:

[✘] Delete old files failed
core/shipped.json is not available

Any ideas how to fix thix?

MorrisJobke commented 5 years ago

Any ideas how to fix thix?

Not really ... somehow the shipped.json was removed before it should, but code wise I can't explain it 🤔

marcelstoer commented 5 years ago

I keep seeing this with every NC upgrade.

First the upgrade fails because some (non-empty?) directories can not be removed e.g.

Could not rmdir /home/thingpul/nextcloud-data/updater-ocajd0capqkz/downloads/nextcloud/lib/l10n

Then I hit the 'Retry' upgrade button. Then NC is missing core/shipped.json so I create an empty file manually, hit 'Retry' again...and so on.

MorrisJobke commented 5 years ago

Could not rmdir /home/thingpul/nextcloud-data/updater-ocajd0capqkz/downloads/nextcloud/lib/l10n

Okay ... why can't it update the folder it just created? o.O

mlopezcoria commented 5 years ago

It happens to me too. I created /core/shipped.json and now updater show a new error message: Could not unlink: .../public_html/updater/../core/shipped.json

pirateszero92 commented 5 years ago

It happens to me too. I created /core/shipped.json and now updater show a new error message: Could not unlink: .../public_html/updater/../core/shipped.json

Same error, can we roll back ?

mlopezcoria commented 5 years ago

I managed to solve it fixing permissions: sudo chown -R apache:apache /nextcloud-dir/ Then I pressed Retry update again and it finished correctly.

pirateszero92 commented 5 years ago

I managed to solve it fixing permissions: sudo chown -R apache:apache /nextcloud-dir/ Then I pressed Retry update again and it finished correctly.

This is a good news to you, but i'm try to upgrade many times its still error.

now i'm roll back to 15.0.2.

RobertBuhren commented 5 years ago

Issue is still present when trying to update from 16.0.1 to 16.0.4

UkeFan commented 5 years ago

to 16.0.5 as well - but only in 1/4 of my 4 installations..

sankasan commented 4 years ago

I'm stuck on this issue with an update from 15.0.12 to 16.0.5.

I've tried fixing it by linking to ../data/updater-oc973db5j0hf/backups/nextcloud-15.0.12.1/core/shipped.json(of course with the right permissions) but the updater unlinks that file at some point and I get the same error again.

sankasan commented 4 years ago

I haven't been able to fix this in any clean way. On IRC there was a suggestion to test this method: https://github.com/nextcloud/updater/issues/145

However I worked around it by commenting out the deleteOldFiles() call after the files were removed (confirmed by looking at the directory via ssh) and restarted the updater/index.php process with the following hack:

            case 9:
                #$updater->deleteOldFiles();
                break;

The update completed. However I'm now looking at a blank screen instead of the nextcloud login page.... (seems to be a database driver issue in the required php update)

akwala commented 4 years ago

However I worked around it by commenting out the deleteOldFiles() call after the files were removed (confirmed by looking at the directory via ssh) and restarted the updater/index.php process with the following hack:

            case 9:
                #$updater->deleteOldFiles();
                break;

Got the error when trying to update 17.0.0 → 17.0.1. @sankasan's workaround got the update past this file but the "Delete old files" step is now reporting the following:

Parsing response failed. <p>The requested URI could not be accessed.</p> image

maximian888 commented 4 years ago

for me this happens from 17.02->18.02

had to reinstall nextcloud and install the new version, console upgrade hasn't worked - also with restarting from the beginning (data/upgrade-folder-rename), got stuck >>case 6

Zefling commented 4 years ago

Same problem for me: 18.0.4->18.0.6.

lin-b-github commented 3 years ago

I've experienced the same problems as others in this thread, which goes back to 11 April 2019 without any resolution.

I'm stuck at: Delete old files core/shipped.json is not available

2020-10-26_nextcloud_update_error

I think I'll just delete NextCloud until the team works through some of the fundamental bugs. NextCloud certainly has potential -- it's clearly still a beta project, though. I'll try it again in 1-2 years; maybe this bug will be fixed by then.

Edit: I was attempting to update from Nextcloud 19.0.0 to 19.0.4 (channel: "stable").

marcelstoer commented 3 years ago

First the upgrade fails because some (non-empty?) directories can not be removed e.g.

Could not rmdir /home/thingpul/nextcloud-data/updater-ocajd0capqkz/downloads/nextcloud/lib/l10n

Then I hit the 'Retry' upgrade button. Then NC is missing core/shipped.json so I create an empty file manually, hit 'Retry' again...and so on.

I upgraded from 16.something to the latest 20 the other day and this has been an issue with every single upgrade step.

  1. rmdir failing. The updater log reports https://github.com/nextcloud/updater/blob/master/index.php#L1060 as the origin. Why do you let it fail on non-empty dirs and don't use a recursive rmdir implementation instead? Particularly as you have recursiveDelete(folder) in this very script? However, IMO this should be addressed in #158.
  2. The core/shipped.json is reported missing multiple times; 5-6x per update. In about half of the cases core was still there and I could simply run touch shipped.json inside it. In the other half of the cases I had to re-create the core dir first.

Whether the two issues are connected or whether they even have the same root cause I can't assess. However, as this has happened to me with every single upgrade ever since I first installed NC (version 12 or so) it looks like the process runs wild.

caco3 commented 3 years ago

The issue is most likely a duplicate of https://github.com/nextcloud/updater/issues/158