tomaswolf / gerrit-gitblit-plugin

Integrates standard GitBlit (currently 1.7.1) as a repository viewer in Gerrit
Apache License 2.0
22 stars 5 forks source link

browsing revision from review UI leads to internal error #22

Closed chenfengxu closed 8 years ago

chenfengxu commented 8 years ago

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

tomaswolf commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

Fixed in version v2.12.171.2.