New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 10018 link

Starred by 2 users

Issue metadata

Status: Released
Owner: ----
Closed: Nov 15
Cc:
Components:



Sign in to add a comment

Cannot upgrade schema when migrating from 2.13 to 2.16 - oracleDB

Reported by magios...@gmail.com, Nov 13

Issue description

*****************************************************************
*****                                                       *****
***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!!  *****
*****                                                       *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD,  *****
***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.*****
*****                                                       *****
*****   THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS     *****
*****                                                       *****
*****************************************************************

Affected Version:

What steps will reproduce the problem?
1. run java -jar gerrit.war init -d /path/to/gerrit
2. enter all the info for the init
3. Exception in thread "main" com.google.gwtorm.server.OrmException: Cannot upgrade schema.

What is the expected output?
Migration should pass through

What do you see instead?
Migrating data to schema 151 ...
Exception in thread "main" com.google.gwtorm.server.OrmException: Cannot upgrade schema

Please provide any additional information below.

Here are the logs: 
Issue-id enforced in commit message [mandatory/?]:

Upgrading schema to 151 ...
Upgrading schema to 152 ...
Upgrading schema to 153 ...
Upgrading schema to 154 ...
Upgrading schema to 155 ...
Upgrading schema to 156 ...
Upgrading schema to 157 ...
Upgrading schema to 158 ...
Upgrading schema to 159 ...
Upgrading schema to 160 ...
Upgrading schema to 161 ...
Upgrading schema to 162 ...
Upgrading schema to 163 ...
Upgrading schema to 164 ...
Upgrading schema to 165 ...
Upgrading schema to 166 ...
Upgrading schema to 167 ...
Upgrading schema to 168 ...
Upgrading schema to 169 ...
Migrating data to schema 151 ...
Exception in thread "main" com.google.gwtorm.server.OrmException: Cannot upgrade schema
        at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:120)
        at com.google.gerrit.pgm.init.BaseInit$SiteRun.upgradeSchema(BaseInit.java:383)
        at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:144)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:226)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:122)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:66)
        at Main.main(Main.java:28)
Caused by: java.sql.SQLException: Invalid operation for forward only resultset : first
        at oracle.jdbc.driver.InsensitiveScrollableResultSet.first(InsensitiveScrollableResultSet.java:541)
        at com.google.gerrit.server.schema.Schema_151.getFirstTimeMentioned(Schema_151.java:63)
        at com.google.gerrit.server.schema.Schema_151.migrateData(Schema_151.java:49)
        at com.google.gerrit.server.schema.SchemaVersion.migrateData(SchemaVersion.java:155)
        at com.google.gerrit.server.schema.SchemaVersion.upgradeFrom(SchemaVersion.java:94)
        at com.google.gerrit.server.schema.SchemaVersion.check(SchemaVersion.java:85)
        at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:118)
        ... 11 more

 
Project Member

Comment 1 by gertvdijk@gmail.com, Nov 14

Cc: alic...@google.com
Components: Backend
Labels: Blocking-2.16
It seems that commit 64bf9e93 [1] (included since 2.16.x, touching Schema upgrade code needed for 2.15) is responsible for calling resultSet.first(), which seems unsupported in your configuration at least.

As a work-around, try seeing if this bug will not trigger if upgrading to 2.15.x first, then upgrading to 2.16.x, so that it will not run the changed schema code.

cc @aliceks

Adding Blocking-2.16 label for evaluation if this is a release blocker.

[1]: https://gerrit-review.googlesource.com/c/gerrit/+/122330
A default ResultSet object is not updatable and has a cursor that moves forward only. In order to have the cursor be movable                              ResultSet.TYPE_SCROLL_SENSITIVE, 
ResultSet.CONCUR_UPDATABLE
need to be set (according to Java documentation at least). 
I will test with upgrading to 2.15.x first and will let you know if that works.
Project Member

Comment 3 by david.os...@gmail.com, Nov 15

Status: Accepted (was: New)
Project Member

Comment 4 by david.os...@gmail.com, Nov 15

Status: ChangeUnderReview (was: Accepted)
https://gerrit-review.googlesource.com/c/gerrit/+/204666
Project Member

Comment 5 by gertvdijk@gmail.com, Nov 15

Labels: -Blocking-2.16 FixedIn-2.16.1
Status: Submitted (was: ChangeUnderReview)
Project Member

Comment 6 by luca.mil...@gmail.com, Nov 20

Status: Released (was: Submitted)

Sign in to add a comment