Problem upgrading from 2.13.7 to 2.14 -- failure during init

408 views
Skip to first unread message

euphxenos

unread,
May 15, 2017, 8:31:30 PM5/15/17
to Repo and Gerrit Discussion
I'm trying to upgrade from Gerrit 2.13.7 to 2.14 on a CentOS system using the binary packages.  When I run a "yum update gerrit", it fails like this:

[root@gerrit-test ~]# yum update gerrit
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * extras: mirror.hmc.edu
 * gerritforge: dl.bintray.com
 * updates: centos.sonn.com
Resolving Dependencies
--> Running transaction check
---> Package gerrit.noarch 0:2.13.7-1 will be updated
---> Package gerrit.noarch 0:2.14-1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package          Arch             Version          Repository             Size
================================================================================
Updating:
 gerrit           noarch           2.14-1           gerritforge            83 M

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 83 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
gerrit-2.14-1.noarch.rpm                                   |  83 MB   00:05     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Checking Java version ... 1.8.0
  Updating   : gerrit-2.14-1.noarch                                         1/2 
warning: /var/gerrit/etc/gerrit.config created as /var/gerrit/etc/gerrit.config.rpmnew

Initialising Gerrit site ... FAILED
warning: %post(gerrit-2.14-1.noarch) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package gerrit-2.14-1.noarch
  Cleanup    : gerrit-2.13.7-1.noarch                                       2/2 
  Verifying  : gerrit-2.14-1.noarch                                         1/2 
  Verifying  : gerrit-2.13.7-1.noarch                                       2/2 

Updated:
  gerrit.noarch 0:2.14-1                                                        

Complete!


Looking in the postinstall scriptlet for the .rpm, it looks like it failed on this line:

$SUDO java -jar $GERRIT_SITE/bin/gerrit.war init --batch --install-all-plugins -d $GERRIT_SITE >>$LOG 2>>$LOG

When I look in the log in /tmp/gerrit-installer.log, I see this:

Checksum mysql-connector-java-5.1.41.jar OK
Upgrading schema to 130 ...
Upgrading schema to 131 ...
Upgrading schema to 132 ...
Upgrading schema to 133 ...
Upgrading schema to 134 ...
Upgrading schema to 135 ...
Upgrading schema to 136 ...
Upgrading schema to 137 ...
Upgrading schema to 138 ...
Upgrading schema to 139 ...
Upgrading schema to 140 ...
Upgrading schema to 141 ...
Upgrading schema to 142 ...
Migrating data to schema 130 ...
Migrating 20 repositories ...
Migration completed:  0 repositories updated:
> Done (0.443 s)
Migrating data to schema 131 ...
Migrating 20 repositories ...
Migration completed:  2 repositories updated:
All-Projects git-playground
> Done (0.074 s)
Migrating data to schema 132 ...
> Done (0.000 s)
Migrating data to schema 133 ...
> Done (0.000 s)
Migrating data to schema 134 ...
> Done (0.000 s)
Migrating data to schema 135 ...
> Done (0.012 s)
Migrating data to schema 136 ...
> Done (0.000 s)
Migrating data to schema 137 ...
> Done (0.000 s)
Migrating data to schema 138 ...
> Done (0.000 s)
Migrating data to schema 139 ...
> Done (0.069 s)
Migrating data to schema 140 ...
> Done (0.008 s)
Migrating data to schema 141 ...
> Done (0.001 s)
Migrating data to schema 142 ...
> Done (0.272 s)
Execute the following SQL to drop unused objects:

  DROP TABLE change_message_id;
  DROP TABLE account_patch_reviews;
  DROP TABLE account_project_watches;
  DROP TABLE account_ssh_keys;
  DROP TABLE starred_changes;
  DROP TABLE submodule_subscriptions;
  ALTER TABLE accounts DROP COLUMN show_site_header;
  ALTER TABLE accounts DROP COLUMN time_format;
  ALTER TABLE accounts DROP COLUMN maximum_page_size;
  ALTER TABLE accounts DROP COLUMN use_flash_clipboard;
  ALTER TABLE accounts DROP COLUMN diff_view;
  ALTER TABLE accounts DROP COLUMN copy_self_on_email;
  ALTER TABLE accounts DROP COLUMN download_command;
  ALTER TABLE accounts DROP COLUMN download_url;
  ALTER TABLE accounts DROP COLUMN date_format;
  ALTER TABLE accounts DROP COLUMN legacycid_in_change_table;
  ALTER TABLE accounts DROP COLUMN review_category_strategy;
  ALTER TABLE accounts DROP COLUMN relative_date_in_change_table;
  ALTER TABLE accounts DROP COLUMN size_bar_in_change_table;
  ALTER TABLE accounts DROP COLUMN mute_common_path_prefixes;
Exception in thread "main" java.lang.NoSuchMethodError: com.google.gerrit.pgm.init.api.ConsoleUI.readEnum(Ljava/lang/Enum;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Enum;
at com.googlesource.gerrit.plugins.its.base.its.InitIts.postRun(InitIts.java:77)
at com.google.gerrit.pgm.init.InitPlugins.postInitPlugins(InitPlugins.java:198)
at com.google.gerrit.pgm.init.InitPlugins.postRun(InitPlugins.java:114)
at com.google.gerrit.pgm.init.SitePathInitializer.postRun(SitePathInitializer.java:149)
at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:145)
at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:204)
at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:108)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:63)
at Main.main(Main.java:24)


Am I doing something wrong here, or should I open a bug for this?


thanks,
--Andrew

David Pursehouse

unread,
May 15, 2017, 9:32:49 PM5/15/17
to euphxenos, Repo and Gerrit Discussion
NoSuchMethodError is most likely caused by a plugin being built against a different API version.  In this case the stack trace looks like it's in its.base which would be included in one of the its- plugins (its-jira, etc).

If you have one of those plugins in your site's plugins/ folder, check its version and if necessary upgrade it to the one built for 2.14.


 

thanks,
--Andrew

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

euphxenos

unread,
May 15, 2017, 10:45:52 PM5/15/17
to Repo and Gerrit Discussion, euph...@gmail.com
Thanks -- that makes sense.  It didn't occur to me that I'd need to upgrade the plugins before the upgrade for use during init (I was guessing I'd need to do that after the upgrade before I start the new version).  I'll give that a try.


--Andrew

Luca Milanesio

unread,
May 16, 2017, 2:37:37 AM5/16/17
to euphxenos, Repo and Gerrit Discussion
Yes, the problem is that its-jira plugin needs to be upgraded to the 2.14-compatible version.
The native packaging is unaware of what has been installed outside the RPM and thus did not know you had that plugin installed.

The its-jira for Gerrit 2.14 can be found at:

I am planning to include a "plugin version detection and upgrade" in the plugin-manager, which ships for the very first time with Gerrit 2.14.
Hopefully in the future these problems could be avoided :-)

Luca.
Reply all
Reply to author
Forward
0 new messages