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

Upgrade fails 10.0.5 to 11.0.3 #5515

Closed
eshattow opened this issue Jun 22, 2017 · 8 comments
Closed

Upgrade fails 10.0.5 to 11.0.3 #5515

eshattow opened this issue Jun 22, 2017 · 8 comments

Comments

@eshattow
Copy link

Steps to reproduce

  1. Manual upgrade 10.0.5 to 11.0.3

Expected behaviour

Normal procedure for manual upgrade.

Actual behaviour

Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'ALTER TABLE oc_accounts ADD PRIMARY KEY ("uid")': SQLSTATE[23505]: Unique violation: 7 ERROR: could not create unique index "oc_accounts_pkey" DETAIL: Key (uid)=() is duplicated.

Detailed logs
Preparing update
Set log level to debug
Turned on maintenance mode
Updating database schema
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'ALTER TABLE oc_accounts ADD PRIMARY KEY ("uid")': SQLSTATE[23505]: Unique violation: 7 ERROR: could not create unique index "oc_accounts_pkey" DETAIL: Key (uid)=() is duplicated.

Server configuration

Operating system: Debian GNU/Linux 8
Linux s2 2.6.32-042stab116.1 #1 SMP Wed May 4 16:21:02 MSK 2016 x86_64 GNU/Linux

Web server: apache2 2.4.10-10+deb8u8

Database: postgresql 9.4+165+deb8

PHP version: libapache2-mod-php5 5.6.30+dfsg-0+deb8u1

Nextcloud version: Nextcloud 10.0.5 (stable)

Updated from an older Nextcloud/ownCloud or fresh install: Updated from ownCloud

Where did you install Nextcloud from: Download tar.bz2 from nextcloud.com

Signing status:

Signing status No errors have been found.

List of activated apps:

App list Enabled: - activity: 2.3.2 - comments: 1.0.0 - dav: 1.0.1 - federatedfilesharing: 1.0.1 - federation: 1.0.1 - files: 1.5.2 - files_external: 1.0.2 - files_pdfviewer: 0.8.1 - files_sharing: 1.0.0 - files_texteditor: 2.1 - files_trashbin: 1.0.0 - files_versions: 1.3.0 - files_videoplayer: 0.9.8 - firstrunwizard: 1.1 - gallery: 15.0.1 - notifications: 0.3.0 - password_policy: 1.0.0 - provisioning_api: 1.0.0 - serverinfo: 1.1.1 - survey_client: 0.1.5 - systemtags: 1.0.2 - templateeditor: 0.1 - theming: 1.0.1 - updatenotification: 1.0.1 - workflowengine: 1.0.1 Disabled: - admin_audit - encryption - external - files_accesscontrol - files_automatedtagging - files_retention - user_external - user_ldap - user_saml

Nextcloud configuration:

Config report { "system": { "instanceid": "ocywhj8defsc", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "oc.ai6fs.net" ], "datadirectory": "\/home\/web\/nextcloud-data", "overwrite.cli.url": "http:\/\/oc.ai6fs.net", "dbtype": "pgsql", "version": "9.1.5.2", "dbname": "owncloud", "dbhost": "localhost", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "logtimezone": "UTC", "installed": true, "loglevel": 2, "maintenance": false, "htaccess.RewriteBase": "\/", "theme": "" } }

Are you using external storage, if yes which one: local separate nextcloud-data directory

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

LDAP config [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "ldap" namespace.

Client configuration

Browser: chromium 59.0.3071.86-1

Operating system: Debian GNU/Linux 9
Linux zontar 4.11.0-trunk-amd64 #1 SMP Debian 4.11-1~exp2 (2017-05-05) x86_64 GNU/Linux

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log [nextcloud-log.txt](https://github.com/nextcloud/server/files/1095947/nextcloud-log.txt)

Browser log

Browser log
@jospoortvliet
Copy link
Member

Can anyone reproduce this? @MorrisJobke if you have time perhaps...

@MorrisJobke
Copy link
Member

Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'ALTER TABLE oc_accounts ADD PRIMARY KEY ("uid")': SQLSTATE[23505]: Unique violation: 7 ERROR: could not create unique index "oc_accounts_pkey" DETAIL: Key (uid)=() is duplicated.

@nickvergessen Looks like we have a unique constraint on uid while owncloud doesn't and then there could be one key multiple times. An idea how to detect and clean this up?

@eshattow could you have a look at the oc_accounts table? Best would be of course a dump of this table before the update. Is this possible (anonymised of course).

@nickvergessen
Copy link
Member

Looks like we have a unique constraint on uid while owncloud doesn't and then there could be one key multiple times. An idea how to detect and clean this up?

We drop this table on migration from owncloud, so should not be a problem....

$this->db->dropTable('accounts');

@MorrisJobke
Copy link
Member

Manual upgrade 10.0.5 to 11.0.3

Ah right - we only support the upgrade from ownCloud 10 to 12, right?

@jospoortvliet
Copy link
Member

jospoortvliet commented Aug 7, 2017

Actually if you are on oC 10 you're supposed to go to Nextcloud 10 first, then to Nc 11 then 12. We need to document this more clearly, I think.

Edit: Ah, sjees, no, Oc 9.1 goes to Nc 10. oC 10 goes to Nc 12, not 11.

@MorrisJobke
Copy link
Member

We need to document this more clearly, I think.

@jospoortvliet Please open a ticket in documentation.

@jospoortvliet
Copy link
Member

@MorrisJobke we already explain this on nextcloud.com/migration, I will edit it a bit. and https://github.com/nextcloud/documentation/blob/master/admin_manual/maintenance/migrating_owncloud.rst is already as clear as it can be.

@eshattow
Copy link
Author

This was from NextCloud 10 to NextCloud 11, after possibly a failed upgrade from OwnCloud 9.1; I've dropped the oc_accounts table in psql and now the upgrade proceeds normally. Thanks for the help everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants