-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
problem upgrading from 6.0.4 sqlite to 7.0.rc3: SQLSTATE[HY000]: General error: 1 no such column: permissions #9766
Comments
Did you already convert the database to MySQL or are these errors still from SQLite ? |
It looks like the upgrade process did not correctly update the database tables. How did you upgrade ? Did you use:
It would help if you could use the issue template: https://raw.githubusercontent.com/owncloud/core/master/issue_template.md |
CC @icewind1991 @bantu @DeepDiver1975 not sure why the update would miss a table. |
Thanks for the tips. We want to migrate to mysql but I was trying the sqlite version first, so I changed nothing in the config file. Since, these errors come from sqlite, sorry if I was not clear about that. What I did for upgrading was to replace the source code with the new one by hand (keeping the config and data dirs, option 3). The first time the updater app was enabled (I just tried the upgrade process again with the updater app disabled and happened exactly the same). After the migration process and before the things mentioned before there are a lot of messages in the owncloud.log file that may have some importance: {"reqId":"53cd6a727166f","app":"user_ldap","message":"starting app upgrade from 0.4.2 to 0.4.3","level":0,"time":"2014-07-21T19:30:58+00:00","method":"GET","url":"/owncloud/"} {"reqId":"53cd6a727166f","app":"files","message":"starting app upgrade from 1.1.7 to 1.1.9","level":0,"time":"2014-07-21T19:30:59+00:00","method":"GET","url":"/owncloud/"} {"reqId":"53cd6a727166f","app":"activity","message":"starting app upgrade from 1.1.2 to 1.1.22","level":0,"time":"2014-07-21T19:30:59+00:00","method":"GET","url":"/owncloud/"} {"reqId":"53cd6a727166f","app":"files_sharing","message":"starting app upgrade from 0.3.5 to 0.5.3","level":0,"time":"2014-07-21T19:31:00+00:00","method":"GET","url":"/owncloud/"} {"reqId":"53cd6a727166f","app":"files_trashbin","message":"starting app upgrade from 0.5 to 0.6.2","level":0,"time":"2014-07-21T19:31:01+00:00","method":"GET","url":"/owncloud/"} {"reqId":"53cd6a727166f","app":"core","message":"Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 6 database table is locked' in / {"reqId":"53cd6a727166f","app":"index","message":"RuntimeException: Fall\u00f3 la actualizaci\u00f3n "files_sharing".","level":4,"time":"2014-07-21T19:31:01+00:00","method":"GET","url":"/ {"reqId":"53cd6a75ab8e2","app":"files_sharing","message":"starting app upgrade from 0.3.5 to 0.5.3","level":0,"time":"2014-07-21T19:31:01+00:00","method":"POST","url":"/owncloud/index.php {"reqId":"53cd6a75ab8e2","app":"files_trashbin","message":"starting app upgrade from 0.5 to 0.6.2","level":0,"time":"2014-07-21T19:31:02+00:00","method":"POST","url":"/owncloud/index.php/ {"reqId":"53cd6a75ab8e2","app":"files_versions","message":"starting app upgrade from 1.0.3 to 1.0.5","level":0,"time":"2014-07-21T19:31:02+00:00","method":"POST","url":"/owncloud/index.php {"reqId":"53cd6a75ab8e2","app":"gallery","message":"starting app upgrade from 0.5.3 to 0.5.4","level":0,"time":"2014-07-21T19:31:02+00:00","method":"POST","url":"/owncloud/index.php/core/ajax/translations.php"} And many other related to ldap and similar to this one: Or this one: Always ending the log with these kind of messages; {"reqId":"53cd780e7016d","app":"index","message":"DatabaseException: An exception occurred while executing 'UPDATE "oc_filecache" SET "permissions"=? WHERE "fileid" = ?':\n\nSQLSTATE[HY000]: General error: 1 no such column: permissions","level":4,"time":"2014-07-21T20:29:02+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"} {"reqId":"53cd780f4385e","app":"search_lucene","message":"searching hits for pk:4ce5b14977b9b7f1e15adbcb9c8effb5","level":0,"time":"2014-07-21T20:29:03+00:00","method":"GET","url":"/owncloud/cron.php"} {"reqId":"53cd780f4385e","app":"search_lucene","message":"found 0 hits ","level":0,"time":"2014-07-21T20:29:03+00:00","method":"GET","url":"/owncloud/cron.php"} {"reqId":"53cd781b42a13","app":"PHP","message":"Undefined index: permissions at /var/www/owncloud-7.0rc3/lib/private/files/cache/cache.php#156","level":3,"time":"2014-07-21T20:29:15+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"} {"reqId":"53cd781b42a13","app":"index","message":"DatabaseException: An exception occurred while executing 'UPDATE "oc_filecache" SET "permissions"=? WHERE "fileid" = ?':\n\nSQLSTATE[HY000]: General error: 1 no such column: permissions","level":4,"time":"2014-07-21T20:29:15+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"} As you probably have seen now in this new group of logs, there is a log line I hadn't seen before that says that the database is locked. I have searched the way of unlocking the db but I couldn't... Neither with the sqlite3 dump command (echo ".dump" | sqlite3 owncloud.db | sqlite3 owncloud.new.db and then replacing one with the other and restoring permissions and owners). The process is fully repeatable and during the updating process I can see two errors in the navigator window. The first one says: The second one appears later if I reload again the page in navigator: I've searched the first error message with files_sharing error and it seems to be solved (#5758). I even tryed the solution proposed by Thanks for your time and your effort. Looking forward your answer... Omar PS: Some logs are from different timings because of the many tests I did. If you would like to have a complete log let me know. |
Hmmm strange. The problem with SQLite is usually that the database can be locked if someone is still accessing it (I believe it's for write operations). How many users do you have ? I suggest to stop the web server first to "kick out" all users and make sure that all running processes are terminated. Also make sure that no web server process is still running after termination. After that, update the code as you did before, but do it BEFORE restarting the web server. @DeepDiver1975 @icewind1991 @karlitschek we should probably change the update docs to tell people to stop the web server if possible to make sure that all existing stalling connections are stopped. |
I'd generally agree - with the exception in the scenario where upgrade is executed from the web ui. |
@omarwllorente did you happen to upgrade using the command line |
Hi @PVince81, thanks for your tips. Yesterday I had no time to keep trying the update, sorry. Today I did what you suggested (after assuring that the sqlite owncloud.db was not being used by anyone and therefore was not locked anyway) and here is what I got: root@drop-new:/var/www/owncloud# service apache2 stop
root@drop-new:/var/www/owncloud# cd data root@drop-new:/var/www/owncloud/data# echo ".dump" | sqlite3 owncloud.db | sqlite3 owncloud.new.db root@drop-new:/var/www/owncloud/data# mv owncloud.db owncloud.old.db; mv owncloud.new.db owncloud.db; chmod 770 owncloud.db; chown www-data.www-data owncloud.db root@drop-new:/var/www/owncloud/data# cd .. root@drop-new:/var/www/owncloud# su -c "/usr/bin/php /var/www/owncloud/occ update" www-data An unhandled exception has been thrown: Next exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'DROP INDEX ldap_dn_users': SQLSTATE[HY000]: General error: 6 database table is locked' in /var/www/owncloud-7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:47 Next exception 'RuntimeException' with message 'Failed to upgrade "user_ldap".' in /var/www/owncloud-7.0rc3/lib/private/app.php:985 Next exception 'RuntimeException' with message 'Failed to upgrade "files_sharing".' in /var/www/owncloud-7.0rc3/lib/private/app.php:985 Is there any other way to update? Is there any way to import data from an old server other than updating? Thanks a lot. Omar |
Hi everyone. Seeing the above error (Next exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'DROP INDEX ldap_dn_users':) and continuing with the upgrading process testing I did the following from a fresh copy of the actual 6.0.4 installation (previously deleting all the ldap server configuration through the administration web interface): root@drop-new:/var/www/owncloud/data# rm -f owncloud.log root@drop-new:/var/www/owncloud/data# echo ".dump" | sqlite3 owncloud.db | sqlite3 owncloud.new.db root@drop-new:/var/www/owncloud/data# mv owncloud.db owncloud.old.db; mv owncloud.new.db owncloud.db; chmod 700 owncloud.db ; chown www-data.www-data owncloud.db root@drop-new:/var/www/owncloud/data# sqlite3 owncloud.db
And then triggered the upgrading process by navigating to the owncloud page resulting in the message: What I got in the owncloud.log was the following: root@drop-new:/var/www/owncloud/data# cat owncloud.log Besides, if I try to update manually, I get the following: root@drop-new:/var/www/owncloud/data# su -c "/usr/bin/php /var/www/owncloud/occ update" www-data [InvalidArgumentException] () Any tips would be very much appreciated. Regards, Omar |
Only for future reference, after all, we have installed a new and clean owncloud 7 with mysql connection. We lost all the share information, but it works fine. Thanks. Omar |
@omarwllorente there was an issue in OC 7.0.0 that if multiple clients are connecting to the server during the upgrade it would run the upgrade multiple times in parallel. This should be fixed in OC 7.0.1. Your logs above seem to confirm it: you got "database is locked". For more than 2-3 users it is recommended to use MySQL instead, which you did. |
Hi, Vincent. All the tests I did where on a virtual machine without clients and the That's why I think that was the upgrading process who locked the db... Thanks Omar
|
Hi everybody, we are trying to upgrade owncloud to 7.0r3 from 6.0.4. We are using sqlite (which is working well unless we have some database lock problems). The server is an ubuntu 14.04 up to date.
We are trying to upgrade the server in order to change the database system to mysql. I have read that the database migration is provided by the owncloud server and I will try that when the owncloud server comes to life again.
Later you can see the logs. We have backups and we can go back to the 6.0.4 version or re-do the upgrading process if you think is necessary.
Please, send us some advise.
Thanks a lot.
Omar
An exception occurred while executing 'UPDATE "oc_filecache" SET "permissions"=? WHERE "fileid" = ?': SQLSTATE[HY000]: General error: 1 no such column: permissions
{"reqId":"53cd62378e631","app":"PHP","message":"Undefined index: permissions at /var/www/owncloud-7.0rc3/lib/private/files/cache/cache.php#156","level":3,"time":"2014-07-21T18:55:51+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"}
{"reqId":"53cd62378e631","app":"index","message":"DatabaseException: An exception occurred while executing 'UPDATE "oc_filecache" SET "permissions"=? WHERE "fileid" = ?':\n\nSQLSTATE[HY000]: General error: 1 no such column: permissions","level":4,"time":"2014-07-21T18:55:51+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"}
The text was updated successfully, but these errors were encountered: