Panic with SSL/FCGI

Using:

https://caddyserver.com/download/build?os=linux&arch=arm&arm=6&features=

and:

domain.tld:2015 {
	root /home/pi/tt-rss
	tls  /home/pi/concat.pem /home/pi/ssl.key
	fastcgi / /var/run/php5-fpm.sock php
}

domain.tld:3000 {
	root /home/pi/podcast
	tls  off
	browse
	gzip
}

everything works with 0.9.3! With 0.9.4 only the :3000 works, requests to the :2015 give error 500 and:

[PANIC] runtime error: invalid memory address or nil pointer dereference

What does the log say? Run with -log stderr for example to see the full output. Also turn on the errors directive for an error log.

With -log filename I get the PANIC line above, with -log stderr I also get a line number:

[PANIC /] /usr/local/go/src/sync/atomic/asm_linux_arm.s:109 - runtime error: invalid memory address or nil pointer dereference

(why the difference?)

The errors directive doesn’t change anything.

Hmm, that’s a file in the Go standard library. Maybe we have a nil mutex somewhere?

The errors directive should write a more detailed error log. Is there nothing in the error log?

You say the error has to do with fastcgi. If you take that line out of your Caddyfile, does the error still occur?

the same for raspberry pi, downloaded via browser from url: https://caddyserver.com/download/build?os=linux&arch=arm&arm=6&features=

22/Dec/2016:19:51:21 +0100 [PANIC /] /usr/local/go/src/sync/atomic/asm_linux_arm.s:109 - runtime error: invalid memory address or nil pointer dereference
22/Dec/2016:19:51:21 +0100 [PANIC /] /usr/local/go/src/sync/atomic/asm_linux_arm.s:109 - runtime error: invalid memory address or nil pointer dereference

and the same situation on the hosted debian i686
downloaded via wget https://github.com/mholt/caddy/releases/download/v0.9.4/caddy_linux_386.tar.gz

22/Dec/2016:18:32:08 +0100 [PANIC /] /usr/local/go/src/sync/atomic/asm_386.s:112 - runtime error: invalid memory address or nil pointer dereference
22/Dec/2016:18:32:14 +0100 [PANIC /dist/purify.min.js.map] /usr/local/go/src/sync/atomic/asm_386.s:112 - runtime error: invalid memory address or nil pointer dereference
22/Dec/2016:18:32:20 +0100 [PANIC /] /usr/local/go/src/sync/atomic/asm_386.s:112 - runtime error: invalid memory address or nil pointer dereference
22/Dec/2016:18:32:20 +0100 [PANIC /dist/purify.min.js.map] /usr/local/go/src/sync/atomic/asm_386.s:112 - runtime error: invalid memory address or nil pointer dereference

That’s 64-bit linux, no? You downloaded the 32-bit version.

Are you sure you got the ARM version right for your Pi?

What kind of machine are you running this on?

There really is nothing in the error log.

Without FastCGI the panic doesn’t occur, just a 404.

ARMv6 is the correct binary for a Raspberry Pi 1. I used the exact same URL in September to get a build that doesn’t panic.

no, i686 is 32bit, I’m sure, caddy 0.9.4 running ok but all request to fastcgi get error 500

yes, I’m sure raspberrypi1 is arm6, caddy 0.9.4 running ok but the same problem with fastcgi

and caddy 0.9.4 arm7 build running on raspberrypi2 is ok, it’s reverse proxy, but request which is not send to backend but send to fastcgi get the same error 500

1 Like

Can you file a bug at https://github.com/mholt/caddy/issues and include the information you gave here (and link to this thread)? If both of you could contribute, that would be good. Seems like the same or at least a similar issue for you both.

https://github.com/mholt/caddy/issues/1306

Thanks. I have a strong suspicion as to the fix, will take the discussion to that issue now!

Edit: Fixed! Thank you.

2 Likes

Hi Matt,
you should push a new version quickly as this one is unusable in production with PHP…don’t you think?

Yes. I would if doing deploys didn’t take me half a day. :sweat:

I’m having the same issue. How can I download Caddy 0.9.3 with plugins?
EDIT: Doesn’t matter, using caddy 0.9.3 from a backup. But please push the fix soon…

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