Caddy on Raspberry B - Build with plugin WOL

1. Caddy version: v2.6.2

2. How I installed, and run Caddy:

I installed with the help of francislavoie with a downloaded file for my old Raspberry:
sudo dpkg -i caddy_2.6.2_linux_armv6.deb

I did nothing except for “caddy run” and test if 192.168.1.2:80 shows that caddy is working before trying to build with the plugin.

a. System environment:

Linux raspberry 5.15.84+ on Model B Revision 2.0 with ARMv6 CPU

3. The problem I’m having:

I am trying to use xaddy to include a WOL Plugin which I need for my intended usecase of caddy.
I tried with

xcaddy build v2.6.2 \
    --with github.com/dulli/caddy-wol

but I think my Raspberry is too old/slow to get it done or I am doing something the wrong way. It downloads lots of files and freezes at some point (see #4). I interrupted with Ctrl+C after 30 minutes sitting at the last “error”.

4. Error messages and/or full log output:

Breece@raspberry:~ $ xcaddy build v2.6.2 \
    --with github.com/dulli/caddy-wol
2023/02/06 11:24:05 [INFO] Temporary folder: /tmp/buildenv_2023-02-06-1124.3198270248
2023/02/06 11:24:05 [INFO] Writing main module: /tmp/buildenv_2023-02-06-1124.3198270248/main.go
package main

import (
        caddycmd "github.com/caddyserver/caddy/v2/cmd"

        // plug in Caddy modules here
        _ "github.com/caddyserver/caddy/v2/modules/standard"
        _ "github.com/dulli/caddy-wol"
)

func main() {
        caddycmd.Main()
}
2023/02/06 11:24:05 [INFO] Initializing Go module
2023/02/06 11:24:05 [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
2023/02/06 11:24:05 [INFO] Pinning versions
2023/02/06 11:24:05 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@v2.6.2
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.6.2
go: added github.com/caddyserver/certmagic v0.17.2
go: added github.com/cespare/xxhash/v2 v2.1.2
go: added github.com/fsnotify/fsnotify v1.5.1
go: added github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
go: added github.com/golang/mock v1.6.0
go: added github.com/golang/protobuf v1.5.2
go: added github.com/google/uuid v1.3.0
go: added github.com/klauspost/cpuid/v2 v2.1.1
go: added github.com/libdns/libdns v0.2.1
go: added github.com/lucas-clemente/quic-go v0.29.2
go: added github.com/marten-seemann/qpack v0.2.1
go: added github.com/marten-seemann/qtls-go1-18 v0.1.3
go: added github.com/marten-seemann/qtls-go1-19 v0.1.1
go: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go: added github.com/mholt/acmez v1.0.4
go: added github.com/miekg/dns v1.1.50
go: added github.com/nxadm/tail v1.4.8
go: added github.com/onsi/ginkgo v1.16.4
go: added github.com/prometheus/client_golang v1.12.2
go: added github.com/prometheus/client_model v0.2.0
go: added github.com/prometheus/common v0.32.1
go: added github.com/prometheus/procfs v0.7.3
go: added go.uber.org/atomic v1.9.0
go: added go.uber.org/multierr v1.6.0
go: added go.uber.org/zap v1.23.0
go: added golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
go: added golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
go: added golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
go: added golang.org/x/net v0.0.0-20220812165438-1d4ff48094d1
go: added golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10
go: added golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: added golang.org/x/text v0.3.8-0.20211004125949-5bd84dd9b33b
go: added golang.org/x/tools v0.1.10
go: added golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f
go: added google.golang.org/protobuf v1.28.0
go: added gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
2023/02/06 11:25:19 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/dulli/caddy-wol github.com/caddyserv                                er/caddy/v2@v2.6.2
go: downloading github.com/dulli/caddy-wol v0.0.0-20220902190116-a8cbd416a163
go: downloading github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
go: downloading github.com/google/cel-go v0.12.5
go: downloading google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad
go: downloading github.com/smallstep/certificates v0.22.1
go: downloading github.com/smallstep/cli v0.22.0
go: downloading github.com/smallstep/truststore v0.12.0
go: downloading github.com/tailscale/tscert v0.0.0-20220316030059-54bbcb9f74e2
go: downloading github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b
go: downloading github.com/spf13/cobra v1.5.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/stoewer/go-strcase v1.2.0
go: downloading github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/smallstep/nosql v0.4.0
go: downloading go.step.sm/cli-utils v0.7.4
go: downloading go.step.sm/crypto v0.18.0
go: downloading go.step.sm/linkedca v0.18.0
go: downloading google.golang.org/grpc v1.47.0
go: downloading gopkg.in/square/go-jose.v2 v2.6.0
go: downloading howett.net/plist v1.0.0
go: downloading github.com/slackhq/nebula v1.5.2
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/micromdm/scep/v2 v2.1.0
go: downloading go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352
go: downloading github.com/Masterminds/sprig/v3 v3.2.2
go: downloading github.com/urfave/cli v1.22.5
go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
go: downloading github.com/manifoldco/promptui v0.9.0
go: downloading filippo.io/edwards25519 v1.0.0-rc.1
go: downloading github.com/mitchellh/go-ps v1.0.0
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading github.com/go-kit/kit v0.10.0
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver/v3 v3.1.1
go: downloading github.com/huandu/xstrings v1.3.2
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/shopspring/decimal v1.2.0
go: downloading github.com/spf13/cast v1.4.1
go: downloading github.com/dgraph-io/badger v1.6.2
go: downloading github.com/dgraph-io/badger/v2 v2.2007.4
go: downloading go.etcd.io/bbolt v1.3.6
go: downloading github.com/go-sql-driver/mysql v1.6.0
go: downloading github.com/jackc/pgx/v4 v4.14.0
go: downloading github.com/rs/xid v1.2.1
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading github.com/go-logfmt/logfmt v0.5.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/dgraph-io/ristretto v0.0.4-0.20200906165740-41ebdbffecfd
go: downloading github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
go: downloading github.com/jackc/pgconn v1.10.1
go: downloading github.com/jackc/pgio v1.0.0
go: downloading github.com/jackc/pgproto3/v2 v2.2.0
go: downloading github.com/jackc/pgtype v1.9.0
go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96
go: downloading github.com/golang/snappy v0.0.4
go: downloading github.com/klauspost/compress v1.15.11
go: downloading github.com/jackc/chunkreader/v2 v2.0.1
go: downloading github.com/jackc/pgpassfile v1.0.0
go: downloading github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/mattn/go-isatty v0.0.13
go: added github.com/dulli/caddy-wol v0.0.0-20220902190116-a8cbd416a163
2023/02/06 11:37:02 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v
go: downloading github.com/go-chi/chi v4.1.2+incompatible
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/BurntSushi/toml v1.2.0
go: downloading github.com/alecthomas/chroma v0.10.0
go: downloading github.com/yuin/goldmark v1.5.2
go: downloading github.com/yuin/goldmark-highlighting v0.0.0-20220208100518-594be1970594
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0
go: downloading go.opentelemetry.io/contrib v0.20.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.0
go: downloading go.opentelemetry.io/otel/exporters/otlp v0.20.0
go: downloading go.opentelemetry.io/otel v1.9.0
go: downloading go.opentelemetry.io/otel/sdk v1.4.0
go: downloading github.com/felixge/httpsnoop v1.0.3
go: downloading go.opentelemetry.io/otel/metric v0.31.0
go: downloading go.opentelemetry.io/otel/trace v1.9.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.0
go: downloading go.opentelemetry.io/proto/otlp v0.12.0
go: downloading github.com/dlclark/regexp2 v1.4.0
go: downloading github.com/go-logr/logr v1.2.3
go: downloading github.com/cenkalti/backoff/v4 v4.1.2
go: downloading github.com/cenkalti/backoff v2.2.1+incompatible
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
go: downloading github.com/go-logr/stdr v1.2.2
2023/02/06 11:39:24 [INFO] Build environment ready
2023/02/06 11:39:24 [INFO] Building Caddy
2023/02/06 11:39:24 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy
go: downloading github.com/stretchr/testify v1.8.0
go: downloading go.uber.org/goleak v1.1.12
go: downloading github.com/onsi/gomega v1.13.0
go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
go: downloading gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/benbjohnson/clock v1.1.0
go: downloading github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
go: downloading github.com/google/go-cmp v0.5.8
go: downloading github.com/kr/pretty v0.3.0
go: downloading github.com/kr/text v0.1.0
go: downloading github.com/rogpeppe/go-internal v1.9.0
go: downloading github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1
go: downloading github.com/aws/aws-sdk-go v1.44.37
go: downloading cloud.google.com/go/kms v1.4.0
go: downloading cloud.google.com/go v0.100.2
go: downloading github.com/googleapis/gax-go/v2 v2.4.0
go: downloading google.golang.org/api v0.84.0
go: downloading github.com/cockroachdb/apd v1.1.0
go: downloading github.com/gofrs/uuid v4.0.0+incompatible
go: downloading github.com/go-stack/stack v1.8.0
go: downloading github.com/chzyer/logex v1.1.10
go: downloading cloud.google.com/go/iam v0.1.0
go: downloading golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb
go: downloading github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65
go: downloading github.com/lib/pq v1.10.2
go: downloading github.com/jmespath/go-jmespath v0.4.0
go: downloading cloud.google.com/go/compute v1.6.1
go: downloading go.opencensus.io v0.23.0
go: downloading google.golang.org/appengine v1.6.7
go: downloading github.com/OneOfOne/xxhash v1.2.2
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa
2023/02/06 11:43:00 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/Breece/caddy -ldflags -w -s -trimpath
# github.com/lucas-clemente/quic-go/internal/qtls
/home/Breece/go/pkg/mod/github.com/lucas-clemente/quic-go@v0.29.2/internal/qtls/go120.go:5:13: cannot use "The version of quic-go you're using can          't be built on Go 1.20 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string           constant "The version of quic-go you're using can't be built on Go 1.20 yet. F...) as int value in variable declaration
^C2023/02/06 12:14:26 [INFO] SIGINT: Shutting down
2023/02/06 12:14:26 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-02-06-1124.3198270248
2023/02/06 12:14:26 [FATAL] context canceled

5. What I already tried:

I was thinking of trying to compile the new .deb on another machine, but lack the knowledge (and machine). I am a bit confused as to why so many things get downloaded. The go folder (/home/Breece/go) on my raspi is growing rapidly (now at 1,x GB)
Is there a way to use WOL in caddy without this plugin? Its integration looked quite elegant, but I am open to ideas.

6. Links to relevant resources:

That’s certainly possible. Those devices weren’t made to compile large projects.

What you can do is cross-compile, i.e. compile a build on a different machine which is more powerful. All you need to do is specify the GOOS and GOARCH environment variables to xcaddy build and it will build for that combination. So in your case, GOOS=linux GOARCH=armv6.

This works because Caddy is a pure-Go project, and has no external dependencies after being compiled (i.e. no dependence on C libraries and such which are platform dependent). The vast majority of Caddy plugins are also pure-Go as well.

Yeah, Caddy v2.6.2 can’t build on Go 1.20. You’ll need to downgrade to Go 1.19 for the time being.

We’re about to release v2.6.3 in the coming days which will support Go 1.20 though.

You won’t need to make another .deb. You can use the dpkg-divert and update-alternatives instructions to just swap out the binary with your custom one. That’s the purpose of those steps. Now that you have something functional, you can follow those steps.

1 Like

Thank you very much. I will wait for 2.6.3 and will try that cross compile. Will “updating” / “installing” the Deb file delete all settings, or keep them? I will have to build future updates, because of my armv6 plattform, won’t I? “Just” installing over the older version seems easier to me.

Installing new versions of the deb will only replace non-config support files, like the systemd unit, the default index.html welcome page, etc. Your Caddyfile is left untouched. Those support files change rarely, only if changes in Caddy itself call for it.

If you divert because you need to use a custom build for plugins, then installing the new deb doesn’t update Caddy itself because you “took control” of the Caddy binary.

1 Like

Thank you again. Just to clarify:

If you divert because you need to use a custom build for plugins, then installing the new deb doesn’t update Caddy itself because you “took control” of the Caddy binary.

Does the following work:
I build a custom build with plug-ins and install it. An update for caddy geht’s published. I build the update with plug-ins and install.

Or do I have to do:
I build a custom build with plug-ins and install it. An update for caddy geht’s published. I build the update with plug-ins and divert.

You only need to do the divert steps once. After that, to update the binary, you replace /usr/bin/caddy.custom instead.

Thank you again (and again).
So I will wait for 2.6.3 just to start with the newer version. I will install it then build my custom binary with plugins, place it in the folder I will begin executing the whole divert part (as described in the documentation). So far so good?

For future updates, what do I replace in /usr/bin/caddy.custom (and where do I get what is needed to be replaced)?
I am, you never would have guessed, a bit new to this, so please forgive me for asking (most likely) obvious questions…

That’s the actual Caddy program itself. When you use xcaddy build, it produces a new program in the current directory named caddy (by default; you can use --output to change it). You can move that to /usr/bin/caddy.custom to replace your previous build.

1 Like

I tried to build again with 2.6.3 (on the raspberry and on a VM with go v1.20 and 1.19.5) and got a different error:

$ xcaddy build \
    --with github.com/dulli/caddy-wol
2023/02/09 10:22:13 [INFO] Temporary folder: /tmp/buildenv_2023-02-09-1022.11017                   12178
2023/02/09 10:22:13 [INFO] Writing main module: /tmp/buildenv_2023-02-09-1022.11                   01712178/main.go
package main

import (
        caddycmd "github.com/caddyserver/caddy/v2/cmd"

        // plug in Caddy modules here
        _ "github.com/caddyserver/caddy/v2/modules/standard"
        _ "github.com/dulli/caddy-wol"
)

func main() {
        caddycmd.Main()
}
2023/02/09 10:22:13 [INFO] Initializing Go module
2023/02/09 10:22:13 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init cad                   dy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2023/02/09 10:22:14 [INFO] Pinning versions
2023/02/09 10:22:14 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v git                   hub.com/caddyserver/caddy/v2
go: downloading github.com/caddyserver/caddy/v2 v2.6.3
go: downloading github.com/prometheus/client_golang v1.14.0
go: downloading github.com/quic-go/quic-go v0.32.0
go: downloading go.uber.org/zap v1.24.0
go: downloading golang.org/x/sys v0.5.0
go: downloading golang.org/x/term v0.5.0
go: downloading github.com/klauspost/cpuid/v2 v2.2.3
go: downloading golang.org/x/crypto v0.5.0
go: downloading golang.org/x/net v0.5.0
go: downloading github.com/prometheus/client_model v0.3.0
go: downloading github.com/prometheus/common v0.37.0
go: downloading github.com/prometheus/procfs v0.8.0
go: downloading google.golang.org/protobuf v1.28.1
go: downloading github.com/onsi/ginkgo/v2 v2.2.0
go: downloading github.com/quic-go/qpack v0.4.0
go: downloading golang.org/x/tools v0.2.0
go: downloading golang.org/x/text v0.6.0
go: downloading golang.org/x/mod v0.6.0
go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
go: downloading github.com/quic-go/qtls-go1-18 v0.2.0
go: downloading github.com/quic-go/qtls-go1-19 v0.2.0
go: downloading github.com/quic-go/qtls-go1-20 v0.1.0
go: downloading github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.6.3
go: added github.com/caddyserver/certmagic v0.17.2
go: added github.com/cespare/xxhash/v2 v2.1.2
go: added github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
go: added github.com/golang/mock v1.6.0
go: added github.com/golang/protobuf v1.5.2
go: added github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
go: added github.com/google/uuid v1.3.0
go: added github.com/klauspost/cpuid/v2 v2.2.3
go: added github.com/libdns/libdns v0.2.1
go: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go: added github.com/mholt/acmez v1.0.4
go: added github.com/miekg/dns v1.1.50
go: added github.com/onsi/ginkgo/v2 v2.2.0
go: added github.com/prometheus/client_golang v1.14.0
go: added github.com/prometheus/client_model v0.3.0
go: added github.com/prometheus/common v0.37.0
go: added github.com/prometheus/procfs v0.8.0
go: added github.com/quic-go/qpack v0.4.0
go: added github.com/quic-go/qtls-go1-18 v0.2.0
go: added github.com/quic-go/qtls-go1-19 v0.2.0
go: added github.com/quic-go/qtls-go1-20 v0.1.0
go: added github.com/quic-go/quic-go v0.32.0
go: added go.uber.org/atomic v1.9.0
go: added go.uber.org/multierr v1.6.0
go: added go.uber.org/zap v1.24.0
go: added golang.org/x/crypto v0.5.0
go: added golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
go: added golang.org/x/mod v0.6.0
go: added golang.org/x/net v0.5.0
go: added golang.org/x/sys v0.5.0
go: added golang.org/x/term v0.5.0
go: added golang.org/x/text v0.6.0
go: added golang.org/x/tools v0.2.0
go: added google.golang.org/protobuf v1.28.1
2023/02/09 10:26:00 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v git                   hub.com/dulli/caddy-wol github.com/caddyserver/caddy/v2
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/cel-go v0.13.0
go: downloading google.golang.org/genproto v0.0.0-20230202175211-008b39050e57
go: downloading github.com/smallstep/certificates v0.23.2
go: downloading github.com/smallstep/truststore v0.12.1
go: downloading go.step.sm/crypto v0.23.2
go: downloading github.com/tailscale/tscert v0.0.0-20230124224810-c6dc1f4049b2
go: downloading github.com/spf13/cobra v1.6.1
go: downloading github.com/antlr/antlr4/runtime/Go/antlr v1.4.10
go: downloading github.com/smallstep/nosql v0.5.0
go: downloading go.step.sm/cli-utils v0.7.5
go: downloading go.step.sm/linkedca v0.19.0
go: downloading google.golang.org/grpc v1.52.3
go: downloading github.com/slackhq/nebula v1.6.1
go: downloading github.com/inconshreveable/mousetrap v1.0.1
go: downloading github.com/Masterminds/sprig/v3 v3.2.3
go: downloading github.com/urfave/cli v1.22.12
go: downloading filippo.io/edwards25519 v1.0.0
go: downloading github.com/Microsoft/go-winio v0.6.0
go: downloading github.com/Masterminds/semver/v3 v3.2.0
go: downloading github.com/huandu/xstrings v1.3.3
go: downloading github.com/jackc/pgx/v4 v4.17.2
go: downloading github.com/go-logfmt/logfmt v0.5.1
go: downloading github.com/dgraph-io/ristretto v0.1.0
go: downloading github.com/jackc/pgconn v1.13.0
go: downloading github.com/jackc/pgproto3/v2 v2.3.1
go: downloading github.com/jackc/pgtype v1.12.0
go: downloading github.com/golang/glog v1.0.0
go: downloading github.com/klauspost/compress v1.15.15
panic: internal error: can't find reason for requirement on github.com/google/pp                   rof@v0.0.0-20210407192527-94a9f03dee38

goroutine 1 [running]:
cmd/go/internal/modget.(*resolver).updateBuildList.func1({{0x276a210, 0x17}, {0x                   1822570, 0x22}})
        /usr/local/go/src/cmd/go/internal/modget/get.go:1760 +0x10c
cmd/go/internal/modget.(*resolver).updateBuildList(0x1bda280, {0x71f020, 0x181c0                   98}, {0x0, 0x0, 0x0})
        /usr/local/go/src/cmd/go/internal/modget/get.go:1765 +0x498
cmd/go/internal/modget.(*resolver).applyUpgrades(0x1bda280, {0x71f020, 0x181c098                   }, {0x0, 0x0, 0x0})
        /usr/local/go/src/cmd/go/internal/modget/get.go:1312 +0x2fc
cmd/go/internal/modget.runGet({0x71f020, 0x181c098}, 0xa090c8, {0x1818080, 0x2,                    0x2})
        /usr/local/go/src/cmd/go/internal/modget/get.go:351 +0x444
main.invoke(0xa090c8, {0x1818068, 0x5, 0x5})
        /usr/local/go/src/cmd/go/main.go:225 +0x400
main.main()
        /usr/local/go/src/cmd/go/main.go:179 +0x974
2023/02/09 10:30:54 [FATAL] exit status 2

Bah. I’m seeing the same error. I’m confused. It seems to be a bug in Go itself:

We’re looking into it :frowning:

1 Like

Thank you. I went back and tried go 1.20/1.19.5/1.18 and 1.17.1
Except for 17.1 it’s always the same error, on 17.1 it’s a different one though. Other plug-ins work just fine, that’s why I created an issue at the WOL Plug-in. Maybe the dev has an idea.

On a side note: I thought I could do a workaround by using the exec plugin “exec wakeonlan Macadress” in “handle_errors”. Would that, or something similar work?

Caddy v2.6.3 (and a few previous versions) will only build on Go 1.18 and later.

Caddy v2.6.2 could not build on Go 1.20 because of our dependency on quic-go which specifically has to add support for newer versions incrementally for complicated technical reasons.

This is definitely a bug with Go, but it might be resolved by the WOL plugin updating its version of Caddy in its go.mod. That should absolutely not be necessary though.

I have no idea. You’ll need to try it out. I’ve never played with wakeonlan stuff.

So I could try to build an older version of caddy with an older version of go. I fiddled around with exec but could not get that to work. Version 1.7.1 seems to work, how far back do I have to go with caddy?

Reading trough that Go issue does not leave me hopeful for a “quick fix”, that’s why I am trying different routes. Unfortunately WOL is kinda a “must have” for me (which is neither your problem nor of your concern :sweat_smile:). Other than this issue I am really impressed with how easy caddy is to setup, especially with let’s encrypt.

Well, I think I have a workaround for you:

xcaddy build --with github.com/dulli/caddy-wol=github.com/francislavoie/caddy-wol@c115db6e

Edit: aaaand it’s fixed in panic: internal error on xcaddy build · Issue #1 · dulli/caddy-wol · GitHub so my workaround above shouldn’t be necessary anymore.

1 Like

You and the author of the plug in were so quick, I could not (meaning did not have to) use your workaround (well technically I did because dully used it). Thank you very much for your patience and help.
It’s not much, but I will donate to the project/team.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.