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

Anonymous admins can not edit repository #786

Closed
gitblit opened this issue Aug 12, 2015 · 7 comments
Closed

Anonymous admins can not edit repository #786

gitblit opened this issue Aug 12, 2015 · 7 comments

Comments

@gitblit
Copy link
Collaborator

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 490

1. upgraded gitblit 1.3.1 to 1.6.0
2. see that all looks nice and dandy
3. navigate to a repository
4. click on `edit`
output is:
-----[snipsnip]------
Internal error

Return to home page
-----[snipsnip]------

2014-08-20 09:11:58 [INFO ] 18 repository models loaded for anonymous in 100 msecs
2014-08-20 09:11:58 [ERROR] Can't instantiate page using constructor public com.gitblit.wicket.pages.EditRepositoryPage(org.apache.wicket.PageParameters)
and argument r = "[alert]"
org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor
public com.gitblit.wicket.pages.EditRepositoryPage(org.apache.wicket.PageParameters)
and argument r = "[alert]"
        at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
        at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:89)
        at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:305)
        at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
        at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
        at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1639)
        at com.gitblit.servlet.EnforceAuthenticationFilter.doFilter(EnforceAuthenticationFilter.java:87)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1639)
        at com.gitblit.servlet.ProxyFilter$1.doFilter(ProxyFilter.java:74)
        at com.gitblit.servlet.ProxyFilter.doFilter(ProxyFilter.java:67)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1631)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:549)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:462)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
        ... 34 more
Caused by: java.lang.NullPointerException
        at com.gitblit.wicket.panels.RepositoryNamePanel.<init>(RepositoryNamePanel.java:68)
        at com.gitblit.wicket.pages.EditRepositoryPage.setupPage(EditRepositoryPage.java:415)
        at com.gitblit.wicket.pages.EditRepositoryPage.<init>(EditRepositoryPage.java:129)
        ... 39 more



Ubuntu 12.04.4 LTS - java version "1.7.0_65"

Reported by simon.santoro on 2014-08-20 07:29:39

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

It looks like the NPE is caused by not having a user object in the session.  Have you
logged in?

Reported by James.Moger on 2014-08-22 12:26:02

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I have
web.authenticateViewPages = false
web.authenticateAdminPages = false

It's only me who is using this gitblit instance, and I am using it without logging
in. 

Reported by simon.santoro on 2014-08-22 13:24:24

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

That's the issue.  This part of the code is expecting an authenticated user.  The workaround
for now is to enable authentication.

Reported by James.Moger on 2014-08-22 13:27:49

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Ok thanks.

Reported by simon.santoro on 2014-08-22 13:31:12

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Fix merged to master.

Reported by James.Moger on 2014-09-04 16:39:27

  • Status changed: Queued
  • Labels added: Milestone-1.6.1

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

v1.6.1 released

Reported by James.Moger on 2014-10-20 21:36:03

  • Status changed: Done

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

thanks. you're awesome.

Reported by simon.santoro on 2014-10-21 12:12:59

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 1.6.1 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants