Fork me on GitHub
#tools-deps
<
2020-10-14
>
zane03:10:30

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? 😕

Alex Miller (Clojure team)03:10:41

If you could share a repro that would help

zane03:10:18

Sure thing.

clj -Sdeps '{:deps {probcomp/metaprob {:git/url "" :sha "8dc9d09f747c1e29886bb9628a0110c6f6bc6f5a"}}}'

zane03:10:25

Works for me. Fails for my colleague.

zane03:10:35

I’ll get you the exact message.

zane03:10:57

Here’s what he’s seeing: https://a.cl.ly/llu2n0yR

zane03:10:11

I’m confused as to why it appears to be attempting to fetch via git ssh.

seancorfield03:10:56

FWIW, that command-line works fine for me on WSL2 (Ubuntu) on Windows 10 and also on macOS 10.12.

seancorfield03:10:01

Can't test it on Powershell since I don't have the Clojure CLI installed on Windows natively any more.

Alex Miller (Clojure team)03:10:16

I agree though that it does look like it's trying to use ssh though

seancorfield03:10:22

@alexmiller Where could the jgit stuff be getting auth from that might cause a failure with a public git repo?

Alex Miller (Clojure team)03:10:44

it's not that that it's not getting auth but that it's looking for it in the first place

zane03:10:51

> well it’s a git dep Sorry, what I meant was: I’m confused that it appears to be trying to fetch via SSH.

zane03:10:02

Perhaps I’m reading this output wrong?

Alex Miller (Clojure team)03:10:41

is there any chance that they have a ~/.gitconfig with a url.<base>.insteadOf set?

Alex Miller (Clojure team)03:10:43

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

seancorfield03:10:54

Or perhaps they have a deps.edn file in that directory that already specifies that library via git@github?

Alex Miller (Clojure team)03:10:38

the -Sdeps is merged last so that shouldn't affect anything

seancorfield03:10:44

(they're running that command in their downloads folder so who knows what is in there)

zane03:10:03

Yeah, it’s possible.

zane03:10:16

I’ll ask.

Alex Miller (Clojure team)03:10:22

should look for [url "[email protected]:"] and then an insteadOf line in /.gitconfig - something like that

Alex Miller (Clojure team)04:10:19

I was able to repro with that

zane04:10:22

Seems like he’s signed off. I’ll check back in when I can get ahold of him again.

zane04:10:33

I see! Hopefully that’s the culprit.

zane04:10:42

Thanks for the help!

Alex Miller (Clojure team)04:10:00

could even be more generic like:

Alex Miller (Clojure team)04:10:01

[url "git://"]
        insteadOf = https://

Alex Miller (Clojure team)04:10:24

can't say I've ever messed with that config before!

zane04:10:30

Yeah, me either.

zane04:10:21

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.

zane04:10:27

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.

Alex Miller (Clojure team)04:10:53

well, the answer is probably ... it depends

zane04:10:08

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.

zane04:10:09

> 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.

zane18:10:46

To close this loop, he had this in his ~/.gitconfig:

[url "[email protected]:"]
  insteadOf = 

seancorfield18:10:54

Was he OK with removing that to get clj to work?

seancorfield18:10:32

(I'm kind of curious as to why anyone would want all URLs to switch the ssh access version?)

zane18:10:30

I’m curious too!

zane18:10:33

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.

3
zane03:10:54

Confirmed that that was the issue. Thanks again. 👍:skin-tone-2:

PB19:10:22

What's the equivalent of lein install with deps.edn?

seancorfield19:10:12

clojure -X:deps mvn-install

🙏 3
seancorfield19:10:44

(you'll probably need to generate a pom.xml file first -- I can't remember)

Alex Miller (Clojure team)20:10:31

no, you don't - you can either rely on the pom inside the jar or supply the g/a/v externally

seancorfield19:10:56

Oh, and that's assuming you're on 1.10.1.697 or later.

dominicm19:10:28

@alexmiller how safe is it to rely on tdeps putting src/main/clojure on the classpath indefinitely?

seancorfield19:10:36

@dominicm I didn't think it did? :paths ["src"] is in the system deps

dominicm19:10:01

Oops, via pom.xml*

Alex Miller (Clojure team)20:10:58

I'm confused by what you mean

dominicm20:10:13

@alexmiller there's always src/main/clojure added when doing a local/root to a pom.xml right now.

Alex Miller (Clojure team)21:10:20

So local dep with pom.xml

Alex Miller (Clojure team)21:10:36

Not planning to change that

👍 3