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

problem upgrading from 6.0.4 sqlite to 7.0.rc3: SQLSTATE[HY000]: General error: 1 no such column: permissions #9766

Closed
omarwllorente opened this issue Jul 21, 2014 · 12 comments

Comments

@omarwllorente
Copy link

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

  • The error we get in the navigator window is the following:
    An exception occurred while executing 'UPDATE "oc_filecache" SET "permissions"=? WHERE "fileid" = ?': SQLSTATE[HY000]: General error: 1 no such column: permissions
  • What we get in the owncloud.log file is the following:
    {"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/"}
@PVince81
Copy link
Contributor

Did you already convert the database to MySQL or are these errors still from SQLite ?

@PVince81
Copy link
Contributor

It looks like the upgrade process did not correctly update the database tables.
In OC 7 RC 3 the table oc_filecache contains a new column permissions.

How did you upgrade ? Did you use:

  1. the updater app
    OR
  2. the distribution's package manager
    OR
  3. replaced the source code with the new one by hand (keeping the "config" and "data" dirs)

It would help if you could use the issue template: https://raw.githubusercontent.com/owncloud/core/master/issue_template.md

@PVince81
Copy link
Contributor

CC @icewind1991 @bantu @DeepDiver1975 not sure why the update would miss a table.
Let's see once we get more information.

@omarwllorente
Copy link
Author

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 /
var/www/owncloud-7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:742\nStack trace:\n#0 [internal function]: PDO->query('DROP INDEX id_i...')\n#1 /var/www/owncloud-
7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(742): call_user_func_array(Array, Array)\n#2 /var/www/owncloud-7.0rc3/lib/private/db/migrator.php(179): Doctrine\DBAL\Connection->query('DROP INDEX id_i...')\n#3 /var/www/owncloud-7.0rc3/lib/private/db/migrator.php(35): OC\DB\Migrator->applySchema(Object(Doctrine\DBAL\Schema\Schema))\n#4
/var/www/owncloud-7.0rc3/lib/private/db/mdb2schemamanager.php(98): OC\DB\Migrator->migrate(Object(Doctrine\DBAL\Schema\Schema))\n#5 /var/www/owncloud-7.0rc3/lib/private/db.php(320): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...')\n#6 /var/www/owncloud-7.0rc3/lib/private/app.php(1172): OC_DB::updateDbFromStructure('/var/www/ownclo...')\n#7 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('files_trashbin')\n#8 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_trashbin')\n#9 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_trashbin')\n#10 /var/www/owncloud-7.0rc3/lib/private/util.php(72): OC_App::loadApps(Array)\n#11 /var/www/owncloud-7.0rc3/lib/private/files/filesystem.php(800): OC_Util::setupFS()\n#12 /var/www/owncloud-7.0rc3/lib/autoloader.php(142): require_once('/var/www/ownclo...')\n#13 [internal function]: OC\Autoloader->load('OC\Files\Filesy...')\n#14 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(90): spl_autoload_call('OC\Files\Filesy...')\n#15 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(10): removeSharedFolder()\n#16 /var/www/owncloud-7.0rc3/lib/private/app.php(1179): include('/var/www/ownclo...')\n#17 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('files_sharing')\n#18 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_sharing')\n#19 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_sharing')\n#20 /var/www/owncloud-7.0rc3/lib/base.php(705): OC_App::loadApps(Array)\n#21 /var/www/owncloud-7.0rc3/index.php(28): OC::handleRequest()\n#22 {main}\n\nNext exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing'DROP INDEX id_index':\n\nSQLSTATE[HY000]: General error: 6 database table is locked' in /var/www/owncloud-7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:47\nStack trace:\n#0 /var/www/owncloud-7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(744): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException),
'DROP INDEX id_i...')\n#1 /var/www/owncloud-7.0rc3/lib/private/db/migrator.php(179): Doctrine\DBAL\Connection->query('DROP INDEX id_i...')\n#2 /var/www/owncloud-7.0rc3/lib/pri
vate/db/migrator.php(35): OC\DB\Migrator->applySchema(Object(Doctrine\DBAL\Schema\Schema))\n#3 /var/www/owncloud-7.0rc3/lib/private/db/mdb2schemamanager.php(98): OC\DB\Migrator->migrate(Object(Doctrine\DBAL\Schema\Schema))\n#4 /var/www/owncloud-7.0rc3/lib/private/db.php(320): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...')\n#5/var/www/owncloud-7.0rc3/lib/private/app.php(1172): OC_DB::updateDbFromStructure('/var/www/ownclo...')\n#6 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('files_trashbin')\n#7 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_trashbin')\n#8 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_trashbin')\n#9 /var/www/owncloud-7.0rc3/lib/private/util.php(72): OC_App::loadApps(Array)\n#10 /var/www/owncloud-7.0rc3/lib/private/files/filesystem.php(800): OC_Util::setupFS()\n#11 /var/www/owncloud-7.0rc3/lib/autoloader.php(142): require_once('/var/www/ownclo...')\n#12 [internal function]: OC\Autoloader->load('OC\Files\Filesy...')\n#13 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(90): spl_autoload_call('OC\Files\Filesy...')\n#14 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(10): removeSharedFolder()\n#15 /var/www/owncloud-7.0rc3/lib/private/app.php(1179): include('/var/www/ownclo...')\n#16 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('files_sharing')\n#17 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_sharing')\n#18 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_sharing')\n#19 /var/www/owncloud-7.0rc3/lib/base.php(705): OC_App::loadApps(Array)\n#20 /var/www/owncloud-7.0rc3/index.php(28): OC::handleRequest()\n#21 {main})"
,"level":4,"time":"2014-07-21T19:31:01+00:00","method":"GET","url":"/owncloud/"}

{"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":"/
owncloud/"}

{"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
/core/ajax/translations.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/
core/ajax/translations.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
/core/ajax/translations.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:
{"reqId":"53cd6a727166f","app":"user_ldap","message":"readAttribute: cn=xxxx,ou=groups,dc=dit,dc=upm,dc=es found","level":0,"time":"2014-07-21T19:31:01+00:00","method":"GET","url":"/owncloud/"}

Or this one:
{"reqId":"53cd77e5ebcf7","app":"user_ldap","message":"Requested attribute thumbnailphoto not found for uid=xxx,ou=us,dc=dit,dc=upm,dc=es","level":0,"time":"2014-07-21T20:28:24+00:
00","method":"POST","url":"/owncloud/index.php/core/ajax/translations.php"}

Always ending the log with these kind of messages;
{"reqId":"53cd780e7016d","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:02+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"}

{"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:
Falló la actualización "files_sharing" (it is in Spanish, what would be translated to something like: Failed to upgrade "files_sharing")

The second one appears later if I reload again the page in navigator:
An exception occurred while executing 'UPDATE "oc_filecache" SET "permissions"=? WHERE "fileid" = ?': SQLSTATE[HY000]: General error: 1 no such column: permissions

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
zmi1 commented in November 09, 2013, but the same errors arise again. The solution proposed in that thread is to open the database and apply this command: delete from oc_share where file_source in (SELECT file_source FROM oc_share LEFT JOIN oc_filecache ON file_source = oc_filecache.fileid WHERE oc_filecache.fileid IS NULL AND oc_share.item_type IN ('file', 'folder')); (which executes without errors) but after that, all errors come the same way.

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.

@PVince81
Copy link
Contributor

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.
I suspect that there might still be some running processes before you did the upgrade, and these processes might have locked the database. Such processes are usually either file scanning (checking for updates on the filesystem / external storage) or it could also be thumbnail creation that takes too long.

After that, update the code as you did before, but do it BEFORE restarting the web server.
Then restart the web server. All clients will not be able to connect any more (since we are in update mode), which should avoid whatever process might have been triggered by clients.

@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.

@DeepDiver1975
Copy link
Member

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.
Kind of tricky

@PVince81
Copy link
Contributor

@omarwllorente did you happen to upgrade using the command line ./occ update ?

@omarwllorente
Copy link
Author

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

  • Stopping web server apache2 *

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:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 6 database table is locked' in /var/www/owncloud-7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:742
Stack trace:
#0 [internal function]: PDO->query('DROP INDEX ldap...')
#1 /var/www/owncloud-7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(742): call_user_func_array(Array, Array)
#2 /var/www/owncloud-7.0rc3/lib/private/db/migrator.php(179): Doctrine\DBAL\Connection->query('DROP INDEX ldap...')
#3 /var/www/owncloud-7.0rc3/lib/private/db/migrator.php(35): OC\DB\Migrator->applySchema(Object(Doctrine\DBAL\Schema\Schema))
#4 /var/www/owncloud-7.0rc3/lib/private/db/mdb2schemamanager.php(98): OC\DB\Migrator->migrate(Object(Doctrine\DBAL\Schema\Schema))
#5 /var/www/owncloud-7.0rc3/lib/private/db.php(320): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...')
#6 /var/www/owncloud-7.0rc3/lib/private/app.php(1172): OC_DB::updateDbFromStructure('/var/www/ownclo...')
#7 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('user_ldap')
#8 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('user_ldap')
#9 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('user_ldap')
#10 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(66): OC_App::loadApps(Array)
#11 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(10): removeSharedFolder()
#12 /var/www/owncloud-7.0rc3/lib/private/app.php(1179): include('/var/www/ownclo...')
#13 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('files_sharing')
#14 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_sharing')
#15 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_sharing')
#16 /var/www/owncloud-7.0rc3/console.php(26): OC_App::loadApps()
#17 /var/www/owncloud-7.0rc3/occ(11): require_once('/var/www/ownclo...')
#18 {main}

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
Stack trace:
#0 /var/www/owncloud-7.0rc3/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(744): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), 'DROP INDEX ldap...')
#1 /var/www/owncloud-7.0rc3/lib/private/db/migrator.php(179): Doctrine\DBAL\Connection->query('DROP INDEX ldap...')
#2 /var/www/owncloud-7.0rc3/lib/private/db/migrator.php(35): OC\DB\Migrator->applySchema(Object(Doctrine\DBAL\Schema\Schema))
#3 /var/www/owncloud-7.0rc3/lib/private/db/mdb2schemamanager.php(98): OC\DB\Migrator->migrate(Object(Doctrine\DBAL\Schema\Schema))
#4 /var/www/owncloud-7.0rc3/lib/private/db.php(320): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...')
#5 /var/www/owncloud-7.0rc3/lib/private/app.php(1172): OC_DB::updateDbFromStructure('/var/www/ownclo...')
#6 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('user_ldap')
#7 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('user_ldap')
#8 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('user_ldap')
#9 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(66): OC_App::loadApps(Array)
#10 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(10): removeSharedFolder()
#11 /var/www/owncloud-7.0rc3/lib/private/app.php(1179): include('/var/www/ownclo...')
#12 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('files_sharing')
#13 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_sharing')
#14 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_sharing')
#15 /var/www/owncloud-7.0rc3/console.php(26): OC_App::loadApps()
#16 /var/www/owncloud-7.0rc3/occ(11): require_once('/var/www/ownclo...')
#17 {main}

Next exception 'RuntimeException' with message 'Failed to upgrade "user_ldap".' in /var/www/owncloud-7.0rc3/lib/private/app.php:985
Stack trace:
#0 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('user_ldap')
#1 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('user_ldap')
#2 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(66): OC_App::loadApps(Array)
#3 /var/www/owncloud-7.0rc3/apps/files_sharing/appinfo/update.php(10): removeSharedFolder()
#4 /var/www/owncloud-7.0rc3/lib/private/app.php(1179): include('/var/www/ownclo...')
#5 /var/www/owncloud-7.0rc3/lib/private/app.php(980): OC_App::updateApp('files_sharing')
#6 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_sharing')
#7 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_sharing')
#8 /var/www/owncloud-7.0rc3/console.php(26): OC_App::loadApps()
#9 /var/www/owncloud-7.0rc3/occ(11): require_once('/var/www/ownclo...')
#10 {main}

Next exception 'RuntimeException' with message 'Failed to upgrade "files_sharing".' in /var/www/owncloud-7.0rc3/lib/private/app.php:985
Stack trace:
#0 /var/www/owncloud-7.0rc3/lib/private/app.php(87): OC_App::checkUpgrade('files_sharing')
#1 /var/www/owncloud-7.0rc3/lib/private/app.php(72): OC_App::loadApp('files_sharing')
#2 /var/www/owncloud-7.0rc3/console.php(26): OC_App::loadApps()
#3 /var/www/owncloud-7.0rc3/occ(11): require_once('/var/www/ownclo...')
#4 {main}root@drop-new:/var/www/owncloud#
root@drop-new:/var/www/owncloud#

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

@omarwllorente
Copy link
Author

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
SQLite version 3.8.2 2013-12-06 14:53:30
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> DROP INDEX ldap_dn_users;
sqlite> DROP INDEX owncloud_name_users;
sqlite> DROP TABLE oc_ldap_user_mapping;
sqlite> DROP INDEX ldap_dn_groups;
sqlite> DROP INDEX owncloud_name_groups;
sqlite> DROP TABLE oc_ldap_group_mapping;
sqlite> DROP INDEX ldap_group_members_index;
sqlite> DROP TABLE oc_ldap_group_members;
sqlite> .exit
root@drop-new:/var/www/owncloud/data#
root@drop-new:/var/www/owncloud/data# service apache2 start

  • Starting web server apache2 *
    root@drop-new:/var/www/owncloud/data#

And then triggered the upgrading process by navigating to the owncloud page resulting in the message:
An exception occurred while executing 'UPDATE "oc_filecache" SET "permissions"=? WHERE "fileid" = ?': SQLSTATE[HY000]: General error: 1 no such column: permissions

What I got in the owncloud.log was the following:

root@drop-new:/var/www/owncloud/data# cat owncloud.log
{"reqId":"53d138d64ab12","app":"user_ldap","message":"starting app upgrade from 0.4.2 to 0.4.3","level":0,"time":"2014-07-24T16:48:22+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"files","message":"starting app upgrade from 1.1.7 to 1.1.9","level":0,"time":"2014-07-24T16:48:22+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"activity","message":"starting app upgrade from 1.1.2 to 1.1.22","level":0,"time":"2014-07-24T16:48:22+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"files_sharing","message":"starting app upgrade from 0.3.5 to 0.5.3","level":0,"time":"2014-07-24T16:48:24+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"files_trashbin","message":"starting app upgrade from 0.5 to 0.6.2","level":0,"time":"2014-07-24T16:48:24+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"files_versions","message":"starting app upgrade from 1.0.3 to 1.0.5","level":0,"time":"2014-07-24T16:48:25+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"gallery","message":"starting app upgrade from 0.5.3 to 0.5.4","level":0,"time":"2014-07-24T16:48:25+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"calendar","message":"starting app upgrade from 0.6.3 to 0.6.4","level":0,"time":"2014-07-24T16:48:26+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"contacts","message":"starting app upgrade from 0.3 to 0.3.0.16","level":0,"time":"2014-07-24T16:48:27+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d138d64ab12","app":"files_pdfviewer","message":"starting app upgrade from 0.3 to 0.5","level":0,"time":"2014-07-24T16:48:28+00:00","method":"GET","url":"/owncloud/"}
{"reqId":"53d139061f7e3","app":"PHP","message":"Undefined index: permissions at /var/www/owncloud-7.0rc3/lib/private/files/cache/cache.php#156","level":3,"time":"2014-07-24T16:49:10+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"}
{"reqId":"53d139061f7e3","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-24T16:49:10+00:00","method":"GET","url":"/owncloud/index.php/apps/files/"}

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]
Command "update" is not defined.

()
root@drop-new:/var/www/owncloud/data#

Any tips would be very much appreciated.

Regards,

Omar

@omarwllorente
Copy link
Author

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

@PVince81
Copy link
Contributor

@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.

@omarwllorente
Copy link
Author

Hi, Vincent.

All the tests I did where on a virtual machine without clients and the
server was stopped when I did the backups and recoveries of the sqlite db...

That's why I think that was the upgrading process who locked the db...

Thanks

Omar
El 12/08/2014 11:36, "Vincent Petry" notifications@github.com escribió:

@omarwllorente https://github.com/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.


Reply to this email directly or view it on GitHub
#9766 (comment).

@lock lock bot locked as resolved and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants