core icon indicating copy to clipboard operation
core copied to clipboard

Migrate 4.5.5 to 5.0.4 (query_time values incorrect in mysql)

Open 4bendo opened this issue 13 years ago • 10 comments

I've used OC since 4.0.x versions and have yet to upgrade/update successfully over 3-5 upgrades. In all past attempts I end up deleting mysql database and let OC rebuild the database in the new version to use the new version.

Currently, I have a stable OC4.5.5 install on:

Win8 IIS8 Mysql 5.5.28 PHP5.3.19

After seeing that things may have become more stable and I want to try new features with the 5.x line of OC. I decide to try and upgrade.

I use this page to upgrade:
http://doc.owncloud.org/server/5.0/admin_manual/maintenance/update.html

My first try is to follow instructions for upgrade to 4.5.9. This ends in failure even though I follow all the directions correctly. The error when I reload OC browser page is "Error while upgrading the database" Every time in the past that I try to update I have gotten this error. I cannot figure out what I must do to in order to update the database properly. My past solution is to delete the database, and let OC reconfigure a new one.

Then I restore backups and confirm that original 4.5.5 is working properly...it does.

My second try is to go directly to 5.0.4. I follow again the directions on the OC documentation page listed above, except I do not try to update to 4.5.9 as suggested in the directions since we found this already doesn't work. When I copy all new files and confirm permissions I get the following error in OC brower page "ownCloud is in maintenance mode". I change the switch in the config.php file to "false" for maintenance mode and retry. I then get:

Turned on maintenance mode Failed to get existing database structure for updating (MDB2_Schema Error: schema validation error, default value of "query_time" is incorrect: "" is not of type "time")

I don't know much about configuring databases, and as such don't do any backdoor tweaks. The mysql db created has been from OC.

OC log

{"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/,C:\Windows\Temp/owncloud-50d73b02db0f1/): Access is denied. (code: 5) at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/): failed to open dir: No such file or directory at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"readdir() expects parameter 1 to be resource, boolean given at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#72","level":2,"time":1366179966} {"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/,C:\Windows\Temp/owncloud-50d73b02db0f1/): Access is denied. (code: 5) at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/): failed to open dir: No such file or directory at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"readdir() expects parameter 1 to be resource, boolean given at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#72","level":2,"time":1366179966} {"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/,C:\Windows\Temp/owncloud-50d73b02db0f1/): Access is denied. (code: 5) at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/): failed to open dir: No such file or directory at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"readdir() expects parameter 1 to be resource, boolean given at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#72","level":2,"time":1366179966} {"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/,C:\Windows\Temp/owncloud-50d73b02db0f1/): Access is denied. (code: 5) at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"opendir(C:\Windows\Temp/owncloud-50d73b02db0f1/): failed to open dir: No such file or directory at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#71","level":2,"time":1366179966} {"app":"PHP","message":"readdir() expects parameter 1 to be resource, boolean given at C:\inetpub\wwwroot\owncloud\lib\cache\fileglobal.php#72","level":2,"time":1366179966} {"app":"PHP","message":"Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context at C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php#2794","level":2,"time":1366179968} {"app":"PHP","message":"Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context at C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php#2794","level":2,"time":1366179968} {"app":"core","message":"Failed to get existing database structure for updating (MDB2_Schema Error: schema validation error, default value of "query_time" is incorrect: "" is not of type "time")","level":4,"time":1366179968}

php log

[16-Apr-2013 05:54:00 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [16-Apr-2013 05:54:00 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [16-Apr-2013 05:54:19 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [16-Apr-2013 05:54:19 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [16-Apr-2013 05:55:57 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [16-Apr-2013 05:55:57 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [16-Apr-2013 06:22:00 UTC] PHP Fatal error: Call to undefined method OC\Files\View::is_readable() in C:\inetpub\wwwroot\owncloud\lib\filecache.php on line 451 [16-Apr-2013 19:15:07 UTC] PHP Fatal error: Call to undefined method OC\Files\View::is_readable() in C:\inetpub\wwwroot\owncloud\lib\filecache.php on line 451 [16-Apr-2013 19:15:10 UTC] PHP Fatal error: Call to undefined method OC\Files\View::is_readable() in C:\inetpub\wwwroot\owncloud\lib\filecache.php on line 451 [16-Apr-2013 19:15:13 UTC] PHP Fatal error: Call to undefined method OC\Files\View::is_readable() in C:\inetpub\wwwroot\owncloud\lib\filecache.php on line 451 [17-Apr-2013 03:03:35 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [17-Apr-2013 03:03:35 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [17-Apr-2013 03:04:52 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [17-Apr-2013 03:04:52 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [17-Apr-2013 03:05:02 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [17-Apr-2013 03:05:02 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794

4bendo avatar Apr 17 '13 06:04 4bendo

Failed to get existing database structure for updating (MDB2_Schema Error: schema validation error, default value of "query_time" is incorrect: "" is not of type "time")

"query_time" doesn't seem to come from any tables in core or the shipped apps. Please try to disable any 3rdparty apps before updating, then enable them one at a time afterwards to find which fails.

tanghus avatar Apr 17 '13 09:04 tanghus

Yes, not a core issue :) grepped through all the apps and directories and i dont find it there

BernhardPosselt avatar Apr 17 '13 10:04 BernhardPosselt

I disabled all third party apps and have only internal apps enabled. I will try to disable all apps and see if it will migrate.

4bendo avatar Apr 17 '13 17:04 4bendo

UPDATE:

I restored to previous working 4.5.5 I disabled all apps(internal and 3rd party). I cleaned the php log and owncloud logs so that no extranious info is left and try to apply 4.5.9 update. I copy all 4.5.9 files/folder except "config" to replace 4.5.5 files/folders. I confirm permissions are OK I reload page and get "Error while upgrading the database" which is same problem as before listed in the original post above.

OC log looks like:

{"app":"core","message":"Failed to get existing database structure for upgrading (MDB2_Schema Error: schema validation error, default value of "query_time" is incorrect: "" is not of type "time")","level":4,"time":1366219519}

PHP log looks like:

[17-Apr-2013 17:25:19 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794 [17-Apr-2013 17:25:19 UTC] PHP Strict Standards: Non-static method MDB2_Schema::errorMessage() should not be called statically, assuming $this from incompatible context in C:\inetpub\wwwroot\owncloud\3rdparty\MDB2\Schema.php on line 2794

4bendo avatar Apr 17 '13 17:04 4bendo

can you check which table contains the column query_time?

BernhardPosselt avatar Apr 17 '13 17:04 BernhardPosselt

I do not know much about mysql. Can you tell me the best way to find this? Sorry to be so incapable.

On Wed, Apr 17, 2013 at 10:40 AM, Bernhard Posselt <[email protected]

wrote:

can you check which table contains the column query_time?

— Reply to this email directly or view it on GitHubhttps://github.com/owncloud/core/issues/2959#issuecomment-16520911 .

4bendo avatar Apr 17 '13 17:04 4bendo

Install phpmyadmin

BernhardPosselt avatar Apr 17 '13 17:04 BernhardPosselt

I found some mysql commands by google. I will try phpmyadmin too.

query_time is in table 'slow_log'

4bendo avatar Apr 17 '13 17:04 4bendo

Dropped the table 'slow_log' and update process worked just fine. Not sure where this comes from, since my installations have only been from official OC release packages.

4bendo avatar Apr 17 '13 20:04 4bendo

maybe from a very old installation

BernhardPosselt avatar Apr 17 '13 20:04 BernhardPosselt