davideuler / gitblit

Automatically exported from code.google.com/p/gitblit
Apache License 2.0
0 stars 0 forks source link

Internal error due to entering SSH key through browser flow #571

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. generate public key with Git Bash for windows
2. cut and paste ssh key from Git Bash for windows to gitblit site 'add ssh 
key' from browser.
3. select 'add'.

What is the expected output? What do you see instead?
Should accept but throws an internal error.  To resolve, I delete the generated 
key on the server under <gitblit install>/data/ssh/<ownername>.keys

NOTE: Once you get into this state (internal error when trying to get to the 
'my profile' page), there is no way to get into the 'my profile' page.  It 
always throws an internal error.

As a workaround, the user can remove spurious newlines from the cut-n-paste 
operation.  A colleague had a similar problem on the linux flow with no obvious 
workaround as in the above windows flow.

Seems like a more robust scrubbing of the input text would resolve issue like 
removing all newlines and reduce whitespace to single whitespace before 
processing input.

What version of the product are you using? On what operating system?

gitblit 1.6.2 / windows

Please provide any additional information below.

Gitblit is awesome.  Fantastic work! 

Thank you!

Original issue reported on code.google.com by mark.n.p...@gmail.com on 7 Mar 2015 at 3:12

GoogleCodeExporter commented 9 years ago

Original comment by James.Mo...@gmail.com on 7 Mar 2015 at 2:13

GoogleCodeExporter commented 9 years ago
Issue 563 has been merged into this issue.

Original comment by James.Mo...@gmail.com on 7 Mar 2015 at 2:14

GoogleCodeExporter commented 9 years ago
A fix has been pushed to master & develop.

Original comment by James.Mo...@gmail.com on 7 Mar 2015 at 2:28

GoogleCodeExporter commented 9 years ago
Same issue here.

There are no additional linebreaks in the uploaded ssh key.

Stacktrace:

2015-03-10 09:59:33 [ERROR] unexpected exception when handling another 
exception: null
java.lang.IllegalArgumentException
    at org.apache.catalina.connector.Response.normalize(Response.java:1799)
    at org.apache.catalina.connector.Response.toAbsolute(Response.java:1732)
    at org.apache.catalina.connector.Response.encodeURL(Response.java:1242)
    at org.apache.catalina.connector.ResponseFacade.encodeURL(ResponseFacade.java:406)
    at org.apache.wicket.protocol.http.WebResponse.encodeURL(WebResponse.java:149)
    at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.encode(WebRequestCodingStrategy.java:387)
    at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:248)
    at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
    at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1296)
    at org.apache.wicket.RequestCycle.step(RequestCycle.java:1363)
    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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at com.gitblit.servlet.EnforceAuthenticationFilter.doFilter(EnforceAuthenticationFilter.java:87)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at com.gitblit.servlet.ProxyFilter$1.doFilter(ProxyFilter.java:74)
    at com.gitblit.servlet.ProxyFilter.doFilter(ProxyFilter.java:67)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Original comment by peter.ho...@jalin.de on 10 Mar 2015 at 9:03

Attachments:

GoogleCodeExporter commented 9 years ago
How does the key start?  The stacktrace is not diagnostic because we have 
nested exceptions here and the inner exception is not included.

Original comment by James.Mo...@gmail.com on 10 Mar 2015 at 2:23