xcaddy plugin build fails with caddy version greater than v2.4.3

This issue has been created since 2021-09-28.

I have a private caddy plugin, which works fine with caddy version v2.4.3 & below. I can build the binary with this version

xcaddy build v2.4.3  --output reverse-proxy --with github.com/sharadregoti/sharad-reverse-proxy=.
2021/09/28 13:05:08 [INFO] Resolved relative replacement github.com/sharadregoti/sharad-reverse-proxy=. to /home/sharad/unotech/microservices/sharad-reverse-proxy
2021/09/28 13:05:08 [INFO] Temporary folder: /tmp/buildenv_2021-09-28-1305.848602894
2021/09/28 13:05:08 [INFO] Writing main module: /tmp/buildenv_2021-09-28-1305.848602894/main.go
2021/09/28 13:05:08 [INFO] Initializing Go module
2021/09/28 13:05:08 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2021/09/28 13:05:08 [INFO] Replace github.com/sharadregoti/sharad-reverse-proxy => /home/sharad/unotech/microservices/sharad-reverse-proxy
2021/09/28 13:05:08 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod edit -replace github.com/sharadregoti/sharad-reverse-proxy=/home/sharad/unotech/microservices/sharad-reverse-proxy
2021/09/28 13:05:08 [INFO] Pinning versions
2021/09/28 13:05:08 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/[email protected]
go get: added github.com/beorn7/perks v1.0.1
go get: added github.com/caddyserver/caddy/v2 v2.4.3
go get: added github.com/caddyserver/certmagic v0.14.0
go get: added github.com/cespare/xxhash/v2 v2.1.1
go get: added github.com/golang/protobuf v1.5.2
go get: added github.com/google/uuid v1.2.0
go get: added github.com/klauspost/cpuid/v2 v2.0.6
go get: added github.com/libdns/libdns v0.2.1
go get: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go get: added github.com/mholt/acmez v0.1.3
go get: added github.com/miekg/dns v1.1.42
go get: added github.com/prometheus/client_golang v1.10.1-0.20210603120351-253906201bda
go get: added github.com/prometheus/client_model v0.2.0
go get: added github.com/prometheus/common v0.26.0
go get: added github.com/prometheus/procfs v0.6.0
go get: added go.uber.org/atomic v1.7.0
go get: added go.uber.org/multierr v1.6.0
go get: added go.uber.org/zap v1.17.0
go get: added golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
go get: added golang.org/x/net v0.0.0-20210525063256-abc453219eb5
go get: added golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40
go get: added golang.org/x/term v0.0.0-20210503060354-a79de5458b56
go get: added golang.org/x/text v0.3.6
go get: added google.golang.org/protobuf v1.26.0
2021/09/28 13:05:10 [INFO] Build environment ready
2021/09/28 13:05:10 [INFO] Building Caddy
2021/09/28 13:05:10 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy
go: found github.com/sharadregoti/sharad-reverse-proxy in github.com/sharadregoti/sharad-reverse-proxy v0.0.0-00010101000000-000000000000
2021/09/28 13:05:10 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/sharad/unotech/microservices/sharad-reverse-proxy/reverse-proxy -ldflags -w -s -trimpath
2021/09/28 13:05:12 [INFO] Build complete: reverse-proxy
2021/09/28 13:05:12 [INFO] Cleaning up temporary folder: /tmp/buildenv_2021-09-28-1305.848602894

But when I try to build the plugin with caddy version v2.4.4, i get the below error

xcaddy build v2.4.4  --output reverse-proxy --with github.com/sharadregoti/sharad-reverse-proxy=.
2021/09/28 13:07:46 [INFO] Resolved relative replacement github.com/sharadregoti/sharad-reverse-proxy=. to /home/sharad/unotech/microservices/sharad-reverse-proxy
2021/09/28 13:07:46 [INFO] Temporary folder: /tmp/buildenv_2021-09-28-1307.736279814
2021/09/28 13:07:46 [INFO] Writing main module: /tmp/buildenv_2021-09-28-1307.736279814/main.go
2021/09/28 13:07:46 [INFO] Initializing Go module
2021/09/28 13:07:46 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2021/09/28 13:07:46 [INFO] Replace github.com/sharadregoti/sharad-reverse-proxy => /home/sharad/unotech/microservices/sharad-reverse-proxy
2021/09/28 13:07:46 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod edit -replace github.com/sharadregoti/sharad-reverse-proxy=/home/sharad/unotech/microservices/sharad-reverse-proxy
2021/09/28 13:07:46 [INFO] Pinning versions
2021/09/28 13:07:47 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/[email protected]
go get: added github.com/beorn7/perks v1.0.1
go get: added github.com/caddyserver/caddy/v2 v2.4.4
go get: added github.com/caddyserver/certmagic v0.14.4
go get: added github.com/cespare/xxhash/v2 v2.1.1
go get: added github.com/golang/protobuf v1.5.2
go get: added github.com/google/uuid v1.3.0
go get: added github.com/klauspost/cpuid/v2 v2.0.9
go get: added github.com/libdns/libdns v0.2.1
go get: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go get: added github.com/mholt/acmez v1.0.0
go get: added github.com/miekg/dns v1.1.42
go get: added github.com/prometheus/client_golang v1.11.0
go get: added github.com/prometheus/client_model v0.2.0
go get: added github.com/prometheus/common v0.26.0
go get: added github.com/prometheus/procfs v0.6.0
go get: added go.uber.org/atomic v1.7.0
go get: added go.uber.org/multierr v1.6.0
go get: added go.uber.org/zap v1.19.0
go get: added golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
go get: added golang.org/x/net v0.0.0-20210614182718-04defd469f4e
go get: added golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
go get: added golang.org/x/term v0.0.0-20210503060354-a79de5458b56
go get: added golang.org/x/text v0.3.6
go get: added google.golang.org/protobuf v1.27.1
2021/09/28 13:07:48 [INFO] Build environment ready
2021/09/28 13:07:48 [INFO] Building Caddy
2021/09/28 13:07:48 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy
go: found github.com/sharadregoti/sharad-reverse-proxy in github.com/sharadregoti/sharad-reverse-proxy v0.0.0-00010101000000-000000000000
go: finding module for package go.opentelemetry.io/otel/label
caddy imports
        github.com/sharadregoti/sharad-reverse-proxy imports
        github.com/sharadregoti/sharad-reverse-proxy/modules imports
        github.com/sharadregoti/sharad-reverse-proxy/modules/admin imports
        github.com/sharadregoti/sharad-reverse-proxy/managers/store imports
        github.com/go-redis/redis/v8 imports
        go.opentelemetry.io/otel/label: module go.opentelemetry.io/[email protected] found (v1.0.0), but does not contain package go.opentelemetry.io/otel/label
2021/09/28 13:07:53 [INFO] Cleaning up temporary folder: /tmp/buildenv_2021-09-28-1307.736279814
2021/09/28 13:07:53 [FATAL] exit status 1

Same with caddy version 2.4.5

francislavoie wrote this answer on 2021-09-28

What version of Go are you using? Please make sure you're on 1.17.

sharadregoti wrote this answer on 2021-09-29

Yes, i am using 1.17
image

mohammed90 wrote this answer on 2021-09-29

There seems to be a breaking change in OpenTelemetry which removes a package

go.opentelemetry.io/otel/label: module go.opentelemetry.io/[email protected] found (v1.0.0), but does not contain package go.opentelemetry.io/otel/label

The label package exists in v0.17.0

https://pkg.go.dev/go.opentelemetry.io/[email protected]

But not in v0.18.0

https://pkg.go.dev/go.opentelemetry.io/[email protected]

This seems to be an issue in a dependency of your package, as the error message says the import graph is from your package to redis to otel. Try pinning the dependency or handle the breaking change. Since it isn't an issue with Caddy, I'm closing this.

More Details About Repo
Owner Name caddyserver
Repo Name xcaddy
Full Name caddyserver/xcaddy
Language Go
Created Date 2020-03-21
Updated Date 2022-09-22
Star Count 381
Watcher Count 14
Fork Count 72
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Is there a way to get streamed ONLY closed candles off an interval instead of all klines ? 1 2021-05-12 2022-08-14
BinanceWebSocketApiManager.stop_stream() doesn't stop the stream immediately 9 2021-04-06 2022-08-14
help! I can't see it. 1 2021-02-24 2022-05-02
Webm video doesn’t play on iPhone. 0 2021-03-07 2022-05-02
Error power usage data not found. 5 2021-09-30 2022-07-08
Arduino compiling error streams-i2s-a2dp 11 2021-11-30 2022-09-08
Check for installed programs 2 2021-08-07 2022-05-18
Larvel 8 Issue with Installing haruncpi/laravel-user-activity package 0 2022-04-19 2022-09-18
Add chart to show TF adjustments for specific values 0 2022-05-03 2022-07-31
I2C addr flag not reset inside I2C_ITAddrCplt 0 2022-02-11 2022-08-29
Sniper tries to buy BEFORE liquidity is added 0 2021-07-19 2022-09-26
Video request: lsp-java 0 2021-07-11 2022-08-30
[BUG] Weird output from from_ansi 7 2022-03-26 2022-09-17
Menu button & action button not working in latest update? 11 2022-02-23 2022-08-08
How to mass scale object interaction? 2 2022-01-15 2022-07-21
[PORTER]gcr.io/k8s-staging-sig-storage/smbplugin:canary 1 2022-06-29 2022-07-24
[Bug] Unable to parse use statements when having `use a::b as c`? 26 2022-02-19 2022-09-11
[100% Remote] Senior Front-end Developer (React.js) at @sevenapps 0 2022-07-05 2022-09-13
Packer needs to fetch before checking out to a new commit 4 2021-08-18 2022-07-29
System Error when running Ganache 2.6.0-beta.3 on linux 0 2021-11-13 2022-08-16
Slowness when setting update_cwd to true on windows 15 2021-11-19 2022-09-02
Support husky v6 1 2021-04-10 2022-01-07
Protobuf build error... With ndk 2 2022-04-12 2022-09-18
How to connect to Pinterest API? 0 2022-04-10 2022-09-02
Infrastructure (Serverfull Domain) 0 2021-03-20 2022-09-04
stroom ships with v0.3 of standard-pipelines pack which has a bug in it 1 2021-10-22 2022-07-24
Crash report: `Error: invalid BigNumber string (argument="value", value="0x-96c3c5", code=INVALID_ARGUMENT, version=bignumber/5.4.1)` 0 2021-10-13 2022-07-13
You appear under glass tiles in the SecurEye camera app 4 2022-07-17 2022-09-27
Prometheus output of downstream listener per-thread metrics are different for main and worker threads 1 2022-08-30 2022-08-30
Test-VmwDscConfiguration doesn't work 3 2021-04-28 2022-09-27
Different alerts mix up summary 1 2021-03-17 2022-08-27
About send pictures 1 2021-12-04 2021-12-30
[Feature Request]: Responsive Data Table Description Widths 3 2022-05-06 2022-09-06
Have been output 2 2021-06-03 2022-01-12
How to configure lws with LWS_WITH_SECURE_STREAMS? 2 2021-10-14 2022-09-25
Please fix the build instructions. Ubuntu 20.10 is EOL 3 2022-01-24 2022-09-20
migration does not update angular cdk to latest version 0 2022-08-11 2022-08-18
Support multi line comments 2 2020-03-27 2022-02-08
CreateUser(Email, Password) 500 internal error 0 2022-06-10 2022-06-16
Custom tag support 2 2020-04-01 2022-01-14
6.10.2 Flutter 中常用的 Sliver 1 2022-03-18 2022-09-28
text copied from a Linux app doesn't appear on clipboard history on windows (win+v) 4 2021-08-05 2022-08-19
Add RPM >= 4.16 packages retrieving support 0 2021-09-27 2022-08-30
Error: forkpty(3) failed. Docker arm 2 2021-03-24 2022-09-01
Cranelift: Wrong result for `icmp.i128 eq` on aarch64 0 2022-08-13 2022-09-17
Scheduled weekly dependency update for week 26 1 2021-06-28 2022-09-12
[Bug] Ads Found on Shorts. 1 2021-09-23 2022-09-16
[Feature] overlayfs mounts 3 2021-03-20 2022-09-25
Add new modular template 1 2020-05-07 2022-09-05
[Bug Report][3.0.0-beta.6] Alert icon and title not align 0 2022-08-01 2022-08-22