Can anyone think of a reason why someone might be getting USERAUTH fail
when using clj
to attempt to fetch a public repository via https
? š
If you could share a repro that would help
To close this loop, he had this in his ~/.gitconfig
:
[url "git@github.com:"]
Ā Ā insteadOf =Ā <https://github.com/>
Thanks, @alexmiller and @seancorfield!
Was he OK with removing that to get clj
to work?
(I'm kind of curious as to why anyone would want all <https://github.com/>
URLs to switch the ssh access version?)
Iām curious too!
Heās at his day job at the moment, so I wonāt know more (why he had that in there, if heās OK removing it) until this evening, probably.
:thumbsup:
Confirmed that that was the issue. Thanks again. š:skin-tone-2:
Sure thing.
clj -Sdeps '{:deps {probcomp/metaprob {:git/url "<https://github.com/probcomp/metaprob.git>" :sha "8dc9d09f747c1e29886bb9628a0110c6f6bc6f5a"}}}'
Works for me. Fails for my colleague.
Iāll get you the exact message.
Hereās what heās seeing: https://a.cl.ly/llu2n0yR
Iām confused as to why it appears to be attempting to fetch via git ssh
.
well it's a git dep
FWIW, that command-line works fine for me on WSL2 (Ubuntu) on Windows 10 and also on macOS 10.12.
Can't test it on Powershell since I don't have the Clojure CLI installed on Windows natively any more.
I agree though that it does look like it's trying to use ssh though
@alexmiller Where could the jgit stuff be getting auth from that might cause a failure with a public git repo?
it's not that that it's not getting auth but that it's looking for it in the first place
> well itās a git dep Sorry, what I meant was: Iām confused that it appears to be trying to fetch via SSH.
Perhaps Iām reading this output wrong?
is there any chance that they have a ~/.gitconfig with a url.<base>.insteadOf set?
that allows you to direct git to use a different url instead of the original one and can be used to swap https for ssh urls
Or perhaps they have a deps.edn
file in that directory that already specifies that library via git@github
?
the -Sdeps is merged last so that shouldn't affect anything
(they're running that command in their downloads folder so who knows what is in there)
Yeah, itās possible.
Iāll ask.
should look for [url "git@github.com:"]
and then an insteadOf
line in /.gitconfig
- something like that
Got it.
[url "git@github.com:"]
insteadOf = <https://github.com/>
I was able to repro with that
Seems like heās signed off. Iāll check back in when I can get ahold of him again.
I see! Hopefully thatās the culprit.
Thanks for the help!
could even be more generic like:
[url "git://"]
insteadOf = https://
can't say I've ever messed with that config before!
Yeah, me either.
The colleague having the issue is wanting to do some volunteer work on some of our private repositories, and I suspect he probably has a lot going on in his ~/.ssh/config
from his job.
From talking to Ghadi earlier I know how to set up a new machine for use with clj
+ private repositories, but Iām not clear yet on how to configure a machine that has a lot of extant ~/.ssh/config
settings.
well, the answer is probably ... it depends
For instance, I know that because of JSch
clj
doesnāt play well with IdentityFile
declarations, and should instead be set up to read keys from the ssh-agent
, but I donāt think I can ask this person to change their ~/.ssh/config
in a way that might impact their work setup.
> it depends
Yeah, I suppose thereās no way out but through. Iām going to have to understand what their existing ~/.ssh/config
settings are doing in detail.
What's the equivalent of lein install
with deps.edn?
clojure -X:deps mvn-install
https://clojure.org/reference/deps_and_cli#_local_maven_install
(you'll probably need to generate a pom.xml
file first -- I can't remember)
Oh, and that's assuming you're on 1.10.1.697 or later.
@alexmiller how safe is it to rely on tdeps putting src/main/clojure on the classpath indefinitely?
@dominicm I didn't think it did? :paths ["src"]
is in the system deps
Oops, via pom.xml*
I'm confused by what you mean
no, you don't - you can either rely on the pom inside the jar or supply the g/a/v externally
or supply the pom
@alexmiller there's always src/main/clojure added when doing a local/root to a pom.xml right now.
So local dep with pom.xml
Not planning to change that