Repository navigation
Description
Hello, OC is really giving me a hard time every time I try to update it. It would really be a great step forward if update process could be noob-safe.
I found my actual update errors in similar ways on the net, but could not figure out how to solve them in my case. Can anybody help? Thanks and regards, Pingpong
Steps to reproduce
- Uploaded new files to oc directory
- Started update with web browser
Expected behaviour
Update my oc to 10.1.0
Actual behaviour
Update failed and gives error message:
Update vorbereiten
Log-Level auf "debug" gesetzt
Wartungsmodus eingeschaltet
Reperaturwarnung:Market app is unavailable for updating of apps. Please update manually, see https://doc.owncloud.org/server/10.1/go.php?to=admin-marketplace-apps
Das Datenbankschema wird aktualisiert
Doctrine\DBAL\Schema\SchemaException: The table with name 'web143_db3.oc_persistent_locks' already exists.
Server configuration
Operating system:
unknown
Web server:
Apache
Database:
MYSQL
PHP version:
7.2
ownCloud version: (see ownCloud admin page)
10.0.8.5
Where did you install ownCloud from:
https://owncloud.org/download/
The content of config/config.php:
<?php
$CONFIG = array (
'instanceid' => '***',
'passwordsalt' => '***Y',
'secret' => '***',
'trusted_domains' =>
array (
0 => 'www.***.de',
1 => '***.de',
),
'datadirectory' => '/***/owncloud/data',
'overwrite.cli.url' => 'http://www.***.de',
'dbtype' => 'mysql',
'version' => '10.0.8.5',
'dbname' => '***',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'dbuser' => '***',
'dbpassword' => '***',
'installed' => true,
'forcessl' => true,
'forceSSLforSubdomains' => true,
'mail_from_address' => '***',
'mail_smtpmode' => 'php',
'mail_domain' => '***.de',
'theme' => '',
'loglevel' => 0,
'maintenance' => false,
'htaccess.RewriteBase' => '/',
'updater.secret' => '***',
);
Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
not possible
List of activated apps:
non
Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
don't know
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no
Client configuration
Browser
Vivaldi 2.3.1440.48
Operating system:
Win 10 Pro 1809
Logs
Web server error log
[Tue Feb 19 13:09:15 2019] [error] [client AH02032: Hostname www..de: provided via SNI and hostname www..de provided via HTTP are different
[Thu Feb 21 23:47:18 2019] [error] [client AH02032: Hostname www..de:*** provided via SNI and hostname www..de provided via HTTP are different
[Fri Feb 22 18:44:48 2019] [error] [client 188.193.149.19:2443] AH01630: client denied by server configuration: //owncloud/data/htaccesstest.txt
[Fri Feb 22 18:45:59 2019] [error] [client 188.193.149.19:2458] AH01630: client denied by server configuration: //owncloud/data/htaccesstest.txt
[Fri Feb 22 19:36:30 2019] [error] [client 188.193.149.19:2645] AH01630: client denied by server configuration: //owncloud/data/htaccesstest.txt
[Fri Feb 22 20:58:51 2019] [error] [client 188.193.149.19:3999] script '/***/owncloud/index.php' not found or unable to stat
ownCloud log (data/owncloud.log)
see attached file owncloud_log.zip
Activity
ownclouders commentedon Feb 23, 2019
GitMate.io thinks the contributors most likely able to help are @ownclouders, and @PVince81.
Possibly related issues are #18350 (DB-Schema update fails, 8.1.0 to 8.1.1), #17768 ( 8.1.0 update Failed), #18032 (massive/strange db updates after upgrade to 8.1.0), #14677 (Upgrade failing 7.0.5 to 8.0.1 when keeping apps folder), and #4857 (Updater fails to update to 5.0.11 (unable to move ...)).
PVince81 commentedon Feb 25, 2019
hmm this was observed before but could not be reproduced: #33963
it failed on the same table, so there's likely something that was similar in your env compared to that other env
PVince81 commentedon Feb 25, 2019
from what I see there was an error before the migration even ran:
It looks like your user has no permissions to create foreign keys
Syntax error or access violation: 1142 REFERENCES command denied to user 'web143_3'@'localhost' for tableoc_filecache` but somehow this didn't stop the upgrade and it went through.From what I see you re-started the failed upgrade a second time:
So the first upgrade did create the table but failed due to the permissions issue. Likely you are running OC on a shared hoster ?
And the second run tried to recreate the failed table.
Normally to retry an upgrade one needs to restore from backup to have the former database state.
@DeepDiver1975 seems that migrations aren't atomic ? I'd expect the migration to roll back all operations (structure changes) that were done within the migration if one of the operations fail.
We could try and mitigate this by adding a table existence check. However this wouldn't solve the foreign key issue.
[-]Update 10.0.8.5 to 10.1.0 failed[/-][+]Update 10.0.8.5 to 10.1.0 failed on shared hoster[/+]PVince81 commentedon Feb 25, 2019
@Pingponguin did you install your ownCloud on a shared web hoster or on a local machine where you have root / admin access ?
many things in your report seem to give hints that this might be a shared hoster.
otherwise if you have admin access for the whole database server you should grant the "web143_db3" all privileges.
patrickjahns commentedon Feb 25, 2019
@Pingponguin
Would you be able to provide some information on the tables in the database.
Can you issue a
describe oc_filecache;anddescribe oc_accounts;- or show from your mysql interface the row names and types?The data is preserved on the server - the database we will work towards finding a solution
VicDeo commentedon Feb 28, 2019
@Pingponguin
could you ask you hoster whether it is possible to grant REFERENCES permission for the DB user from your config.php on this DB?
Basically they need to run something like this:
GRANT REFERENCES ON YOUR_DB_NAME.* TO 'YOUR_DB_USER'@'YOUR_DB_HOST';
and then
FLUSH PRIVILEGES;
or check if it is possible on your own via cPanel https://www.youtube.com/watch?v=lXnvDD9j6Hs
VicDeo commentedon Feb 28, 2019
also could be related to the different engines used for these two tables, like in #34572
From here https://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html
jensregel commentedon Jul 16, 2019
Any updates? I still have the same error when i upgrade to version 10.2.1.
Doctrine\DBAL\Schema\SchemaException: The table with name 'owncloud.oc_persistent_locks' already existsyger commentedon Sep 18, 2019
Any updates? I have the same error, which is fact is happening in two steps. First time you launch the occ upgrade, I have the error
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_persistent_locks ADD CONSTRAINT FK_F0C3D55B93CB796C FOREIGN KEY (file_id) REFERENCES oc_filecache (fileid) ON DELETE CASCADE':
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
Then if you relaunch, the table is already created
Doctrine\DBAL\Schema\SchemaException: The table with name 'cloud.oc_persistent_locks' already exists.
Manually deleting the table persistent_lock is not solving the problem, and the upgrade can not be made
jensregel commentedon Sep 21, 2019
I did it! The user of the owncloud MySQL database does not have
GRANT REFERENCESpermission to create a FOREIGN KEY. The update worked well after the fix.VicDeo commentedon Sep 23, 2019
yep. #34598 (comment)
usenkov999 commentedon Feb 3, 2020
For me it does not work
Can you help me?
Can you explain in detail what you do to fix it?
thorec commentedon May 3, 2020
Fighting with the same issue on a different setup. The system is self hosted in Docker containers
The system is still on OC 10.0.10 and it should be upgraded to 10.4.1.
First run of
occ upgraderesults in this errorNext upgrade run shows
Deleting the table and manipulate this migration file by changing 'unsigned' => true to 'unsigned' => false in the following section.
makes the upgrade work nicely however I can not foresee the side-effects of this change.
Can someone give some advise whether this the right solution or what a better option might be, please?
Can all of this being avoided if migrations are applied from version to versison (i.e 10.0 -> 10.1 -> 10.2 -> 10.3 -> 10.4)?
VicDeo commentedon May 11, 2020
#34598 (comment) and #34598 (comment)
stale commentedon Sep 19, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
stale commentedon Sep 20, 2021
This issue has been automatically closed.