Lego: Panic on generating a certificate

Created on 6 Aug 2018  路  5Comments  路  Source: go-acme/lego

Lego:

lego -v
lego version dev

Error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0x78ca28]

goroutine 1 [running]:
github.com/xenolf/lego/acme.(*Client).ObtainCertificateForCSR(0xc4203b2000, 0xc42052e000, 0x376, 0x378, 0xc42052e004, 0x2fb, 0x374, 0xc42052e0f7, 0x78, 0x281, ...)
    ~/.go/src/github.com/xenolf/lego/acme/client.go:378 +0x828
main.run(0xc4200cab00, 0x0, 0xc4200cab00)
    ~/.go/src/github.com/xenolf/lego/cli_handlers.go:336 +0x3ff
github.com/xenolf/lego/vendor/github.com/urfave/cli.HandleAction(0xc60040, 0xe1a060, 0xc4200cab00, 0xc4200acb00, 0x0)
    ~/.go/src/github.com/xenolf/lego/vendor/github.com/urfave/cli/app.go:490 +0xc8
github.com/xenolf/lego/vendor/github.com/urfave/cli.Command.Run(0xdea2bc, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0ec18, 0x3a, 0x0, ...)
    ~/.go/src/github.com/xenolf/lego/vendor/github.com/urfave/cli/command.go:210 +0xa36
github.com/xenolf/lego/vendor/github.com/urfave/cli.(*App).Run(0xc42020f1e0, 0xc4200da000, 0x9, 0x9, 0x0, 0x0)
    ~/.go/src/github.com/xenolf/lego/vendor/github.com/urfave/cli/app.go:255 +0x6a0
main.main()
    ~/.go/src/github.com/xenolf/lego/cli.go:180 +0x144f

Command:

lego --email="[email protected]" \
       --accept-tos \
       --csr="<path to csr>" \
       --path="<folder>" \
       --server="https://acme-v02.api.letsencrypt.org/directory" \
       --dns="gcloud" \
       --dns-timeout=5 \
       run;

this only happens with the production API, same command works with https://acme-staging-v02.api.letsencrypt.org/directory for some reason.

arelib bug

Most helpful comment

I found the issue by trial and error. It was hitting the duplicate certificate limit of 5 certificates per week, but I suppose lego shouldn't segfault in that case and instead throw the error.

All 5 comments

with GOTRACEBACK=system. Golang version is go version go1.10.3 linux/amd64

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0x78cc38]

goroutine 1 [running]:
panic(0xcb6760, 0x13ff040)
    /usr/local/go/src/runtime/panic.go:551 +0x3c1 fp=0xc4204a0a78 sp=0xc4204a09d8 pc=0x42b071
runtime.panicmem()
    /usr/local/go/src/runtime/panic.go:63 +0x5e fp=0xc4204a0a98 sp=0xc4204a0a78 pc=0x429f4e
runtime.sigpanic()
    /usr/local/go/src/runtime/signal_unix.go:388 +0x17a fp=0xc4204a0ae8 sp=0xc4204a0a98 pc=0x43fe9a
github.com/xenolf/lego/acme.(*Client).ObtainCertificateForCSR(0xc4204460c0, 0xc42023d500, 0x376, 0x378, 0xc42023d504, 0x2fb, 0x374, 0xc42023d5f7, 0x78, 0x281, ...)
    ~/go/src/github.com/xenolf/lego/acme/client.go:378 +0x828 fp=0xc4204a0f30 sp=0xc4204a0ae8 pc=0x78cc38
main.run(0xc4200f0b00, 0x0, 0xc4200f0b00)
    ~/go/src/github.com/xenolf/lego/cli_handlers.go:352 +0x4c2 fp=0xc4204a12d0 sp=0xc4204a0f30 pc=0xba3082
github.com/xenolf/lego/vendor/github.com/urfave/cli.HandleAction(0xc61040, 0xe1b098, 0xc4200f0b00, 0xc420094b00, 0x0)
    ~/go/src/github.com/xenolf/lego/vendor/github.com/urfave/cli/app.go:490 +0xc8 fp=0xc4204a12f8 sp=0xc4204a12d0 pc=0x7c7df8
github.com/xenolf/lego/vendor/github.com/urfave/cli.Command.Run(0xdeb2bc, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0fc55, 0x3a, 0x0, ...)
    ~/go/src/github.com/xenolf/lego/vendor/github.com/urfave/cli/command.go:210 +0xa36 fp=0xc4204a1568 sp=0xc4204a12f8 pc=0x7c9066
github.com/xenolf/lego/vendor/github.com/urfave/cli.(*App).Run(0xc4201dd1e0, 0xc420030140, 0xa, 0xa, 0x0, 0x0)
    ~/go/src/github.com/xenolf/lego/vendor/github.com/urfave/cli/app.go:255 +0x6a0 fp=0xc4204a1740 sp=0xc4204a1568 pc=0x7c6180
main.main()
    ~/go/src/github.com/xenolf/lego/cli.go:184 +0x14f3 fp=0xc4204a1f88 sp=0xc4204a1740 pc=0xb9f3f3
runtime.main()
    /usr/local/go/src/runtime/proc.go:198 +0x212 fp=0xc4204a1fe0 sp=0xc4204a1f88 pc=0x42cd82
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4204a1fe8 sp=0xc4204a1fe0 pc=0x4572a1

goroutine 2 [force gc (idle)]:
runtime.gopark(0xe1b850, 0x140e7d0, 0xdf2233, 0xf, 0xe1b714, 0x1)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420062768 sp=0xc420062748 pc=0x42d1da
runtime.goparkunlock(0x140e7d0, 0xdf2233, 0xf, 0x14, 0x1)
    /usr/local/go/src/runtime/proc.go:297 +0x5e fp=0xc4200627a8 sp=0xc420062768 pc=0x42d28e
runtime.forcegchelper()
    /usr/local/go/src/runtime/proc.go:248 +0xcc fp=0xc4200627e0 sp=0xc4200627a8 pc=0x42d01c
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200627e8 sp=0xc4200627e0 pc=0x4572a1
created by runtime.init.4
    /usr/local/go/src/runtime/proc.go:237 +0x35

goroutine 3 [GC sweep wait]:
runtime.gopark(0xe1b850, 0x140e940, 0xdf04f8, 0xd, 0x452714, 0x1)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420062f60 sp=0xc420062f40 pc=0x42d1da
runtime.goparkunlock(0x140e940, 0xdf04f8, 0xd, 0x14, 0x1)
    /usr/local/go/src/runtime/proc.go:297 +0x5e fp=0xc420062fa0 sp=0xc420062f60 pc=0x42d28e
runtime.bgsweep(0xc420092000)
    /usr/local/go/src/runtime/mgcsweep.go:71 +0x12c fp=0xc420062fd8 sp=0xc420062fa0 pc=0x42027c
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420062fe0 sp=0xc420062fd8 pc=0x4572a1
created by runtime.gcenable
    /usr/local/go/src/runtime/mgc.go:216 +0x58

goroutine 4 [finalizer wait]:
runtime.gopark(0xe1b850, 0x142cc08, 0xdf14f7, 0xe, 0x14, 0x1)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420063718 sp=0xc4200636f8 pc=0x42d1da
runtime.goparkunlock(0x142cc08, 0xdf14f7, 0xe, 0x14, 0x1)
    /usr/local/go/src/runtime/proc.go:297 +0x5e fp=0xc420063758 sp=0xc420063718 pc=0x42d28e
runtime.runfinq()
    /usr/local/go/src/runtime/mfinal.go:175 +0xad fp=0xc4200637e0 sp=0xc420063758 pc=0x41729d
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200637e8 sp=0xc4200637e0 pc=0x4572a1
created by runtime.createfing
    /usr/local/go/src/runtime/mfinal.go:156 +0x62

goroutine 5 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc42046e000, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420063f48 sp=0xc420063f28 pc=0x42d1da
runtime.gcBgMarkWorker(0xc420042000)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc420063fd8 sp=0xc420063f48 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420063fe0 sp=0xc420063fd8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 18 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc420472000, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc42005e748 sp=0xc42005e728 pc=0x42d1da
runtime.gcBgMarkWorker(0xc420044500)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc42005e7d8 sp=0xc42005e748 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42005e7e0 sp=0xc42005e7d8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 34 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc420472010, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420478748 sp=0xc420478728 pc=0x42d1da
runtime.gcBgMarkWorker(0xc420046a00)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc4204787d8 sp=0xc420478748 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4204787e0 sp=0xc4204787d8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 19 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc42046e010, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc42005ef48 sp=0xc42005ef28 pc=0x42d1da
runtime.gcBgMarkWorker(0xc420048f00)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc42005efd8 sp=0xc42005ef48 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42005efe0 sp=0xc42005efd8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 35 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc42046e020, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420478f48 sp=0xc420478f28 pc=0x42d1da
runtime.gcBgMarkWorker(0xc42004b400)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc420478fd8 sp=0xc420478f48 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420478fe0 sp=0xc420478fd8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 36 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc42046e030, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420479748 sp=0xc420479728 pc=0x42d1da
runtime.gcBgMarkWorker(0xc42004d900)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc4204797d8 sp=0xc420479748 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4204797e0 sp=0xc4204797d8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 37 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc4200370d0, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420479f48 sp=0xc420479f28 pc=0x42d1da
runtime.gcBgMarkWorker(0xc420050000)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc420479fd8 sp=0xc420479f48 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420479fe0 sp=0xc420479fd8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 6 [GC worker (idle)]:
runtime.gopark(0xe1b6f8, 0xc4200370e0, 0xdf2945, 0x10, 0x14, 0x0)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420064748 sp=0xc420064728 pc=0x42d1da
runtime.gcBgMarkWorker(0xc420052500)
    /usr/local/go/src/runtime/mgc.go:1775 +0x130 fp=0xc4200647d8 sp=0xc420064748 pc=0x41ae90
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200647e0 sp=0xc4200647d8 pc=0x4572a1
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1723 +0x79

goroutine 68 [syscall]:
runtime.notetsleepg(0x1413640, 0x37e11936e, 0x6c0001)
    /usr/local/go/src/runtime/lock_futex.go:227 +0x42 fp=0xc42005f760 sp=0xc42005f730 pc=0x410f02
runtime.timerproc(0x1413620)
    /usr/local/go/src/runtime/time.go:261 +0x2e7 fp=0xc42005f7d8 sp=0xc42005f760 pc=0x4489b7
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42005f7e0 sp=0xc42005f7d8 pc=0x4572a1
created by runtime.(*timersBucket).addtimerLocked
    /usr/local/go/src/runtime/time.go:160 +0x107

goroutine 51 [syscall]:
runtime.notetsleepg(0x1413540, 0x37ac3e0e7, 0x0)
    /usr/local/go/src/runtime/lock_futex.go:227 +0x42 fp=0xc42005ff60 sp=0xc42005ff30 pc=0x410f02
runtime.timerproc(0x1413520)
    /usr/local/go/src/runtime/time.go:261 +0x2e7 fp=0xc42005ffd8 sp=0xc42005ff60 pc=0x4489b7
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42005ffe0 sp=0xc42005ffd8 pc=0x4572a1
created by runtime.(*timersBucket).addtimerLocked
    /usr/local/go/src/runtime/time.go:160 +0x107

goroutine 38 [syscall]:
runtime.notetsleepg(0x14134c0, 0x37771d9dc, 0x0)
    /usr/local/go/src/runtime/lock_futex.go:227 +0x42 fp=0xc420476f60 sp=0xc420476f30 pc=0x410f02
runtime.timerproc(0x14134a0)
    /usr/local/go/src/runtime/time.go:261 +0x2e7 fp=0xc420476fd8 sp=0xc420476f60 pc=0x4489b7
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420476fe0 sp=0xc420476fd8 pc=0x4572a1
created by runtime.(*timersBucket).addtimerLocked
    /usr/local/go/src/runtime/time.go:160 +0x107

goroutine 20 [syscall]:
runtime.notetsleepg(0x1413440, 0x37ac387ea, 0x0)
    /usr/local/go/src/runtime/lock_futex.go:227 +0x42 fp=0xc420060760 sp=0xc420060730 pc=0x410f02
runtime.timerproc(0x1413420)
    /usr/local/go/src/runtime/time.go:261 +0x2e7 fp=0xc4200607d8 sp=0xc420060760 pc=0x4489b7
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200607e0 sp=0xc4200607d8 pc=0x4572a1
created by runtime.(*timersBucket).addtimerLocked
    /usr/local/go/src/runtime/time.go:160 +0x107

goroutine 7 [syscall]:
runtime.notetsleepg(0x14133c0, 0x37ac2fea4, 0x0)
    /usr/local/go/src/runtime/lock_futex.go:227 +0x42 fp=0xc42047bf60 sp=0xc42047bf30 pc=0x410f02
runtime.timerproc(0x14133a0)
    /usr/local/go/src/runtime/time.go:261 +0x2e7 fp=0xc42047bfd8 sp=0xc42047bf60 pc=0x4489b7
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42047bfe0 sp=0xc42047bfd8 pc=0x4572a1
created by runtime.(*timersBucket).addtimerLocked
    /usr/local/go/src/runtime/time.go:160 +0x107

goroutine 88 [select]:
runtime.gopark(0xe1b890, 0x0, 0xdec628, 0x6, 0x18, 0x1)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc420477c90 sp=0xc420477c70 pc=0x42d1da
runtime.selectgo(0xc420477f48, 0xc42003eba0)
    /usr/local/go/src/runtime/select.go:392 +0xe50 fp=0xc420477e68 sp=0xc420477c90 pc=0x43c320
net/http.(*persistConn).writeLoop(0xc4202145a0)
    /usr/local/go/src/net/http/transport.go:1822 +0x14b fp=0xc420477fd8 sp=0xc420477e68 pc=0x6c00cb
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420477fe0 sp=0xc420477fd8 pc=0x4572a1
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:1238 +0x97f

goroutine 87 [IO wait]:
runtime.gopark(0xe1b820, 0x7fd37e3a6be8, 0xdec9cc, 0x7, 0x4a9c1b, 0x5)
    /usr/local/go/src/runtime/proc.go:291 +0x11a fp=0xc42053b698 sp=0xc42053b678 pc=0x42d1da
runtime.netpollblock(0x7fd37e3a6bc0, 0xffffff0000000072, 0x0)
    /usr/local/go/src/runtime/netpoll.go:366 +0xaa fp=0xc42053b6e0 sp=0xc42053b698 pc=0x4284fa
internal/poll.runtime_pollWait(0x7fd37e3a6bc0, 0x72, 0xc42053b760)
    /usr/local/go/src/runtime/netpoll.go:173 +0x57 fp=0xc42053b708 sp=0xc42053b6e0 pc=0x427b77
internal/poll.(*pollDesc).wait(0xc420161118, 0x72, 0xffffffffffffff00, 0xeb8000, 0x13c9728)
    /usr/local/go/src/internal/poll/fd_poll_runtime.go:85 +0x9b fp=0xc42053b738 sp=0xc42053b708 pc=0x4bf08b
internal/poll.(*pollDesc).waitRead(0xc420161118, 0xc42055a000, 0x1000, 0x1000)
    /usr/local/go/src/internal/poll/fd_poll_runtime.go:90 +0x3d fp=0xc42053b770 sp=0xc42053b738 pc=0x4bf10d
internal/poll.(*FD).Read(0xc420161100, 0xc42055a000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/internal/poll/fd_unix.go:157 +0x17d fp=0xc42053b7c0 sp=0xc42053b770 pc=0x4bff6d
net.(*netFD).Read(0xc420161100, 0xc42055a000, 0x1000, 0x1000, 0x853d08464de47d3d, 0xa6e6e014f647e386, 0x8bce6bd7b5b517e2)
    /usr/local/go/src/net/fd_unix.go:202 +0x4f fp=0xc42053b820 sp=0xc42053b7c0 pc=0x58055f
net.(*conn).Read(0xc42000e3b8, 0xc42055a000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:176 +0x6a fp=0xc42053b880 sp=0xc42053b820 pc=0x591b3a
crypto/tls.(*block).readFromUntil(0xc42066c1e0, 0x7fd37e312000, 0xc42000e3b8, 0x5, 0xc42000e3b8, 0x773eaa11b5e2b785)
    /usr/local/go/src/crypto/tls/conn.go:493 +0x96 fp=0xc42053b8c8 sp=0xc42053b880 pc=0x619016
crypto/tls.(*Conn).readRecord(0xc420167500, 0xe1b917, 0xc420167620, 0xb0e36942c88af517)
    /usr/local/go/src/crypto/tls/conn.go:595 +0xe0 fp=0xc42053ba70 sp=0xc42053b8c8 pc=0x619520
crypto/tls.(*Conn).Read(0xc420167500, 0xc420559000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/crypto/tls/conn.go:1156 +0x100 fp=0xc42053bac8 sp=0xc42053ba70 pc=0x61cac0
net/http.(*persistConn).Read(0xc4202145a0, 0xc420559000, 0x1000, 0x1000, 0x4050e6, 0xc42053bb98, 0x42a029)
    /usr/local/go/src/net/http/transport.go:1453 +0x136 fp=0xc42053bb40 sp=0xc42053bac8 pc=0x6be046
bufio.(*Reader).fill(0xc4201cec00)
    /usr/local/go/src/bufio/bufio.go:100 +0x11e fp=0xc42053bb90 sp=0xc42053bb40 pc=0x5375de
bufio.(*Reader).Peek(0xc4201cec00, 0x1, 0xc420013a40, 0xc420475480, 0x0, 0x19, 0x0)
    /usr/local/go/src/bufio/bufio.go:132 +0x3a fp=0xc42053bba8 sp=0xc42053bb90 pc=0x53772a
net/http.(*persistConn).readLoop(0xc4202145a0)
    /usr/local/go/src/net/http/transport.go:1601 +0x185 fp=0xc42053bfd8 sp=0xc42053bba8 pc=0x6beb05
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42053bfe0 sp=0xc42053bfd8 pc=0x4572a1
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:1237 +0x95a

goroutine 114 [syscall]:
runtime.notetsleepg(0x1413740, 0x37e11ac70, 0x0)
    /usr/local/go/src/runtime/lock_futex.go:227 +0x42 fp=0xc420474760 sp=0xc420474730 pc=0x410f02
runtime.timerproc(0x1413720)
    /usr/local/go/src/runtime/time.go:261 +0x2e7 fp=0xc4204747d8 sp=0xc420474760 pc=0x4489b7
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4204747e0 sp=0xc4204747d8 pc=0x4572a1
created by runtime.(*timersBucket).addtimerLocked
    /usr/local/go/src/runtime/time.go:160 +0x107

Is there any way I can debug this more to get a little more info? I think it may be related to rate limiting since it is working in the Let's Encrypt staging environment with the same CSR.

I found the issue by trial and error. It was hitting the duplicate certificate limit of 5 certificates per week, but I suppose lego shouldn't segfault in that case and instead throw the error.

It seems it's related to a failed error handling:

https://github.com/xenolf/lego/blob/master/acme/client.go#L370-L378

If the certificate is not fetched correctly, cert has nil as a value. Obviously line 378, cert.CSR is going to panic.

The method requestCertificateForCsr has different ways to fail returning nil as certificate, as many ways to panic line 378

With the change in #627 I'm getting a clear error:

2018/09/07 09:56:28 [INFO] [foobar.tld] acme: Obtaining bundled SAN certificate given a CSR
2018/09/07 09:56:29 [INFO] [foobar.tld] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/12312312312313132123
2018/09/07 09:56:29 [INFO] [foobar.tld] acme: Authorization already valid; skipping challenge
2018/09/07 09:56:29 [INFO] [foobar.tld] acme: Validations succeeded; requesting certificates
2018/09/07 09:56:29 Could not obtain certificates
    acme: Error 429 - urn:ietf:params:acme:error:rateLimited - Error finalizing order :: too many certificates already issued for exact set of domains: foobar.tld: see https://letsencrypt.org/docs/rate-limits/
Was this page helpful?
0 / 5 - 0 ratings

Related issues

voltagex picture voltagex  路  3Comments

mhoran picture mhoran  路  4Comments

rawtaz picture rawtaz  路  3Comments

benjamincudi picture benjamincudi  路  3Comments

mholt picture mholt  路  3Comments