Can not reload or restart caddy

1. Output of caddy version:

v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=

2. How I run Caddy:

a. System environment:

postmarketOS edge aarch64 (Alpine Linux)

b. Command:

rc-service caddy reload

c. Service/unit/compose file:

#!/sbin/openrc-run
supervisor=supervise-daemon

name="Caddy web server"
description="Fast, multi-platform web server with automatic HTTPS"
description_checkconfig="Check configuration"
description_reload="Reload configuration without downtime"

: ${caddy_opts:="--config /etc/caddy/Caddyfile --adapter caddyfile"}

command=/usr/sbin/caddy
command_args="run $caddy_opts"
command_user=luan:luan
extra_commands="checkconfig"
extra_started_commands="reload"

depend() {
	need net localmount
	after firewall
}

checkconfig() {
	ebegin "Checking configuration for $name"
	su ${command_user%:*} -s /bin/sh -c "$command validate $caddy_opts"
	eend $?
}

reload() {
	ebegin "Reloading $name"
	su ${command_user%:*} -s /bin/sh -c "$command reload $caddy_opts"
	eend $?
}

stop_pre() {
	if [ "$RC_CMD" = restart ]; then
		checkconfig || return $?
	fi
}

d. My complete Caddy config:

None

3. The problem I’m having:

I can’t reload or restart the caddy

4. Error messages and/or full log output:

 * Reloading Caddy web server ...
SIGILL: illegal instruction
PC=0x545390 m=0 sigcode=1
instruction bytes: 0x0 0x6 0x38 0xd5 0xe0 0x7 0x0 0xf9 0xc0 0x3 0x5f 0xd6 0x0 0x0 0x0 0x0

goroutine 1 [running, locked to thread]:
golang.org/x/sys/cpu.getisar0()
	golang.org/x/sys@v0.0.0-20220728004956-3c1f35247d10/cpu/cpu_arm64.s:14 fp=0x4000157290 sp=0x4000157290 pc=0x545390
golang.org/x/sys/cpu.readARM64Registers()
	golang.org/x/sys@v0.0.0-20220728004956-3c1f35247d10/cpu/cpu_arm64.go:65 +0x2c fp=0x40001572d0 sp=0x4000157290 pc=0x544c1c
golang.org/x/sys/cpu.doinit()
	golang.org/x/sys@v0.0.0-20220728004956-3c1f35247d10/cpu/cpu_linux_arm64.go:38 +0x24 fp=0x40001572e0 sp=0x40001572d0 pc=0x544f04
golang.org/x/sys/cpu.archInit(...)
	golang.org/x/sys@v0.0.0-20220728004956-3c1f35247d10/cpu/cpu_arm64.go:45
golang.org/x/sys/cpu.init.0()
	golang.org/x/sys@v0.0.0-20220728004956-3c1f35247d10/cpu/cpu.go:199 +0x20 fp=0x40001572f0 sp=0x40001572e0 pc=0x5442a0
runtime.doInit(0x24caf40)
	runtime/proc.go:6329 +0x128 fp=0x4000157430 sp=0x40001572f0 pc=0x59d28
runtime.doInit(0x24de2e0)
	runtime/proc.go:6306 +0x68 fp=0x4000157570 sp=0x4000157430 pc=0x59c68
runtime.doInit(0x24cac80)
	runtime/proc.go:6306 +0x68 fp=0x40001576b0 sp=0x4000157570 pc=0x59c68
runtime.doInit(0x24c9480)
	runtime/proc.go:6306 +0x68 fp=0x40001577f0 sp=0x40001576b0 pc=0x59c68
runtime.doInit(0x24d73c0)
	runtime/proc.go:6306 +0x68 fp=0x4000157930 sp=0x40001577f0 pc=0x59c68
runtime.doInit(0x24ce060)
	runtime/proc.go:6306 +0x68 fp=0x4000157a70 sp=0x4000157930 pc=0x59c68
runtime.doInit(0x24dce00)
	runtime/proc.go:6306 +0x68 fp=0x4000157bb0 sp=0x4000157a70 pc=0x59c68
runtime.doInit(0x24e00a0)
	runtime/proc.go:6306 +0x68 fp=0x4000157cf0 sp=0x4000157bb0 pc=0x59c68
runtime.doInit(0x24dcf40)
	runtime/proc.go:6306 +0x68 fp=0x4000157e30 sp=0x4000157cf0 pc=0x59c68
runtime.doInit(0x24c6f40)
	runtime/proc.go:6306 +0x68 fp=0x4000157f70 sp=0x4000157e30 pc=0x59c68
runtime.main()
	runtime/proc.go:233 +0x1f8 fp=0x4000157fd0 sp=0x4000157f70 pc=0x4bc88
runtime.goexit()
	runtime/asm_arm64.s:1172 +0x4 fp=0x4000157fd0 sp=0x4000157fd0 pc=0x7da84

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	runtime/proc.go:363 +0xe4 fp=0x4000068fa0 sp=0x4000068f80 pc=0x4c0b4
runtime.goparkunlock(...)
	runtime/proc.go:369
runtime.forcegchelper()
	runtime/proc.go:302 +0xb4 fp=0x4000068fd0 sp=0x4000068fa0 pc=0x4bf44
runtime.goexit()
	runtime/asm_arm64.s:1172 +0x4 fp=0x4000068fd0 sp=0x4000068fd0 pc=0x7da84
created by runtime.init.6
	runtime/proc.go:290 +0x24

goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	runtime/proc.go:363 +0xe4 fp=0x4000069770 sp=0x4000069750 pc=0x4c0b4
runtime.goparkunlock(...)
	runtime/proc.go:369
runtime.bgsweep(0x0?)
	runtime/mgcsweep.go:278 +0xa4 fp=0x40000697b0 sp=0x4000069770 pc=0x36824
runtime.gcenable.func1()
	runtime/mgc.go:178 +0x28 fp=0x40000697d0 sp=0x40000697b0 pc=0x2ac78
runtime.goexit()
	runtime/asm_arm64.s:1172 +0x4 fp=0x40000697d0 sp=0x40000697d0 pc=0x7da84
created by runtime.gcenable
	runtime/mgc.go:178 +0x70

goroutine 4 [GC scavenge wait]:
runtime.gopark(0x4000090000?, 0x18e2588?, 0x1?, 0x0?, 0x0?)
	runtime/proc.go:363 +0xe4 fp=0x4000069f50 sp=0x4000069f30 pc=0x4c0b4
runtime.goparkunlock(...)
	runtime/proc.go:369
runtime.(*scavengerState).park(0x2581260)
	runtime/mgcscavenge.go:389 +0x5c fp=0x4000069f80 sp=0x4000069f50 pc=0x3481c
runtime.bgscavenge(0x0?)
	runtime/mgcscavenge.go:617 +0x44 fp=0x4000069fb0 sp=0x4000069f80 pc=0x34d84
runtime.gcenable.func2()
	runtime/mgc.go:179 +0x28 fp=0x4000069fd0 sp=0x4000069fb0 pc=0x2ac18
runtime.goexit()
	runtime/asm_arm64.s:1172 +0x4 fp=0x4000069fd0 sp=0x4000069fd0 pc=0x7da84
created by runtime.gcenable
	runtime/mgc.go:179 +0xb4

goroutine 17 [finalizer wait]:
runtime.gopark(0x40000685a8?, 0x600000000266a8?, 0x38?, 0xef?, 0x1?)
	runtime/proc.go:363 +0xe4 fp=0x4000068580 sp=0x4000068560 pc=0x4c0b4
runtime.goparkunlock(...)
	runtime/proc.go:369
runtime.runfinq()
	runtime/mfinal.go:180 +0x128 fp=0x40000687d0 sp=0x4000068580 pc=0x29e98
runtime.goexit()
	runtime/asm_arm64.s:1172 +0x4 fp=0x40000687d0 sp=0x40000687d0 pc=0x7da84
created by runtime.createfing
	runtime/mfinal.go:157 +0x94

r0      0x1
r1      0x400009e090
r2      0x0
r3      0x18ebac0
r4      0x400009e090
r5      0x0
r6      0x1
r7      0x0
r8      0x0
r9      0x30
r10     0x400009e090
r11     0x30
r12     0x0
r13     0x18e1d53
r14     0x400009e0bf
r15     0x1000
r16     0x40001543a0
r17     0xa
r18     0x0
r19     0xd0
r20     0x40001571b0
r21     0x40001579d8
r22     0x4000004000
r23     0x0
r24     0xffffffffffffffff
r25     0x16700a0
r26     0x24caf78
r27     0x25b2986
r28     0x40000021a0
r29     0x4000157288
lr      0x544c1c
sp      0x4000157290
pc      0x545390
fault   0x0

5. What I already tried:

Rebuild caddy with xcaddy

6. Links to relevant resources:

I get the same error when I try to restart caddy

I realized that I could just type ‘caddy reload/restart’ to reload/restart it

“SIGILL” sounds like the wrong binary is being run on that platform. What is the output of caddy build-info?

caddy build-info output the same error as above

Are you sure you built Caddy for the correct architecture? How did you build it? Did you build it on the same machine that’s running it?

I build it by run the command xcaddy build on the same machine

Okay, that should be fine.

You marked my comment as a solution. Are you no longer getting the SIGILL error?

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