I'm getting this SSL connection failure when running stack setup in a Docker image based on Ubuntu 16 (namely, the current phusion/baseimage)
FailedConnectionException2 "raw.githubusercontent.com" 443 True getProtocolByName: does not exist (no such protocol name: tcp)
What SSL tools/libraries does stack require with this configuration? I do have openssl installed at the latest version.
Thank you
I currently don't know enough about stack's docker integration. Maybe @borsboom can help?
@sjakobi @borsboom Tried with phusion/baseimage:0.9.18, which is based on Ubuntu 14, and the issue does not appear. According to the changelog, 0.9.18 uses OpenSSL patch CVE-2015-3193.
N.B.: I was pulling in Stack manually (curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C $HOME/.local/bin '*/stack') and not via APT repository.
Thank you again
Thanks for the update!
@sjakobi I'm not sure switching to a previous OS version solves it .. Ubuntu 16 seems to have the same issue also with the APT-based installer.
TL;DR. The image does not contain /etc/protocols from the netbase package, leading to this failure.
@ocramz apt-get update; apt-get install netbase should fix this particular error. Knowing nothing else, this seems a bug in the image.
The error message is correct and helpful (if not user-friendly): Haskell getProtocolByName fails, that is, C's getprotobyname(3) fails, that is, /etc/protocols is missing from the image. Just in case the info is given in some other way, I also tried to get the info using the proper command-line API , namely getent(1):
$ docker run --rm -t -i phusion/baseimage:0.9.19 /sbin/my_init -- bash -l
# getent protocols tcp; echo $?
2
# ls /etc/protocols
ls: cannot access '/etc/protocols': No such file or directory
Compare with correct results (on a normal LTS 14.04 system):
# getent protocols tcp; echo $?
tcp 6 TCP
0
# ls /etc/protocols
/etc/protocols
# dpkg -S /etc/protocols
netbase: /etc/protocols
phusion 0.9.18 also has netbase:
$ docker run --rm -t -i phusion/baseimage:0.9.18 /sbin/my_init -- bash -l
root@0e67dce35f7b:/# getent protocols tcp
tcp 6 TCP
root@0e67dce35f7b:/# ls /etc/protocols
/etc/protocols
The change seems unintentional, based on:
https://github.com/phusion/baseimage-docker/commit/e436d1c4af16a5e9590ae4e48e5105f1db787e7f
Thank you @Blaisorblade , I'll use your fix. Opened an issue with Phusion about this : https://github.com/phusion/baseimage-docker/issues/323
Most helpful comment
TL;DR. The image does not contain
/etc/protocolsfrom the netbase package, leading to this failure.@ocramz
apt-get update; apt-get install netbaseshould fix this particular error. Knowing nothing else, this seems a bug in the image.The error message is correct and helpful (if not user-friendly): Haskell
getProtocolByNamefails, that is, C'sgetprotobyname(3)fails, that is, /etc/protocols is missing from the image. Just in case the info is given in some other way, I also tried to get the info using the proper command-line API , namelygetent(1):Compare with correct results (on a normal LTS 14.04 system):
phusion 0.9.18 also has netbase:
The change seems unintentional, based on:
https://github.com/phusion/baseimage-docker/commit/e436d1c4af16a5e9590ae4e48e5105f1db787e7f