Upgrading from ~2.11/2.12 to 2.13 or 2.15: "No enum constant ...GeneralPreferencesInfo.DownloadCommand"

63 views
Skip to first unread message

Ivan Vučica

unread,
Dec 23, 2019, 2:35:23 AM12/23/19
to Repo and Gerrit Discussion
I'm trying to get an installation of Gerrit which hasn't been running in a *really* long time up and running again, but migrate it to the latest 3.x branch. It's been running against mysql last time it was operational.

I thought there might be JRE problems, so I went from OpenJDK 10 down to OpenJDK 7, as shipped in Debian.

This is what the init process when running under OpenJDK 7's java prints out:

===
Installing plugins.
Install plugin commit-message-length-validator version v2.13 [y/N]? n
Install plugin download-commands version v2.13 [y/N]?
Install plugin hooks version v2.13 [y/N]?
Install plugin replication version v2.13 [y/N]?
Install plugin reviewnotes version v2.13 [y/N]?
Install plugin singleusergroup version v2.13 [y/N]?
Initializing plugins.
No plugins found with init steps.

Upgrading schema to 119 ...
Upgrading schema to 120 ...
Upgrading schema to 121 ...
Upgrading schema to 122 ...
Upgrading schema to 123 ...
Upgrading schema to 124 ...
Upgrading schema to 125 ...
Upgrading schema to 126 ...
Upgrading schema to 128 ...
Upgrading schema to 129 ...
Migrating data to schema 119 ...
Exception in thread "main" java.lang.IllegalArgumentException: No enum constant com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand.
        at java.lang.Enum.valueOf(Enum.java:236)
        at com.google.gerrit.extensions.client.GeneralPreferencesInfo$DownloadCommand.valueOf(GeneralPreferencesInfo.java:30)             
===

I don't really understand how this happens. How can this constant not exist even if the plugin is installed? Why does this even get loaded if the MySQL database seemingly contains no preferences relating to DownloadCommand?

This happens whether I have plugins installed or not.


This happens with all 2.12.x, at least 2.13.0 and at least with 2.15.18.

How do I make com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand enum constant available to JRE?

David Ostrovsky

unread,
Dec 24, 2019, 2:39:24 AM12/24/19
to Repo and Gerrit Discussion
I wasn't able to reproduce the problem. I installed gerrit 2.12 and tried to
set download command property to a different value, but in the database
the value was always NULL. So that the migration to 2.13 worked as
expected: [1].

I went ahead and removed that stale general preference entirely: [2].

Apparently it is a left over of some older gerrit UI. Can you check the values
of column download_command in accounts table? The supported values are
the enum values. I also think you could just reset the table entirely by saying:

  update accounts set download_command = null;

Warning: Always backup your production database before changing anything.
Moreover, I have only tested the above command on H2 database.



Reply all
Reply to author
Forward
0 new messages