Hosted upgrade from 8.2.10 -> 9.0.8 failed - what to do?

upgrade
hosting

#1

I am using ownCloud on a webhosted domain. Since I was still running version 8.2.0, I wanted to upgrade to the latest version (9.1.4).

To start, I moved my data directory to a separate folder outside of the old owncloud install folder, updated the config file accordingly and verified that the old owncloud installation (8.2.0) still worked.

After reading some, I figured I need to do the upgrade in smaller steps, so I first downloaded and unzipped version 8.2.10 to a new directory and copied config.php from the 8.2.0 folder to the 8.2.10 folder and opened the main oC web page from that new directory, which did the upgrade successfully (it warned about disabling some apps and I stayed on SQLite in case this matters). A quick test showed the 8.2.10 installation operational.

Then I wanted to move on to version 9.0.8, so I did the same again: downloaded and unzipped to a new directory, copied the config.php, opened the main web page from that new directory, found a bunch of updating information - which ended with the message "an error occurred - please reload the page". Which I did and now all I get is a "maintenance mode" message.

Could anyone please advise me what to do now? There is no error message or log file I could find that might point to the source of the problem, so I am really stuck right now.

Thank you!


Stuck in update 8.2 --> 9.08 via Updater
#2

So far your steps to upgrade look good. You can try to disable the maintenance mode (open the config/config.php-file and set 'maintenance' to false. If you try to open owncloud again, look at your logfile, if any new events are logged.


#3

Thank you. Where do I find the logfile for oC?

In the meantime, here's something new I tried: I kept the original 9.0.8 installation, opened the main page and created an admin account. No errors for this. Then I copied the config.php from my 8.2.10 installation and re-opened the main oC page. This, again produced the upgrade message followed by a non-descript error message:

Edit: I tried what you suggested (setting maintenance to false), but all I got was again the upgrade screen, followed by the above upgrade report and error...

FWIW, there are not related entries in my PHP error log...


#4

There are quite a lot information about that available here at the forums [1] as well as the documentation [2]. Both are the first starting points when having such questions.

[1]

[2] https://doc.owncloud.org/server/latest/admin_manual/issues/general_troubleshooting.html#owncloud-logfiles


#5

Thank you.

This is a hosted webserver, so I do not have access to the internal web server logs. I do have access to the PHP logs and found nothing there.

I tried to enable log files for owncloud using config.php, but whenever I set maintenance to false, oC will restart the upgrade procedure, which also makes changes to the config.php and reports "Set log level to debug". So far, I have not yet found a single line of text in the owncloud.log file (0 bytes long).

Here's a part of my config.php:

  'dbtype' => 'sqlite3',
  'version' => '8.2.10.2',
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_from_address' => 'owncloud',
  'mail_smtpmode' => 'php',
  'mail_domain' => 'xxxxx.net',
  'loglevel' => 0,
  'theme' => '',
  'maintenance' => true,
  'log_type' => 'owncloud',
  'logfile' => 'owncloud.log',
  'logdateformat' => 'F d, Y H:i:s',
  'debug' => true,

As describe above, setting 'maintenance ' => false, will cause the upgrade procedure to restart, so I am running in circles. None of this produces any log output...


#6

You don't need to configure anything for the ownCloud logs. They just end up by default in your data/owncloud.log as shown the second link:

The logfile of ownCloud is located in the data directory owncloud/data/owncloud.log.


#7

There seems to be lots of contradicting information regarding log files.

Here's what I tried:

I used the original config.php as installed by version 9.0.8, so oC is NOT using any of my existing data. I deleted all occurrences of owncloud.log. Then I added these lines to config.php:

  'debug' => true,
  "log_type" => "owncloud",
"logfile" => "owncloud.log",
"loglevel" => "0",
"logdateformat" => "F d, Y H:i:s",

Next, I opened the main oC page and logged in as administrator. This created a zero-byte owncloud.log in the main install folder of oC 9.0.8. No log file in data folder.
Siwtching to the 'Users' page and then logging out as admin added one line to the owncloud/owncloud.log file with message":"A session had already been started - ignoring session_start()" - which I believe is unrelated to the current issue.

But it just shows that the log file is NOT in owncloud/data,
Also, I would have expected a lot more details in the log file?

Edit: It turns out there are multiple owncloud.log files floating around, so something definitely isn't as documented: ocs/owncloud.log, core/ajax/owncloud.log, owncloud.log


#8

OK. Now I started from scratch and unzipped the original zip for oC 9.0.8.
I renamed my existing oC installation (the old 8.2.0 version) and named the folder of 9.0.8 identical to the original folder. Then I copied config.php to the new install so it would realize that data is using the older format. Thus, opening the main oC page brought up the usual upgrade screen. And also the usual non-descript error message.
It DID produce an owncloud.log file in data, which contains a single line:

{"reqId":"XXX","remoteAddr":"178.7.XXX.YYY","app":"core","message":"starting upgrade from 8.2.10.2 to 9.0.8.2","level":0,"time":"2017-03-18T17:51:32+00:00","method":"GET","url":"\/oc\/core\/ajax\/update.php?requesttoken=XXX","user":"--"}

So, aside from finally having something like a log file, I am back to square one.

Any ideas?


#9

Without any matching error in your owncloud.og to the "An error occured" in the first screenshot its not possible to help here. The entry you had posted doesn't say something about any error so normally it should continue now.


#10

Well, thanks for trying. I can assure you it is not working, otherwise I would not waste your time here.

The only alternative I see right now is to manually recreate user accounts, copy data and hope I am not missing anything, in order to upgrade to the latest version?


#11

Just have missed the following in your initial post:

Most likely you're issue is caused by this. You can't move the data directory after the installation, especially on older versions of ownCloud (there where a lot of hardcoded stuff in the database).

So your best change is probably to revert your change to a clean / working state before you did the move of the data directory (revert to your 8.2.0 backup including the database backup). And then start again with the upgrade by:

  1. Removing all files and folders except /data/ and /config/
  2. Extract the 8.2.10 archive into your installation folder
  3. Run the upgrade routine

Then redo this steps for 9.0.8 and 9.1.4 and you should get a working state.


#12

OK, will try that. The problem is that my data directory is almost 1GB of files, so it's hard to copy/make backups.
When and what is the correct procedure to move the data folder outside of the owncloud installation then? And is there also a way to change the database engine from Sqlite to MySQL?

Thanks!


#13

On recent versions like 9.1.4 it might work by following the documentation in [1]. This needs manual modifications within the database to make it work.

Yes, as shown in the documentation [2]. But only if you have access to the command line.

[1] https://doc.owncloud.org/server/10.0/admin_manual/maintenance/manually-moving-data-folders.html

[2] https://doc.owncloud.org/server/latest/admin_manual/configuration_database/db_conversion.html


#14

OK, next round of problems (astonishing how difficult it is to upgrade this software...):

I did as you suggested, and restored my old, working installation of oC 8.2.0.

Next, I deleted everything but the config and the data folder (now back again inside the owncloud install folder) and copied all the files from a fresh copy of oC 8.2.10 into the same folder. Opened the main oC page, did the upgrade (with "some warnings") and had a working install of 8.2.10, similar to my previous attempt above.

Next, I unzipped a fresh copy of oC 9.0.8. Since I don't trust that version yet (see above), I did not delete my brand new, working installation of 8.2.10, but rather renamed the folder of 8.2.10, then named the folder containing 9.0.8 to my main oC folder name, and then copied the config and data folder from the 8.2.10 installation over into the 9.0.8 folder.
Got the upgrade screen and ran the update, again with an error message at the end:

There are also some entries in the owncloud.log file (now correctly placed inside of data). Since I am not allow to upload the file as attachment, I'll try in the next post.

A reload just brings up the maintenance screen, as before. Manually editing config.php to get out of maintenance as suggested before just re-runs all of this and I end up with the same error again.


#15

Here's the anonymized end of owncloud.log (still cannot upload the file, so I'll copy-paste it in here, apologies for the mess):

{"reqId":"XXX1","remoteAddr":"111.222.333.444","app":"core","message":"starting upgrade from 8.2.0.12 to 8.2.10.2","level":0,"time":"2017-03-18T20:16:26+00:00","method":"GET","url":"\/oc\/core\/ajax\/update.php?requesttoken=Q1"}
{"reqId":"XXX1","remoteAddr":"111.222.333.444","app":"no app in context","message":"Exception: {\"Exception\":\"Symfony\\\\Component\\\\Routing\\\\Exception\\\\RouteNotFoundException\",\"Message\":\"Unable to generate a URL for the named route \\\"calendar_index\\\" as such route does not exist.\",\"Code\":0,\"Trace\":\"#0 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/route\\\/router.php(325): Symfony\\\\Component\\\\Routing\\\\Generator\\\\UrlGenerator->generate('calendar_index', Array, false)\\n#1 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/urlgenerator.php(65): OC\\\\Route\\\\Router->generate('calendar_index', Array)\\n#2 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/helper.php(66): OC\\\\URLGenerator->linkToRoute('calendar_index', Array)\\n#3 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/public\\\/util.php(301): OC_Helper::linkToRoute('calendar_index', Array)\\n#4 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/apps\\\/calendar\\\/appinfo\\\/app.php(25): OCP\\\\Util::linkToRoute('calendar_index')\\n#5 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php(160): require_once('\\\/homepages\\\/YY\\\/d...')\\n#6 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php(141): OC_App::requireAppFile('calendar')\\n#7 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php(1171): OC_App::loadApp('calendar', false)\\n#8 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/installer.php(222): OC_App::updateApp('calendar')\\n#9 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/installer.php(252): OC_Installer::updateApp(Array)\\n#10 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/updater.php(506): OC_Installer::updateAppByOCSId('168707')\\n#11 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/updater.php(320): OC\\\\Updater->upgradeAppStoreApps(Array)\\n#12 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/updater.php(202): OC\\\\Updater->doUpgrade('8.2.10.2', '8.2.0.12')\\n#13 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/core\\\/ajax\\\/update.php(111): OC\\\\Updater->upgrade()\\n#14 {main}\",\"File\":\"\\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/3rdparty\\\/symfony\\\/routing\\\/Symfony\\\/Component\\\/Routing\\\/Generator\\\/UrlGenerator.php\",\"Line\":134}","level":3,"time":"2017-03-18T20:16:31+00:00","method":"GET","url":"\/oc\/core\/ajax\/update.php?requesttoken=KK%LL"}
{"reqId":"XXX1","remoteAddr":"111.222.333.444","app":"no app in context","message":"Exception: {\"Exception\":\"Symfony\\\\Component\\\\Routing\\\\Exception\\\\RouteNotFoundException\",\"Message\":\"Unable to generate a URL for the named route \\\"contacts_index\\\" as such route does not exist.\",\"Code\":0,\"Trace\":\"#0 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/route\\\/router.php(325): Symfony\\\\Component\\\\Routing\\\\Generator\\\\UrlGenerator->generate('contacts_index', Array, false)\\n#1 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/urlgenerator.php(65): OC\\\\Route\\\\Router->generate('contacts_index', Array)\\n#2 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/helper.php(66): OC\\\\URLGenerator->linkToRoute('contacts_index', Array)\\n#3 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/public\\\/util.php(301): OC_Helper::linkToRoute('contacts_index', Array)\\n#4 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/apps\\\/contacts\\\/appinfo\\\/app.php(18): OCP\\\\Util::linkToRoute('contacts_index')\\n#5 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php(160): require_once('\\\/homepages\\\/YY\\\/d...')\\n#6 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php(141): OC_App::requireAppFile('contacts')\\n#7 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php(1171): OC_App::loadApp('contacts', false)\\n#8 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/installer.php(222): OC_App::updateApp('contacts')\\n#9 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/installer.php(252): OC_Installer::updateApp(Array)\\n#10 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/updater.php(506): OC_Installer::updateAppByOCSId('168708')\\n#11 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/updater.php(320): OC\\\\Updater->upgradeAppStoreApps(Array)\\n#12 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/updater.php(202): OC\\\\Updater->doUpgrade('8.2.10.2', '8.2.0.12')\\n#13 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/core\\\/ajax\\\/update.php(111): OC\\\\Updater->upgrade()\\n#14 {main}\",\"File\":\"\\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/3rdparty\\\/symfony\\\/routing\\\/Symfony\\\/Component\\\/Routing\\\/Generator\\\/UrlGenerator.php\",\"Line\":134}","level":3,"time":"2017-03-18T20:16:36+00:00","method":"GET","url":"\/oc\/core\/ajax\/update.php?requesttoken=KK%LL"}
{"reqId":"XXX2","remoteAddr":"111.222.333.444","app":"index","message":"Exception: {\"Exception\":\"OC\\\\NeedsUpdateException\",\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php(117): OC_App::loadApp('files')\\n#1 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/util.php(142): OC_App::loadApps(Array)\\n#2 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/base.php(906): OC_Util::setupFS()\\n#3 \\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/index.php(47): OC::handleRequest()\\n#4 {main}\",\"File\":\"\\\/homepages\\\/YY\\\/UU\\\/htdocs\\\/oc\\\/lib\\\/private\\\/app.php\",\"Line\":142}","level":3,"time":"2017-03-18T20:29:08+00:00","method":"GET","url":"\/oc\/index.php\/core\/js\/oc.js?v=OO","user":"--"}
{"reqId":"XXX3","remoteAddr":"111.222.333.444","app":"core","message":"starting upgrade from 8.2.10.2 to 9.0.8.2","level":0,"time":"2017-03-18T20:29:14+00:00","method":"GET","url":"\/oc\/core\/ajax\/update.php?requesttoken=BBBB","user":"--"}
{"reqId":"XXX3","remoteAddr":"111.222.333.444","app":"core","message":"No update found at the ownCloud appstore for app 166054","level":0,"time":"2017-03-18T20:29:17+00:00","method":"GET","url":"\/oc\/core\/ajax\/update.php?requesttoken=BBBB","user":"--"}

I hope someone can make anything out of this?


#16

Possible that the update script runs too long and gets a timeout? Your provider doesn't give you any error logs (in some folder or their own interface)?


#17

I do get PHP error logs, which do not contain anything at the moment.
What makes you think there is a timeout?

Also note that the upgrade from 8.2.0 to 8.2.10 worked just fine.


#18

If you change the structure of a table and this table contains a lot of lines, this can take very long and many providers have set a timeout which might be shorter. However I'm wondering because it is happening for the additional apps. Do you use the news app? Any very large tables? How large is your total database?


#19

I am not aware of any special apps I installed. Nor do I know anything about large tables in my ownCloud installation. I am using it mostly to store files in the private cloud.

How can I find out the size of my database? My oC install is using Sqlite if that matters, and the data folder has a total size of about 500 MB (now that I have purged some deleted files etc.)

Edit: owncloud.db is 1.3MB if that is of any help?

Edit2: Now this board won't allow me another post for the next 15 hours... go figure!!

So, I have basically spent the entire day today trying to upgrade my existing oC installation.
Although I did not get anywhere really (the upgrade to 8.2.10 was already working before I posted here) I'd like to thank @kljhlkhglklfgh and @tflidd very much for their support!

Maybe I can get this still to work, but for today I am done (and sobered by the amount of work needed for such a standard operation as upgrading to a newer version). I realize that a hosted server without shell access isn't the best environment for these things but from the success I had with oC in the past, I would not have expected this to be so much effort...


#20

For me it seems to be a reasonable size. Sqlite performance is not great but your setup should be sufficiently small that it should handle such upgrades. @PVince81

You can still migrate the setup to a local virtual machine, run the upgrade and then migrate back. But that's not a very simple procedure (except if you are a Linux expert, this shouldn't be very difficult)... But in this case you can't complain if people say that OC upgrades are difficult.