Community
Participate
Working Groups
Build Identifier: M20100211-1343 We cannot import a smart HTTP (Apache2+git-http-backend) repository using EGit. Various colleagues and I are seeing this error in Eclipse 3.4.2 and 3.5.2 with both EGit 0.7.1 and current bleeding edge nightly builds as of May 4, 2010. Using the same repository from other servers, with the native Linux command-line git client, works as expected. Reproducible: Always Steps to Reproduce: 1. File->Import, select Git Repository. 2. Setup a smart HTTP repository, using http://git.hostname.com/repos/project.git and a valid username and password 3. Get a "Transport Error: Cannot list the available branches. Reason: http://username@git.hostname.com/repos/project.git: 401 Authorization Required"
Also, I tested using msysgit's git implementation on Windows, and it also works properly.
Created attachment 170508 [details] Password collection dialog in EclipseAuthenticator
I am also seeing this problem when accessing a similar environment. It would appear that the current code does not supply identity information when prompted by the server. Looking at the code it would appear that an org.eclipse.egit.ui.EclipseAuthenticator is created and set as the default authenticator for HTTP communications, but this currently only responds in the case of proxy server configuration. In the attached patch I have augmented this Authenticator to throw up a username/password prompt and to respond with these credentials in the case that the current proxy check yields no result. With this patch in place I am able to use the remote functionality without the authentication failure. Not being 100% familiar with the existing code, I am not sure whether the EclipseAuthenticator should be wrapped in an if thus: if (getRequestorType() == Authenticator.RequestorType.PROXY) { ... current code ... } else { ... server code prompt user ... } Note: I am not able to test the original proxy functionality! Note: With the current UI, I can't see a simple way to capture or store the auth information for the remote repository. Presumably there needs to be an additional configuration to capture remote URL's and auth information? Hope this helps Ian
This is a missing feature in JGit. We should at least disable the credential input fields in eGit until JGit bug 296201 is fixed.
There is already an open bug. The feature is simply not implemented yet. As a first solution we should disable the credential input fields in EGit. *** This bug has been marked as a duplicate of bug 296201 ***
I closed the bug by mistake. I wanted to track the EGit part of the bug here.
http(s) is a missing feature in JGit. It is however a bug that EGit allows the user to provide credentials and only later on reports an error.
we will work on this in M2
I proposed basic authentification for EGit: http://egit.eclipse.org/r/1961
merged as cfb8c6e0d57e09fa6013c2c27bb679df12455bc8
*** Bug 329532 has been marked as a duplicate of this bug. ***
this was finished in 0.10.0-M3 and HTTP authentication support should be covered in 0.10 noteworthy
Sorry, this bug is not resolved. Still happens to me in 1.2.0.20112221803-r. See also bug 338048, bug 339220 and bug 342592.
(In reply to comment #13) > Sorry, this bug is not resolved. Still happens to me in 1.2.0.20112221803-r. > > See also bug 338048, bug 339220 and bug 342592. It's neither working via HTTP nor via HTTPS.
@Jörn: Are you behind a proxy? If yes, maintain the proxy in Eclipse and restart Eclipse.
(In reply to comment #15) > @Jörn: Are you behind a proxy? If yes, maintain the proxy in Eclipse and > restart Eclipse. @Lars: No, i'm not behind a proxy. I resolved my problem. Reason is that eGIT performs Http Basic authentication on the first GET only which is not so nice. I had apache configured to request authentication only on "^/git/.*/(git-receive-pack|git-upload-pack)" but not on "^/git/.*/info/refs.*$". In that situation the first GET (performed in TransportHttp.connect(...)) succeeds without Authorization request (401) by the server, however, the next POST to git/<repo>/git-upload-pack is answered by the server by a 401 which leads to an exception in eGit (even though it is a perfectly valid answer by the server). There are also two other things which I think could be better from a user perspective: - If the server (or client) closes the tcp connection - for whatever reason - the server will request a new Authorization for the next HTTP request. Should be handled as well because that bit me several times. - The loop in TransportHttp.connect(...) should be configurable. It hit me that I entered the wrong password which is authenticated against the active directory on the server - and due to the loop my windows user was locked several times. It would be nice if we could configure the max number of trials. - In eGit, if I don't want to store the password in the secure store eGit is asking me always for user/password. It would be really nice if eGit would remember the user/password in that case for the eclipse session. Anyway, thank you for your great work!
Okay, but now I've got a new problem: GIT PUSH is not working in eGIT. In that case the client/server communication is as follows: >eGit> GET /git/git_server.git/info/refs?service=git-receive-pack <Git-Server< 401 Unauthorized, Authentication: Basic and at that point eGit quits with the message "Repository http://server:444/git/git_server.git failed to write". Stack Trace: !ENTRY org.eclipse.egit.core 4 0 2012-01-19 17:49:19.006 !MESSAGE An exception occurred during push on URI https://mucsd47r.server.westlb.net:444/git/git_server.git: An internal Exception occurred during push: https://mucsd47r.server.westlb.net:444/git/git_server.git: cannot open git-receive-pack !STACK 0 org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of push command at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:156) at org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:227) at org.eclipse.egit.ui.internal.push.PushOperationUI.execute(PushOperationUI.java:145) at org.eclipse.egit.ui.internal.push.PushOperationUI$1.run(PushOperationUI.java:202) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: org.eclipse.jgit.errors.TransportException: https://mucsd47r.server.westlb.net:444/git/git_server.git: cannot open git-receive-pack at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:466) at org.eclipse.jgit.transport.TransportHttp.openPush(TransportHttp.java:365) at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:130) at org.eclipse.jgit.transport.Transport.push(Transport.java:1120) at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:152) ... 4 more Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:523) at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:355) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318) at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:167) at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:429) ... 8 more
(In reply to comment #17) > Okay, but now I've got a new problem: GIT PUSH is not working in eGIT. In that > case the client/server communication is as follows: > > >eGit> GET /git/git_server.git/info/refs?service=git-receive-pack > > <Git-Server< 401 Unauthorized, Authentication: Basic > > and at that point eGit quits with the message "Repository > http://server:444/git/git_server.git failed to write". > > Stack Trace: > > !ENTRY org.eclipse.egit.core 4 0 2012-01-19 17:49:19.006 > !MESSAGE An exception occurred during push on URI > https://mucsd47r.server.westlb.net:444/git/git_server.git: An internal > Exception occurred during push: > https://mucsd47r.server.westlb.net:444/git/git_server.git: cannot open > git-receive-pack > !STACK 0 > org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during > execution of push command > at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:156) > at org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:227) > at > org.eclipse.egit.ui.internal.push.PushOperationUI.execute(PushOperationUI.java:145) > at > org.eclipse.egit.ui.internal.push.PushOperationUI$1.run(PushOperationUI.java:202) > at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) > Caused by: org.eclipse.jgit.errors.TransportException: > https://mucsd47r.server.westlb.net:444/git/git_server.git: cannot open > git-receive-pack > at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:466) > at > org.eclipse.jgit.transport.TransportHttp.openPush(TransportHttp.java:365) > at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:130) > at org.eclipse.jgit.transport.Transport.push(Transport.java:1120) > at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:152) > ... 4 more > Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext > connection? > at > com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:523) > at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:355) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149) > at > sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434) > at > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166) > at > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172) > at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) > at > sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318) > at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:167) > at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:429) > ... 8 more Sorry, forget about that one, this is a non-issue!