Failed to upgrade /opt/onedev 12.0.10 -> latest (OD-2557)
Zhou You opened 4 months ago
INFO  - >>> INFO  - Importing from data file 'Settings.xml'...
INFO  - >>> ERROR - Error booting application
INFO  - >>> com.thoughtworks.xstream.converters.ConversionException: 
INFO  - >>> ---- Debugging information ----
INFO  - >>> cause-exception     : com.thoughtworks.xstream.converters.reflection.MissingFieldException
INFO  - >>> cause-message       : Field not found in class.
INFO  - >>> class               : io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec
INFO  - >>> required-type       : io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec
INFO  - >>> converter-type      : io.onedev.server.util.xstream.ReflectionConverter
INFO  - >>> path                : /io.onedev.server.model.Setting/value/transitionSpecs/io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec/states
INFO  - >>> xpath               : /io.onedev.server.model.Setting/value/transitionSpecs/io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec/states
INFO  - >>> class[1]            : java.util.ArrayList
INFO  - >>> required-type[1]    : java.util.ArrayList
INFO  - >>> converter-type[1]   : io.onedev.server.util.xstream.CollectionConverter
INFO  - >>> class[2]            : io.onedev.server.model.support.administration.GlobalIssueSetting
INFO  - >>> required-type[2]    : io.onedev.server.model.support.administration.GlobalIssueSetting
INFO  - >>> class[3]            : io.onedev.server.model.Setting
INFO  - >>> required-type[3]    : io.onedev.server.model.Setting
INFO  - >>> version             : not available
INFO  - >>> -------------------------------
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
INFO  - >>> 	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:52)
INFO  - >>> 	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readBareItem(AbstractCollectionConverter.java:132)
INFO  - >>> 	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:117)
INFO  - >>> 	at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:99)
INFO  - >>> 	at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:92)
INFO  - >>> 	at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:86)
INFO  - >>> 	at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:81)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
INFO  - >>> 	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:496)
INFO  - >>> 	at io.onedev.server.util.xstream.ReflectionConverter.unmarshallField(ReflectionConverter.java:43)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:420)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
INFO  - >>> 	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:496)
INFO  - >>> 	at io.onedev.server.util.xstream.ReflectionConverter.unmarshallField(ReflectionConverter.java:43)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:420)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
INFO  - >>> 	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:52)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:136)
INFO  - >>> 	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
INFO  - >>> 	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1468)
INFO  - >>> 	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1434)
INFO  - >>> 	at io.onedev.server.data.migration.VersionedXmlDoc.toBean(VersionedXmlDoc.java:508)
INFO  - >>> 	at io.onedev.server.data.migration.VersionedXmlDoc.toBean(VersionedXmlDoc.java:468)
INFO  - >>> 	at io.onedev.server.data.DefaultDataManager.importData(DefaultDataManager.java:498)
INFO  - >>> 	at io.onedev.server.persistence.SessionInterceptor$1.call(SessionInterceptor.java:23)
INFO  - >>> 	at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90)
INFO  - >>> 	at io.onedev.server.persistence.SessionInterceptor.invoke(SessionInterceptor.java:18)
INFO  - >>> 	at io.onedev.server.commandhandler.RestoreDatabase.doRestore(RestoreDatabase.java:121)
INFO  - >>> 	at io.onedev.server.commandhandler.RestoreDatabase.lambda$start$0(RestoreDatabase.java:74)
INFO  - >>> 	at io.onedev.server.commandhandler.CommandHandler.doMaintenance(CommandHandler.java:32)
INFO  - >>> 	at io.onedev.server.commandhandler.RestoreDatabase.start(RestoreDatabase.java:67)
INFO  - >>> 	at io.onedev.commons.loader.DefaultPluginManager.start(DefaultPluginManager.java:44)
INFO  - >>> 	at io.onedev.commons.loader.AppLoader.start(AppLoader.java:74)
INFO  - >>> 	at io.onedev.commons.bootstrap.Bootstrap.main(Bootstrap.java:200)
INFO  - >>> Caused by: com.thoughtworks.xstream.converters.reflection.MissingFieldException: Field not found in class.
INFO  - >>> ---- Debugging information ----
INFO  - >>> message             : Field not found in class.
INFO  - >>> field               : io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec.states
INFO  - >>> -------------------------------
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.FieldDictionary.field(FieldDictionary.java:98)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.getField(PureJavaReflectionProvider.java:217)
INFO  - >>> 	at io.onedev.server.CoreModule$8$1$1.shouldSerializeMember(CoreModule.java:832)
INFO  - >>> 	at com.thoughtworks.xstream.mapper.MapperWrapper.shouldSerializeMember(MapperWrapper.java:173)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.handleUnknownField(AbstractReflectionConverter.java:512)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:366)
INFO  - >>> 	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
INFO  - >>> 	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
INFO  - >>> 	... 44 common frames omitted
INFO  - >>> INFO  - Stopping application...
ERROR - Failed to upgrade /opt/onedev
  • Davide Beatrici removed comment 4 months ago
  • Davide Beatrici commented 4 months ago

    Same here upgrading from 12.0.8 to 13.0.0:

    INFO  - >>> INFO  - Importing from data file 'Settings.xml'...
    INFO  - >>> ERROR - Error booting application
    INFO  - >>> com.thoughtworks.xstream.converters.ConversionException: 
    INFO  - >>> ---- Debugging information ----
    INFO  - >>> cause-exception     : com.thoughtworks.xstream.converters.reflection.MissingFieldException
    INFO  - >>> cause-message       : Field not found in class.
    INFO  - >>> class               : io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec
    INFO  - >>> required-type       : io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec
    INFO  - >>> converter-type      : io.onedev.server.util.xstream.ReflectionConverter
    INFO  - >>> path                : /io.onedev.server.model.Setting/value/transitionSpecs/io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec/states
    INFO  - >>> xpath               : /io.onedev.server.model.Setting/value/transitionSpecs/io.onedev.server.model.support.issue.transitionspec.IssueStateTransitedSpec/states
    INFO  - >>> class[1]            : java.util.ArrayList
    INFO  - >>> required-type[1]    : java.util.ArrayList
    INFO  - >>> converter-type[1]   : io.onedev.server.util.xstream.CollectionConverter
    INFO  - >>> class[2]            : io.onedev.server.model.support.administration.GlobalIssueSetting
    INFO  - >>> required-type[2]    : io.onedev.server.model.support.administration.GlobalIssueSetting
    INFO  - >>> class[3]            : io.onedev.server.model.Setting
    INFO  - >>> required-type[3]    : io.onedev.server.model.Setting
    INFO  - >>> version             : not available
    INFO  - >>> -------------------------------
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
    INFO  - >>>     at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:52)
    INFO  - >>>     at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readBareItem(AbstractCollectionConverter.java:132)
    INFO  - >>>     at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:117)
    INFO  - >>>     at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:99)
    INFO  - >>>     at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:92)
    INFO  - >>>     at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:86)
    INFO  - >>>     at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:81)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
    INFO  - >>>     at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
    INFO  - >>>     at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:496)
    INFO  - >>>     at io.onedev.server.util.xstream.ReflectionConverter.unmarshallField(ReflectionConverter.java:43)
    INFO  - >>>     at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:420)
    INFO  - >>>     at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
    INFO  - >>>     at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
    INFO  - >>>     at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:496)
    INFO  - >>>     at io.onedev.server.util.xstream.ReflectionConverter.unmarshallField(ReflectionConverter.java:43)
    INFO  - >>>     at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:420)
    INFO  - >>>     at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
    INFO  - >>>     at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:52)
    INFO  - >>>     at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:136)
    INFO  - >>>     at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    INFO  - >>>     at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1468)
    INFO  - >>>     at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1434)
    INFO  - >>>     at io.onedev.server.data.migration.VersionedXmlDoc.toBean(VersionedXmlDoc.java:508)
    INFO  - >>>     at io.onedev.server.data.migration.VersionedXmlDoc.toBean(VersionedXmlDoc.java:468)
    INFO  - >>>     at io.onedev.server.data.DefaultDataManager.importData(DefaultDataManager.java:498)
    INFO  - >>>     at io.onedev.server.persistence.SessionInterceptor$1.call(SessionInterceptor.java:23)
    INFO  - >>>     at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90)
    
  • OneDev commented 4 months ago

    State changed as code fixing the issue is committed (e8acd1f1)

  • OneDev changed state to 'Closed' 4 months ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 4 months ago

    State changed as build OD-6648 is successful

  • OneDev changed state to 'Released' 4 months ago
    Previous Value Current Value
    Closed
    Released
  • Davide Beatrici commented 4 months ago

    I can confirm the issue is fixed, thank you!

  • Davide Beatrici commented 4 months ago

    @robin On an unrelated note, I found this in the log:

    WARN  [WrapperSimpleAppMain] o.glassfish.jersey.internal.Errors The following warnings have been detected: WARNING: The (sub)resource method getBuildSpecSchema in io.onedev.server.buildspec.BuildSpecSchemaResource contains empty path annotation.
    
  • Maarten de Ruiter commented 4 months ago

    still same problem for me when upgrading from 12.0.10 to 13.0.1. Console.log: INFO - >>> WARN - ERROR: constraint "fkirj2pi2nr85rq82n5pl6ppcxe" of relation "o_accesstoken" does not exist INFO - >>> WARN - ERROR: constraint "fk9stiqa0rbe2urq8vvsfwh1reb" of relation "o_accesstokenauthorization" does not exist ... ERROR - !! Failed to upgrade /opt/onedev INFO - *** After solving the problem, please restart container with correct image ***

  • Robin Shen commented 3 months ago

    still same problem for me when upgrading from 12.0.10 to 13.0.1. Console.log: INFO - >>> WARN - ERROR: constraint "fkirj2pi2nr85rq82n5pl6ppcxe" of relation "o_accesstoken" does not exist INFO - >>> WARN - ERROR: constraint "fk9stiqa0rbe2urq8vvsfwh1reb" of relation "o_accesstokenauthorization" does not exist ... ERROR - !! Failed to upgrade /opt/onedev INFO - *** After solving the problem, please restart container with correct image ***

    Seems that your database is corrupted for some reason. What database are you using?

  • Maarten de Ruiter commented 3 months ago

    Postgres 17.6-1. Running in Docker containers

    And 1Dev 12.0.10 is working fine.

  • Robin Shen commented 3 months ago

    This seems odd. This message shows that some foreign key references to non-existant entries. Please investigate the issue with below steps:

    1. Get a backup of OneDev database via side bar menu "Administration / System Maintenance / Database Backup".
    2. Download OneDev 12.0.10 (bare metal zip), configure it to point to a new PostgreSQL database, and run bin/restore-db.sh with the backup to see if it works.
  • Maarten de Ruiter commented 3 months ago
    I will try this but to my suprise the update from 12.0.10 to 13.0.4 was successful
  • Robin Shen commented 3 months ago

    Please continue to upgrade from 13.0.4 to 13.0.6, there are some more bugs fixed since.

  • Maarten de Ruiter commented 3 months ago
    Thanks for the feedback! I will upgrade asap
  • Maarten de Ruiter commented 3 months ago
    also no problem


    image.png


    Do you think I still need to repair the database?

    On Mon, Sep 29, 2025 at 3:01 PM Maarten de Ruiter <[email protected]> wrote:
    Thanks for the feedback! I will upgrade asap
  • Robin Shen commented 3 months ago

    Database should be fine. No need to do that now.

  • Cornel Chirila commented 3 months ago

    The upgrade from 12.0.10 to 13.0.6 went smoothly, without errors. Also the service got up quicker than usual. Thanks! 🙂

issue 1/1
Type
Bug
Priority
Critical
Assignee
Affected Versions
13.0.0
Labels
No labels
Issue Votes (0)
Watchers (8)
Reference
OD-2557
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover