Am I doing it wrong? - [FATAL] exit status 2 - xcaddy build v2.4.6 --with github.com/caddy-dns/cloudflare

This issue has been created since 2021-12-03.

I am sorry for pasting just a log here, but I cannot catch for anything meaningful (to not bother you).

  • I installed go 17.3 and latest xcaddy.

xcaddy version - v0.2.0 h1:PLtoEQ5LjjYQNyHEnFM+rWP9HYfxQejlYkBKE0M9vso=
ubuntu 20.0.4 aarch64 - up to date.
go 1.17.3

The moment I try to build it with

xcaddy build v2.4.6 --with github.com/caddy-dns/[email protected]

I get fatal.

[email protected]:~/go/bin$ sudo tar -C /usr/local -xzf go1.17.3.linux-arm64.tar.gz
[email protected]:~/go/bin$ xcaddy build v2.4.6 --with github.com/caddy-dns/[email protected]
2021/12/03 10:50:12 [INFO] Temporary folder: /tmp/buildenv_2021-12-03-1050.1397751167
2021/12/03 10:50:12 [INFO] Writing main module: /tmp/buildenv_2021-12-03-1050.1397751167/main.go
2021/12/03 10:50:12 [INFO] Initializing Go module
2021/12/03 10:50:12 [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/12/03 10:50:12 [INFO] Pinning versions
2021/12/03 10:50:12 [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.6
go get: added github.com/caddyserver/certmagic v0.15.2
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.1
go get: added github.com/miekg/dns v1.1.43
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-20210915214749-c084706c2272
go get: added golang.org/x/net v0.0.0-20210913180222-943fd674d43e
go get: added golang.org/x/sys v0.0.0-20210915083310-ed5796bab164
go get: added golang.org/x/term v0.0.0-20210503060354-a79de5458b56
go get: added golang.org/x/text v0.3.7
go get: added google.golang.org/protobuf v1.27.1
2021/12/03 10:50:14 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddy-dns/[email protected] 
go get: added github.com/caddy-dns/cloudflare v0.0.0-20210607183747-91cf700356a1
go get: added github.com/libdns/cloudflare v0.1.0
2021/12/03 10:50:14 [INFO] Build environment ready
2021/12/03 10:50:14 [INFO] Building Caddy
2021/12/03 10:50:14 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy 
2021/12/03 10:50:15 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/ubuntu/go/bin/caddy -ldflags -w -s -trimpath 
# runtime/internal/sys
/usr/local/go/src/runtime/internal/sys/stubs.go:9:7: PtrSize redeclared in this block
	/usr/local/go/src/runtime/internal/sys/arch.go:24:38: previous declaration
/usr/local/go/src/runtime/internal/sys/stubs.go:10:24: undefined: Uintreg
/usr/local/go/src/runtime/internal/sys/stubs.go:16:7: StackGuardMultiplier redeclared in this block
	/usr/local/go/src/runtime/internal/sys/arch.go:27:74: previous declaration
2021/12/03 10:50:15 [INFO] Cleaning up temporary folder: /tmp/buildenv_2021-12-03-1050.1397751167
2021/12/03 10:50:15 [FATAL] exit status 2

Caddy v2.2.3 h1:xxMaF/Nb3B5VhXkQREvjGUdfDgseMmc5IyhUktYO7gM= is already installed on the same machine. Could that be an issue?

VelinGeorgiev wrote this answer on 2021-12-03

Ok this has to do with how go lang is being upgraded.

More info here: golang/go#48134

The important step I was missing is just below. I had to cleanup my go folder.

sudo rm -rf /usr/local/go

install a fresh go copy

sudo wget -c https://golang.org/dl/go1.17.3.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.17.3.linux-arm64.tar.gz

Then execute

xcaddy build v2.4.6 --with github.com/caddy-dns/[email protected]

Everything worked like a charm.

mholt wrote this answer on 2021-12-03

Ah, yep. When installing Go you need to remove old versions because file extractions don't necessarily remove old files that aren't supposed to be there anymore. Thanks for following up!

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
Dostęp do projektu i wsparcie społeczności 3 2021-05-02 2022-05-10
Failed to interact with file_selector plugin 2 2022-02-10 2022-09-12
Inconsistency when accessing the metadata 1 2021-02-26 2022-09-06
Empty java.util.PriorityQueue causes IllegalArgumentException when loaded 2 2021-08-19 2022-06-30
Differenct performance on [Desktop(Intel i7-9700 CPU) + TPU(M.2 Accelerator B+M key) ] & [RADXA Rock 3A + TPU(M.2 Accelerator A+E key)] 3 2022-03-10 2022-08-18
Only works with some commands 1 2021-08-11 2022-08-15
Custom button vibration like a standard button on phones/tablets etc 0 2022-03-07 2022-07-31
Relax compiler warnings for imports used in scaladoc 5 2022-07-21 2022-08-16
Ability to add an event occurring in multiples dates? 2 2022-09-01 2022-09-20
Error build with Visual studio 2019 community edition 2 2021-04-04 2022-06-22
esp32 Serial.onWritable is firing continuously 6 2021-10-02 2022-08-16
[REQ] Improve tweet lisibility 0 2022-09-11 2022-09-23
[Rule change] When excluding files in `check-unnecessary-nullable`, such as `.g.dart`, should take their method *calls* into consideration, while ignoring methods *defined* there 5 2022-08-25 2022-09-22
codeFromUrl pipe not working with Raw URL 3 2020-02-14 2022-09-24
Remove the NACK during the stop_consuming 3 2022-09-16 2022-09-26
Long sentence representation 3 2021-12-12 2022-08-20
Review & Mapping by Biocaddie DATS [Metadata Working Group 3] 6 2016-06-03 2022-09-28
Case issue: Index.ts fails on Linux, works on Mac OS 4 2020-04-22 2022-08-21
bug in generated @PrimaryGeneratedColumn 1 2020-01-10 2022-08-21
Grain/Popping/Crackling audio when playing several Players 11 2021-09-23 2022-09-08
[BUG] printf invalid number error on some locale 4 2021-10-01 2022-09-27
swc.bundle() throws error: unknown variant `development` 1 2022-03-07 2022-07-11
Question about LIME results 1 2020-12-30 2022-09-19
vanilla js dont hot reload 3 2022-01-20 2022-09-26
Automatically scale down operators replicas on SNO clusters 1 2021-11-17 2022-08-05
AttributeError: module 'streamlit' has no attribute 'columns' 6 2021-09-25 2022-09-24
VueJS: responsivity manager doesn't hide invisible actions 0 2021-09-20 2022-07-24
Signagure pad internally uses valueChangedCallback 0 2021-09-22 2022-08-13
Refactoring: checkbox question 0 2021-09-14 2022-09-08
Started page is not rendered in react in versions: v1.8.66-67 in react 0 2021-09-18 2022-07-03
React TitleElement doesn't re-render on title element change in some cases 0 2021-09-20 2022-08-20
Special case API for getting the current span 27 2022-06-09 2022-09-06
[DATE]: [FEATURE NAME] 1 2021-11-13 2022-09-29
qBittorrent Web UI 怎么无法登入? 2 2021-07-11 2022-01-07
Rendering iframes in a sandbox 2 2022-03-11 2022-08-31
Previews: Track the OSS adoption 2 2022-03-31 2022-08-29
The error info is incorrect when creating one table with the name 'Tables' 7 2021-11-22 2022-07-03
[Website Request] MadaraDex 0 2021-11-27 2022-08-27
CIS 2.9 Remediation role error 3 2020-11-26 2022-09-23
Keras Model Import Problem: NullPointerException 7 2021-11-29 2022-09-09
v1.5.4.2 tag is missing 3 2022-01-17 2022-09-15
GCP AppEngine - traffic not migrated to new version 1 2022-01-06 2022-09-11
Is there a way to create JWK Key Set from public certificate and private key ? 5 2021-11-19 2022-09-09
oci os object sync help is incorrect on parameters and required fields 0 2022-05-11 2022-08-31
build error with CUDA on 6 2020-12-30 2022-09-14
padllite amlogic a311d movenet 推理报错 13 2022-05-26 2022-09-13
Improve language detection for small inputs 3 2021-11-13 2022-07-03
Glob pattern require leading slash in .gitignore in order to take effect. Why? 4 2017-02-19 2022-09-29
docs: add missing comma and drop incorrect hyphen 0 2021-08-15 2022-09-25
Assertion failure in `System.Net.Mail.Functional.Tests` on `mono OSX x64` 3 2022-07-27 2022-09-27