#422  Failed to upgrade /opt/onedev (4.11.1 → 5.3.0)
Closed
Michael Weimann opened 1 month ago

I have updated onedev today to 4.9..4 to 5.2.1 running a Docker setup.

Now I am stuck at:

INFO  - >>> ERROR - Data version mismatch (app data version: 68, db data version: 61)
ERROR - Failed to upgrade /opt/onedev
INFO  - Restoring old program files due to upgrade failure...
INFO  - Old program files restored
WARN  - The database might be in inconsistent state due to upgrade failure. In that case, you need to restore the database by first cleaning it, and then running below command:
INFO  - /opt/onedev/bin/restore-db.sh /opt/onedev/site/db-backup/2021-10-24_10-06-15.zip
<-- Wrapper Stopped

The installation is still working and showing version 4.9.4.
I am not sure what to do now :(

Robin Shen commented 1 month ago
Robin Shen changed state to 'Closed' 1 month ago
Previous Value Current Value
Open
Closed
No comment
Michael Weimann commented 1 month ago

Tried that - doesn't work :(

Michael Weimann commented 1 month ago

Tried to upgrade to the latest 4 version (4.11.1): worked

Then upgrading to 5.3.0 doesn't work with the same error but different version numbers:

INFO  - Updating program files...
INFO  - Restoring database with new program...
INFO  - >>> INFO  - Launching application from '/opt/onedev'...
INFO  - >>> INFO  - Cleaning temp directory...
INFO  - >>> INFO  - Initializing dependency injection container...
INFO  - >>> INFO  - Starting plugin manager...
INFO  - >>> INFO  - Restoring database from /opt/onedev/site/db-backup/2021-10-31_17-25-01.zip...
INFO  - >>> INFO  - Validating data file 'Roles.xml'...
INFO  - >>> INFO  - Validating data file 'Projects.xml'...
INFO  - >>> INFO  - Validating data file 'Users.xml'...
INFO  - >>> INFO  - Validating data file 'Builds.xml'...
INFO  - >>> INFO  - Validating data file 'BuildParams.xml'...
INFO  - >>> INFO  - Validating data file 'ModelVersions.xml'...
INFO  - >>> INFO  - Validating data file 'Settings.xml'...
INFO  - >>> INFO  - Validating data file 'SshKeys.xml'...
INFO  - >>> INFO  - Validating data file 'BuildDependences.xml'...
INFO  - >>> INFO  - Validating data file 'UserAuthorizations.xml'...
INFO  - >>> ERROR - Data version mismatch (app data version: 69, db data version: 64)
ERROR - Failed to upgrade /opt/onedev
INFO  - Restoring old program files due to upgrade failure...
INFO  - Old program files restored
WARN  - The database might be in inconsistent state due to upgrade failure. In that case, you need to restore the database by first cleaning it, and then running below command:
INFO  - /opt/onedev/bin/resto
Michael Weimann changed title 1 month ago
Previous Value Current Value
Failed to upgrade /opt/onedev (4.9.4 → 5.2.1)
Failed to upgrade /opt/onedev (4.11.1 → 5.3.0)
Robin Shen changed state to 'Open' 1 month ago
Previous Value Current Value
Closed
Open
No comment
Robin Shen commented 1 month ago

After upgrade failure to 5.3.0, are you able to start OneDev now?

Robin Shen commented 1 month ago

Also please zip all files under <your OneDev install dir>/logs and attach here.

Robin Shen commented 1 month ago

Also please let me know the exact command you are using to run OneDev, as well as the OS platform.

Robin Shen commented 1 month ago

Also please run below command to open terminal to OneDev container:

docker exec -it <OneDev container id> bash

And then zip and attach all files under /app/logs here

Michael Weimann commented 1 month ago

After upgrade failure to 5.3.0, are you able to start OneDev now?

It starts but displays "Version 4.11.1"

Also please let me know the exact command you are using to run OneDev, as well as the OS platform.

docker run \
    --name onedev \
    -v /mnt/bla/onedev:/opt/onedev \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 2222:2222 \
    -p 6610:6610 \
    -e 'ssh_port=2222' \
     1dev/server:5.3.0

on Debian Buster, Docker version 20.10.8, build 3967b7d

Database: mariadb Ver 15.1 Distrib 10.3.29-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

hibernate.properties:

hibernate.dialect=org.hibernate.dialect.MariaDB103Dialect
hibernate.connection.driver_class=org.mariadb.jdbc.Driver
hibernate.connection.url=jdbc:mariadb://myhost:3306/onedev
hibernate.connection.username=onedev
hibernate.connection.password=secret

Here are the log files:

Hope that helps. Thanks

Robin Shen commented 1 month ago

This is a bug and has now been fixed in build #1998 (5.3.1). Also make sure to add option -it if you run docker foreground. This will make OneDev able to print output as well as able to be terminated by ctrl-c

Robin Shen changed state to 'Closed' 1 month ago
Previous Value Current Value
Open
Closed
No comment
Michael Weimann commented 1 month ago

The update is now working, Thanks

issue 1 of 1
Type
Support Request
Priority
Major
Assignee
Issue Votes (0)
Watchers (3)
Reference
issue onedev/server#422
Please wait...
Page is in error, reload to recover