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

browsing revision from review UI leads to internal error #22

Closed
chenfengxu opened this issue Jul 10, 2016 · 3 comments
Closed

browsing revision from review UI leads to internal error #22

chenfengxu opened this issue Jul 10, 2016 · 3 comments
Assignees
Labels

Comments

@chenfengxu
Copy link

the repository is newly created, that has no any commits (without initial empty commit).

@tomaswolf
Copy link
Owner

tomaswolf commented Jul 14, 2016

Is there any exception trace in the logs? And what Gerrit version, and what version of the plugin?

I cannot reproduce this with Gerrit 2.12.1 and plugin version 2.12.171.1.

@tomaswolf
Copy link
Owner

All right, I can reproduce it now. One needs to have a completely empty repository and a change for it pushed to Gerrit (but not submitted yet). Then try to view that change in Gitblit via the (browse) link on the Gerrit change page.

Gives a org.apache.wicket.WicketRuntimeException caused by...

Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
    ... 57 more
Caused by: java.lang.NullPointerException
    at org.eclipse.jgit.lib.ObjectIdOwnerMap.get(ObjectIdOwnerMap.java:131)
    at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:857)
    at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
    at com.syntevo.bugtraq.BugtraqConfig.getBaseConfig(BugtraqConfig.java:181)
    at com.syntevo.bugtraq.BugtraqConfig.read(BugtraqConfig.java:76)
    at com.gitblit.utils.BugtraqProcessor.processTextRegex(BugtraqProcessor.java:151)
    at com.gitblit.utils.BugtraqProcessor.processPlainCommitMessage(BugtraqProcessor.java:89)
    at com.gitblit.utils.BugtraqProcessor.processCommitMessage(BugtraqProcessor.java:73)
    at com.gitblit.wicket.pages.RepositoryPage.addFullText(RepositoryPage.java:580)
    at com.gitblit.wicket.pages.CommitPage.<init>(CommitPage.java:122)

The problem is in com.syntevo.bugtraq.BugtraqConfig.getBaseConfig(), which doesn't account for a repo without HEAD.

@tomaswolf tomaswolf added the bug label Jul 15, 2016
@tomaswolf tomaswolf self-assigned this Jul 15, 2016
tomaswolf added a commit that referenced this issue Jul 15, 2016
If a repository is completely empty (no initial commit), but a change
was pushed to Gerrit and one then tries to view that change in Gitblit,
Gitblit fails with an internal server error caused by an NPE in
Syntevo's BugtraqConfig, which tries to read some config file from the
repository.

Fix by handling the case of a repository not having a HEAD yet.
@tomaswolf
Copy link
Owner

Fixed in version v2.12.171.2.

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

No branches or pull requests

2 participants