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

NULL pointer exception when push into empty repo #386

Closed
gitblit opened this Issue Aug 12, 2015 · 5 comments

Comments

Projects
None yet
1 participant
@gitblit
Copy link
Owner

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 90

Using version 0.9.3 GO, and the first push into new repo throw this exception:

java.lang.NullPointerException
    at com.gitblit.GitFilter.isActionAllowed(GitFilter.java:96)
        ...

Find this error in source v1.0.0-SNAPHSOT too:

@Override
protected boolean isActionAllowed(RepositoryModel repository, String action) {
    if (action.equals(gitReceivePack)) {
        ...

The action is really NULL.
I switched the equal (gitReceivePack.equals(action)) and push is OK, but i think this
is workaround.

Reported by czimmermann.gabor on 2012-04-20 14:32:54

@gitblit

This comment has been minimized.

Copy link
Owner

gitblit commented Aug 12, 2015

What is your Git client?

Reported by James.Moger on 2012-04-22 20:34:27

@gitblit

This comment has been minimized.

Copy link
Owner

gitblit commented Aug 12, 2015

Simple CLI, installed from package.

Mac: git version 1.7.7.5 (Apple Git-26) 
Linux:  git version 1.7.2.5

Reported by czimmermann.gabor on 2012-04-22 20:39:12

@gitblit

This comment has been minimized.

Copy link
Owner

gitblit commented Aug 12, 2015

Hmmmm.  I can not reproduce your result.  Why don't you set web.debugMode=true so that
we get some additional logging.

The GitFilter intercepts the incoming url requests from your client and should log
information like:

INFO  ARF: CHALLENGE empty.git/info/refs?service=git-receive-pack
INFO  ARF: empty.git/info/refs?service=git-receive-pack (100) authenticated
INFO  ARF: empty.git/git-receive-pack (100) authenticated

or

INFO  ARF: empty.git/info/refs?service=git-receive-pack (100) unauthenticated
INFO  ARF: empty.git/git-receive-pack (100) unauthenticated

Are you sure the repo url is correct?  What is logged to the console when you try to
push?  Can you set a breakpoint and paste the complete request url here?

Reported by James.Moger on 2012-04-23 16:58:11

@gitblit

This comment has been minimized.

Copy link
Owner

gitblit commented Aug 12, 2015

It seems that Apple repaired. :-)

The System Updater installed new java version, and git package. (1.7.9.4)

Since then, I can not reproduce the error. Sorry.

The web interface is, however, throws NPE.

For example:

http://demo-gitblit.rhcloud.com/git/empty.git




Reported by czimmermann.gabor on 2012-04-24 12:07:52


- _Attachment: Safari.png
![Safari.png](https://storage.googleapis.com/google-code-attachments/gitblit/issue-90/comment-4/Safari.png)_
@gitblit

This comment has been minimized.

Copy link
Owner

gitblit commented Aug 12, 2015

That is not a bug; the repository clone urls can not be browsed.  And you picked a complicated
example because that repo is empty.

This is the browseable entry point:
http://demo-gitblit.rhcloud.com/summary/gitblit.git

Maybe someday the url schema will be unified and/or simpler.

Reported by James.Moger on 2012-04-24 12:15:27

  • Status changed: WontFix

@gitblit gitblit closed this Aug 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment