Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcaddy failing to build with NTLM #3

Closed
alexandzors opened this issue Jul 13, 2022 · 10 comments
Closed

xcaddy failing to build with NTLM #3

alexandzors opened this issue Jul 13, 2022 · 10 comments

Comments

@alexandzors
Copy link

Looks like when trying to build with NTLM via xcaddy its complaining about a version mismatch.

2022/07/13 16:35:52 [INFO] exec (timeout=0s): /opt/hostedtoolcache/go/1.18.3/x64/bin/go get -d -v github.com/caddyserver/ntlm-transport github.com/caddyserver/caddy/v2 
go: downloading github.com/caddyserver/ntlm-transport v0.1.2
go: github.com/caddyserver/ntlm-transport@upgrade (v0.1.2) requires github.com/caddyserver/caddy/v2@v2.5.3-0.20220713145230-c2bbe42fc355, not github.com/caddyserver/caddy/v2@upgrade (v2.5.2)
2022/07/13 16:35:56 [FATAL] exit status 1
Error: Process completed with exit code 1.

I saw via issue #2 that it was fixed. Was the version supposed to be bumped to Caddy 2.5.2 and not the non-existent version of 2.5.3?

@mholt
Copy link
Member

mholt commented Jul 13, 2022

Oh... yeah, that's because xcaddy by default will build with the latest released version of Caddy, which is 2.5.2 currently.

If you set CADDY_VERSION=c2bbe42fc3553f6a5685cdb45453c0950fa614b2 and run xcaddy it will work. (I just tried it.)

@ElPistoler0
Copy link

ElPistoler0 commented Jul 26, 2022

Hi. Thank you for your reply. I added the variable but still get no love:

`2022/07/26 11:08:06 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/ntlm-transport github.com/caddyserver/caddy/v2
go: github.com/caddyserver/ntlm-transport@upgrade (v0.1.2) requires github.com/caddyserver/caddy/v2@v2.5.3-0.20220713145230-c2bbe42fc355, not github.com/caddyserver/caddy/v2@upgrade (v2.5.2)
2022/07/26 11:08:06 [FATAL] exit status 1

root@DP1:~# echo $CADDY_VERSION
c2bbe42fc3553f6a5685cdb45453c0950fa614b2`

What am I doing wrong?

Thanks!

@mholt
Copy link
Member

mholt commented Jul 26, 2022

You are using Go 1.18 right?

Could also try --with github.com/caddyserver/caddy/v2@c2bbe42fc3553f6a5685cdb45453c0950fa614b2 just to see...

@ElPistoler0
Copy link

Indeed, go version go1.18.1 linux/amd64

@ElPistoler0
Copy link

No cigar...

2022/07/26 12:25:38 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@c2bbe42fc3553f6a5685cdb45453c0950fa614b2 github.com/caddyserver/caddy/v2
go: downloading github.com/caddyserver/caddy/v2 v2.5.3-0.20220713145230-c2bbe42fc355
go: github.com/caddyserver/caddy/v2@upgrade (v2.5.2) conflicts with github.com/caddyserver/caddy/v2@c2bbe42fc3553f6a5685cdb45453c0950fa614b2 (v2.5.3-0.20220713145230-c2bbe42fc355)
2022/07/26 12:25:44 [FATAL] exit status 1

@ElPistoler0
Copy link

This is my cmd

xcaddy build --with github.com/caddyserver/caddy/v2@c2bbe42fc3553f6a5685cdb45453c0950fa614b2 --with github.com/caddy-dns/cloudflare --with github.com/mholt/caddy-webdav --with github.com/greenpau/caddy-auth-portal --with github.com/greenpau/caddy-trace --with github.com/porech/caddy-maxmind-geolocation --with github.com/ueffel/caddy-brotli --with github.com/caddyserver/transform-encoder --with github.com/mholt/caddy-l4/layer4 --with github.com/caddyserver/ntlm-transport --output /usr/local/bin/caddy

@mholt
Copy link
Member

mholt commented Jul 26, 2022

Ah, sorry, try this:

$ CADDY_VERSION=c2bbe42fc3553f6a5685cdb45453c0950fa614b2 xcaddy build --with github.com/caddyserver/ntlm-transport

That worked for me. If it still fails then it's probably a conflict with another plugin.

@ElPistoler0
Copy link

That last one did the trick, thank you! What happens when Caddy itself gets updated? How to get the version string?

@mholt
Copy link
Member

mholt commented Jul 27, 2022

@ElPistoler0 Once a new version of Caddy is tagged (v2.5.3 probably), you won't need to use one. By default Go uses the last release, and since the fix hasn't been released yet, you need to use a commit that does have the fix until the release is tagged.

At that point you can just remove the CADDY_VERSION=... part.

@ElPistoler0
Copy link

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants