Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gerrit container stopped and invoked an unknown error. #113

Open
Abhishekqwerty opened this issue Mar 18, 2019 · 5 comments
Open

Gerrit container stopped and invoked an unknown error. #113

Abhishekqwerty opened this issue Mar 18, 2019 · 5 comments

Comments

@Abhishekqwerty
Copy link

Abhishekqwerty commented Mar 18, 2019

Hi when I ran docker run as follows:
docker run --name new_gerrit -p 8084:8080 -e WEBURL=http://<public_hostname>:8084 -e DATABASE_TYPE=mysql -e DATABASE_HOSTNAME=172.x.x.x -e DATABASE_PORT=3306 -e DATABASE_DATABASE=ReviewDb -e DATABASE_USERNAME=gerrit -e DATABASE_PASSWORD=gerrit -e AUTH_TYPE=DEVELOPMENT_BECOME_ANY_ACCOUNT -e GERRIT_INIT_ARGS='--install-plugin=download-commands' -v /home/cloud_user/gerrit_vol:/var/gerrit/review_site -d openfrontier/gerrit

Container fails to start in few seconds.
Following is the error log of docker container:

ls: /var/gerrit/review_site/git: No such file or directory
First time initialize gerrit...
[2019-03-18 09:41:30,817] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /var/gerrit/review_site/etc/gerrit.config; assuming defaults
Generating SSH host key ... rsa... ed25519... ecdsa 256... ecdsa 384... ecdsa 521... done
Initialized /var/gerrit/review_site
Reindexing projects: 100% (2/2)
Reindexed 2 documents in projects index in 0.2s (11.5/s)
/gerrit-entrypoint.sh: ignoring /docker-entrypoint-init.d/*
Waiting for database connection 172.17.0.2:3306 ...
Upgrading gerrit...
Downloading https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.43/mysql-connector-java-5.1.43.jar ... OK
Checksum mysql-connector-java-5.1.43.jar OK
Exception in thread "main" java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:623)
at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:587)
at org.eclipse.jgit.internal.storage.file.FileRepository.(FileRepository.java:153)
at com.google.gerrit.pgm.init.api.GitRepositoryManagerOnInit.openRepository(GitRepositoryManagerOnInit.java:46)
at com.google.gerrit.server.notedb.RepoSequence.acquire(RepoSequence.java:269)
at com.google.gerrit.server.notedb.RepoSequence.next(RepoSequence.java:197)
at com.google.gerrit.pgm.init.api.SequencesOnInit.nextAccountId(SequencesOnInit.java:49)
at com.google.gerrit.pgm.init.InitAdminUser.postRun(InitAdminUser.java:113)
at com.google.gerrit.pgm.init.SitePathInitializer.postRun(SitePathInitializer.java:151)
at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:146)
at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

@thinkernel
Copy link
Contributor

Hi @Abhishekqwerty. Thanks for trying this docker image.
About your issue, my guess is on the volume. Would you please remove "-v /home/cloud_user/gerrit_vol:/var/gerrit/review_site" from your command and try it again?

@Abhishekqwerty
Copy link
Author

Abhishekqwerty commented Mar 19, 2019

Thanks for your reply but then how to achieve persistent volume to store data on server.
This problem is not only docker but also when installing gerrit on server without using docker.
I removed "-v /home/cloud_user/gerrit_vol:/var/gerrit/review_site" from docker run command but still facing same issue.

@thinkernel
Copy link
Contributor

docker volume create gerrit_volume
docker run -v gerrit_volume:/var/gerrit/review_site ...

I'm changing the README about how to use named volume instead of host directory.
However if this issue is not only in docker but also on server installation, it might be a bug of the Gerrit. In that case you should report it to the gerrit project.

@Abhishekqwerty
Copy link
Author

Thanks for your response.
I was having issues for new versions of gerrit like from 2.15.x
But I tried openfrontier/gerrit:2.14.18 and it is working fine and also gerrit version 2.14.9 is working on normal server.

@thinkernel
Copy link
Contributor

Frankly speaking, I don't see any strange parameters in your command lines except AUTH_TYPE=DEVELOPMENT_BECOME_ANY_ACCOUNT. I always use AUTH_TYPE=LDAP in my envrionments. Both 2.14.x and 2.15.x are working fine in my daily work. I might give it a try on your command line and get back to you later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants