NC update to 4.12.1 fails
-
I encountered the this bug 29986 with the latest update a few hours ago.
ERROR: relation "user_id" already exists
since the workaround needs a php edited, which will not work in a container over restart, any proposed way to handle that?
zordsdavini commented on 1 Dec 2021 •
did some modifications in Version23000Date20210930122352.php and upgrade success:
$table->addUniqueIndex(['user_id'], 'user_id'); changed to $table->addUniqueIndex(['user_id'], 'pc_user_id');and:
Pytal commented on 10 Dec 2021
did some modifications in Version23000Date20210930122352.php and upgrade success: $table->addUniqueIndex(['user_id'], 'user_id'); changed to $table->addUniqueIndex(['user_id'], 'pc_user_id');
For those who renamed the index to pc_user_id, since we've merged #29996, we recommend that you rename the index to
profile_config_user_id_idx
to prevent any issues in the futuresince NC is offline, a quick help/fix would be very appreciated.
-
To get back up quickly until a fix is there, you can restore to the backup made prior to the update.
Looks like some of their migration scripts have that bug, so maybe there is also a chance that if you put the app in debug mode, manually edit that file, then run the start.sh within the app container to let it finish the database migrations. After that this script should not be run again so putting the app out of debug mode, theoretically should then work. I haven't tried that, since I don't have an instance where the issue is reproduced so far.
-
@nebulon said in NC update to 4.12.1 failes:
To get back up quickly until a fix is there, you can restore to the backup made prior to the update.
that would have been my first choice, but the backup system didn't notice me about 5/7 failing backups due to my external minio server had updates problems, so I had only 2 out of the last week left, which had been too old.
Looks like some of their migration scripts have that bug, so maybe there is also a chance that if you put the app in debug mode, manually edit that file, then run the start.sh within the app container to let it finish the database migrations. After that this script should not be run again so putting the app out of debug mode, theoretically should then work. I haven't tried that, since I don't have an instance where the issue is reproduced so far.
that worked. NC is online again.
thx very much -
@chymian good that this worked out. Although Cloudron should have made a backup prior to update and not proceed with update, if the backup failed. Maybe you skipped the backup during the manual update? I think the default is actually to skip, so maybe that should be changed then.
-
I also have a cloudron that NC failed to come up on because it started the 4.12.1 update
from there it got stuck in a loop:
Exception: Database error when running migration latest for app core
Entire server backups also failed because the NC Redis service ran out of memory. Givint it more allowed backups to resume.
Restoring to earlier version from 2 days ago, still erroring during migration, something about duplicate DB entries.
Restoring from 3 days ago appears to get stuck at 65%.