Gerrit 2.1.6 upgrade

56 views
Skip to first unread message

Ted

unread,
Dec 8, 2010, 7:45:07 PM12/8/10
to Repo and Gerrit Discussion
When upgrading an existing 2.1.5.1 installation to 2.1.6, when prompted to

*** Git Repositories
***

Location of Git repositories   [git]:
Import existing repositories   [Y/n]?

Should I be answering Yes or No to importing repositories?
When I answer Yes, I get the following error at the end of the questions :

Create new self-signed SSL certificate [y/N]?

Upgrading database schema from version 40 to 41 ...
Upgrading database schema from version 41 to 42 ...
Upgrading database schema from version 42 to 43 ...
Upgrading database schema from version 43 to 44 ...
Upgrading database schema from version 44 to 45 ...
Upgrading database schema from version 45 to 46 ...
Upgrading database schema from version 46 to 47 ...
Scanning /var/gerrit/review_site/git
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(Unknown Source)
    at com.google.gerrit.server.git.GitProjectImporter.importProjects(GitProjectImporter.java:82)
    at com.google.gerrit.server.git.GitProjectImporter.run(GitProjectImporter.java:60)
    at com.google.gerrit.pgm.Init$SiteRun.importGit(Init.java:246)
    at com.google.gerrit.pgm.Init.run(Init.java:86)
    at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:76)
    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:155)
    at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:89)
    at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:47)
    at Main.main(Main.java:25)





--
Ted.

Shawn Pearce

unread,
Dec 8, 2010, 7:53:31 PM12/8/10
to Ted, Repo and Gerrit Discussion
On Wed, Dec 8, 2010 at 16:45, Ted <r6squ...@gmail.com> wrote:
> When upgrading an existing 2.1.5.1 installation to 2.1.6, when prompted to
>
> *** Git Repositories
> ***
>
> Location of Git repositories   [git]:
> Import existing repositories   [Y/n]?
>
> Should I be answering Yes or No to importing repositories?

If you haven't created any new repositories by hand that Gerrit
doesn't know about, its safe (and faster) to answer no here.

> When I answer Yes, I get the following error at the end of the questions :
>
> Create new self-signed SSL certificate [y/N]?
>
> Upgrading database schema from version 40 to 41 ...
> Upgrading database schema from version 41 to 42 ...
> Upgrading database schema from version 42 to 43 ...
> Upgrading database schema from version 43 to 44 ...
> Upgrading database schema from version 44 to 45 ...
> Upgrading database schema from version 45 to 46 ...
> Upgrading database schema from version 46 to 47 ...

Your database upgrade was successful. So you can just start the server now.

> Scanning /var/gerrit/review_site/git
> Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String
> index out of range: -1
>     at java.lang.String.substring(Unknown Source)
>     at
> com.google.gerrit.server.git.GitProjectImporter.importProjects(GitProjectImporter.java:82)
>     at

Ouch. You have some weird looking repository name that the importer
fell over on. I'll have to go digging to see what this might be.

Shawn Pearce

unread,
Dec 8, 2010, 8:02:22 PM12/8/10
to Ted, Repo and Gerrit Discussion
On Wed, Dec 8, 2010 at 16:53, Shawn Pearce <s...@google.com> wrote:
>
>> Scanning /var/gerrit/review_site/git
>> Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String
>> index out of range: -1
>>     at java.lang.String.substring(Unknown Source)
>>     at
>> com.google.gerrit.server.git.GitProjectImporter.importProjects(GitProjectImporter.java:82)
>>     at
>
> Ouch.  You have some weird looking repository name that the importer
> fell over on.  I'll have to go digging to see what this might be.

You have a ".git" in the top of your directory, which is confusing the importer.

That is, /var/gerrit/review_site/git/.git exists. This makes no
sense because the project name is the empty string. We're assuming
here that we always have at least 1 character in the directory path,
and we don't. You might want to move (or remove altogether) that .git
from the top of your git base path.

Ted

unread,
Dec 8, 2010, 8:41:10 PM12/8/10
to Shawn Pearce, Repo and Gerrit Discussion
thanks, that fixed it.

Not sure how that got there, probably when I was previously importing repositories I may have made a cp  mistake a while back during the initial installation.
--
Ted.

Reply all
Reply to author
Forward
0 new messages