-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Update to 11.0.3 failed #4504
Comments
Hi, I have the same issue (I already noticed it with plugins update since 11.0.2) but now this is the whole nextcloud upgrade that is stuck. |
I don't quite understand, because the column/table was last changed 2 years ago. |
Maybe and issue with doctrine? |
I guess so, since we didn't update that either. |
I'll do a fresh test install with a new database and then update to the latest beta. Will report back in a bit. |
OK so on the test install I can't upgrade to beta because of a different error but if I compare the two databases, the column on the "old" database is type bigint and on the test one it's integer. No idea how that happened. I changed the type to integer now on the old database and tried to update from 12.0.0 beta 2 to beta 3 but now the "Start Update" button doesn't work. Is that again weirdness on my server or can someone confirm? If someone confirms, I can log a new issue for this. |
This was a bug in beta2 -.- Sorry for this. Apply this patch and it should work again: https://github.com/nextcloud/server/pull/4762.patch cd /tmp
wget https://github.com/nextcloud/server/pull/4762.patch
cd /var/www/nextcloud
patch -p1 < /tmp/4762.patch Then it should work. Keep in mind to clear browser caches, because otherwise the JS is not updated on the admin page to contain the fix. |
I'm using those unofficial docker images but they used to work fine until 11.0.3.
And here is my current SQL schema:
Looks like the same issue as @hukoeth where bigint should not be there. The question is: is it possible a pg_dump/import changed the type of those columns? |
Oh sorry ... wrong button. |
no problem, thanks |
Seems so, because we didn't changed it in the past. 🤔 And this is postgres, right? |
yes, postgres database. |
I did a DB migrate as well but I can't remember if this was before or after the first failed upgrade attempt of Nextcloud. |
So I just setup a new database with a fresh install and here is what I get:
I then pg_dump'ed it and import it but the types don't seem to change.
|
Okay ... last time the schema was changed is 5 years ago: https://github.com/nextcloud/server/blame/80eb3064e2e71e634e818eb49e52a5fe6166da81/db_structure.xml#L98-L98 I guess the change was done in the schema reader. Let me check that. |
Also in there is no change that could cause this. 🤔 |
Well I changed the types manually to the expected values, the update went through and the types didn't change back. I will keep an eye on the database schemas whenever I do config changes, updates or play around with apps to catch any change and will report back in case this happens again. |
Yes please, thanks and good luck |
I'm having a similar issue updating the bookmarks apps. nextcloud/bookmarks#372. I'm running 11.0.0. |
and I created the database from a MySQL migration, so this might also be because of a pgimport issue. |
Even though this issue is closed, I wanted to indicate that this issue also arrives when you migrate from a recent version of OwnCloud that was installed using a PostgreSQL database to NextCloud. It can be solved by manually changing the types on the indicated tables. Log in as postgres user into your database, then run the following model queries. For every SQL error complaining about SERIAL, take the field indicated in the failed query message and change its type to int. For every SQL error complaining about BIGSERIAL, take the field indicated in the failed query and change its type to bigint. After every change, reload the webinterface and restart the upgrade procedure, which then will either complain about the following database migration, or continue. Hopefully this is useful for someone.
|
@mauritslamers Thank you very much! Altering the tables on postgresql did the trick for me, upgraded from owncloud 9.1.4 to 10.0.4 to nextcloud 12.0.4 to 12.0.5. |
Hi @mauritslamers, Same for me, thanks a lot - I had to add two more queries for one of my 2 instances for the migration from OC 10.0.4 to NC 12. ALTER TABLE oc_activity ALTER activity_id TYPE int;
ALTER TABLE oc_activity_mq ALTER mail_id TYPE int; And then upgraded to NC13 smoothly. So the full list to copy paste is : alter table oc_filecache alter fileid TYPE int;
alter table oc_properties alter id TYPE int;
alter table oc_addressbooks alter id TYPE bigint;
alter table oc_cards alter id TYPE bigint;
alter table oc_addressbookchanges alter id TYPE bigint;
alter table oc_calendarobjects alter id TYPE bigint;
alter table oc_calendars alter id TYPE bigint;
alter table oc_calendarchanges alter id TYPE bigint;
alter table oc_calendarsubscriptions alter id TYPE bigint;
alter table oc_schedulingobjects alter id TYPE bigint;
alter table oc_cards_properties alter id TYPE bigint;
alter table oc_dav_shares alter id TYPE bigint;
alter table oc_share_external alter id TYPE int;
alter table oc_files_trash alter auto_id TYPE int;
ALTER TABLE oc_activity ALTER activity_id TYPE int;
ALTER TABLE oc_activity_mq ALTER mail_id TYPE int; |
Steps to reproduce
Expected behaviour
Nextcloud should update
Actual behaviour
Error:
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_storages ALTER numeric_id TYPE SERIAL': SQLSTATE[42704]: Undefined object: 7 ERROR: type "serial" does not exist
Detailed logs
Preparing update
Set log level to debug
Turned on maintenance mode
Updating database schema
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_storages ALTER numeric_id TYPE SERIAL': SQLSTATE[42704]: Undefined object: 7 ERROR: type "serial" does not exist
Postgresql doesn't allow to change to type serial. Is Postgresql not supported?
Server configuration
Operating system:
Ubuntu 17.04
Web server:
Apache
Database:
Postgres 9.6.2
PHP version:
7.0
Nextcloud version: (see Nextcloud admin page)
11.0.2
Updated from an older Nextcloud/ownCloud or fresh install:
Updated multiple times
Where did you install Nextcloud from:
Can't remember
The text was updated successfully, but these errors were encountered: