Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » URI not supported cloning repository
URI not supported cloning repository [message #1739246] Thu, 28 July 2016 20:03 Go to next message
paolo di tommaso is currently offline paolo di tommasoFriend
Messages: 22
Registered: July 2009
Junior Member
Dear all,

I'm experiencing a very strange error while cloning a repository. The strange thing is that I'm setting a HTTP clone URL bug JGit report an exception saying that "URI not supported: ssh:///git@github.com:/nextflow-io/hello.git" (full stack trace below).

To make things even more bizarre this piece code works perfectly in other systems. I'm getting this exception only on a specific test box (CircleCI).


Any clue what's wrong? Why JGit insists on using SSH protocol besides HTTP has been specified?

Cheers, p

nextflow.scm.AssetManagerTest > testPull STANDARD_OUT
    19:47:59.862 [Test worker] DEBUG nextflow.scm.RepositoryProvider  Request [credentials -:-] -> https://api.github.com/repos/nextflow-io/hello/contents/nextflow.config
    19:48:01.084 [Test worker] DEBUG nextflow.scm.RepositoryProvider  Request [credentials -:-] -> https://api.github.com/repos/nextflow-io/hello/contents/main.nf
    19:48:01.255 [Test worker] DEBUG nextflow.scm.RepositoryProvider  Request [credentials -:-] -> https://api.github.com/repos/nextflow-io/hello
    19:48:01.364 [Test worker] DEBUG nextflow.scm.AssetManager  Pulling nextflow-io/hello -- Using remote clone url: https://github.com/nextflow-io/hello.git
    19:48:01.499 [Test worker] DEBUG org.eclipse.jgit.util.FS  readpipe [git, --version],/usr/bin
    19:48:01.526 [Test worker] DEBUG org.eclipse.jgit.util.FS  readpipe may return 'git version 2.7.4'
    19:48:01.527 [Test worker] DEBUG org.eclipse.jgit.util.FS  remaining output:

    19:48:01.533 [Test worker] DEBUG org.eclipse.jgit.util.FS  readpipe [git, config, --system, --edit],/usr/bin
    19:48:01.549 [Test worker] DEBUG org.eclipse.jgit.util.FS  readpipe may return 'null'
    19:48:01.549 [Test worker] DEBUG org.eclipse.jgit.util.FS  remaining output:

    19:48:01.552 [Thread-6] ERROR org.eclipse.jgit.util.FS  fatal: Could not switch to '/usr/etc/': No such file or directory

    19:48:01.555 [Test worker] DEBUG org.eclipse.jgit.util.FS  readpipe rc=128
    19:48:01.555 [Test worker] DEBUG org.eclipse.jgit.util.FS  readpipe returns null

nextflow.scm.AssetManagerTest > testPull FAILED
    org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of fetch command
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:141)
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:202)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:135)
        at nextflow.scm.AssetManager.download(AssetManager.groovy:536)
        at nextflow.scm.AssetManagerTest.testPull(AssetManagerTest.groovy:144)

        Caused by:
        org.eclipse.jgit.errors.NotSupportedException: URI not supported: ssh:///git@github.com:/nextflow-io/hello.git
            at org.eclipse.jgit.transport.Transport.open(Transport.java:573)
            at org.eclipse.jgit.transport.Transport.open(Transport.java:442)
            at org.eclipse.jgit.transport.Transport.open(Transport.java:323)
            at org.eclipse.jgit.transport.Transport.open(Transport.java:292)
            at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:119)
            ... 4 more

Re: URI not supported cloning repository [message #1739258 is a reply to message #1739246] Fri, 29 July 2016 06:16 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 240
Registered: July 2009
Senior Member
Are you sure you don't have anything weird in your global config? What is the output in a bash of 'git -C / config -l' (please make sure there are no secrets in the output before you post it).

Ciao
Chris
Re: URI not supported cloning repository [message #1739260 is a reply to message #1739258] Fri, 29 July 2016 06:58 Go to previous messageGo to next message
paolo di tommaso is currently offline paolo di tommasoFriend
Messages: 22
Registered: July 2009
Junior Member
Interesting, this is what I've found

$ git config -l
url.ssh://git@github.com:.insteadof=https://github.com


JGit uses this information and replaces https with ssh?
Re: URI not supported cloning repository [message #1739262 is a reply to message #1739260] Fri, 29 July 2016 07:07 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 240
Registered: July 2009
Senior Member
Yes. As described in https://www.kernel.org/pub/software/scm/git/docs/git-config.html#_variables when you search for "url.<base>.insteadOf" git and JGit use this parameter to replace URIs

Ciao
Chris
Re: URI not supported cloning repository [message #1739263 is a reply to message #1739260] Fri, 29 July 2016 07:17 Go to previous message
paolo di tommaso is currently offline paolo di tommasoFriend
Messages: 22
Registered: July 2009
Junior Member
Yes, removing the .gitconfig file solve the problem.

Thanks for the support.

Cheers,
Paolo
Previous Topic:Apply patch problem
Next Topic:Can org.eclipse.jgit feature import org.slf4j.impl.log4j12 rather than include it
Goto Forum:
  


Current Time: Sat Jul 22 17:19:12 GMT 2017

Powered by FUDForum. Page generated in 0.02350 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software