porter icon indicating copy to clipboard operation
porter copied to clipboard

Installing porter fails using https://cdn.porter.sh/latest/install-linux.sh

Open mikkelhegn opened this issue 3 years ago • 14 comments

Describe the bug

I'm using the install script from here: https://porter.sh/install/ --> Linux: curl https://cdn.porter.sh/latest/install-linux.sh | bash

Gettingthis error: Error: error downloading https://cdn.porter.sh/mixins/atom.xml Please include the following information in any bug reports: PORTER_TRACE: porter/v0.36.0 porter_trace_1616753337183160100 : Get https://cdn.porter.sh/mixins/atom.xml: dial tcp: lookup cdn.porter.sh on 172.23.192.1:53: cannot unmarshal DNS message

To Reproduce

Steps to reproduce the behavior:

  1. Run curl https://cdn.porter.sh/latest/install-linux.sh | bash
  2. See error

Expected behavior

Installation succeeds

mikkelhegn avatar Mar 26 '21 10:03 mikkelhegn

Me trying stuff...

I can install Porter if I leave out the mixin and plugin installations.

Trying to install a specific mixin version fails

> porter mixin install exec --url https://cdn.porter.sh/mixins/exec/v0.36.0/exec-linux-amd64
Error: error downloading https://cdn.porter.sh/mixins/exec/v0.36.0/exec-linux-amd64/latest/exec-linux-amd64
Please include the following information in any bug reports:
PORTER_TRACE: porter/v0.36.0 porter_trace_1616754006196973200 : Get https://cdn.porter.sh/mixins/exec/v0.36.0/exec-linux-amd64/latest/exec-linux-amd64: dial tcp: lookup cdn.porter.sh on 172.23.192.1:53: cannot unmarshal DNS message

mikkelhegn avatar Mar 26 '21 10:03 mikkelhegn

if you're having this problem in WSL, there is a workaround: https://gist.github.com/coltenkrauter/608cfe02319ce60facd76373249b8ca6. it's horrible, but it works.

WSL team is trying to fix this, but it is a reasonably hairy networking dance they have to do so it might take a bit.

squillace avatar Mar 26 '21 15:03 squillace

https://github.com/getporter/porter/issues/1507 here we go again ☺️

karolz-ms avatar Mar 26 '21 17:03 karolz-ms

it's a nightmare but the WSL error is really a pain. :sigh: you would not believe the conversation we are having with Azure storage support on that one.

squillace avatar Mar 26 '21 18:03 squillace

are you on WSL2, @karolz-ms ?

squillace avatar Mar 26 '21 18:03 squillace

https://github.com/getporter/porter/issues/1507 was not with WSL2, and the error was different, but it is in the same ballpark: essentially Porter installation script is trying to download some bits from the CDN and fails. In this case it seems like the DNS is in a bad state and CDN host name cannot be resolved. In https://github.com/getporter/porter/issues/1507 the CDN host name resolved fine but then the binary download failed.

karolz-ms avatar Mar 26 '21 18:03 karolz-ms

I was able to install Porter from my WSL2 environment just fine, but that was a couple of weeks ago

karolz-ms avatar Mar 26 '21 18:03 karolz-ms

right, thanks! we'll go start yelling all over again once more before we pay to move to another CDN solution. :-|

squillace avatar Mar 26 '21 18:03 squillace

Thanks for reporting that error. @squillace is this exact error due to WSL2? I have never seen it before and I'm not sure if I should escalate it as well to Azure support or if it's something else.

cannot unmarshal DNS message

carolynvs avatar Mar 29 '21 16:03 carolynvs

Definitely seems related to WSL2

I just installed in an Azure Cloud shell just fine with the CDN bash script. When I try in WSL2 (Ubuntu 20.04) I get the same error Get https://cdn.porter.sh/mixins/atom.xml: dial tcp: lookup cdn.porter.sh on 172.22.160.1:53

it's kinda weird, I'm going through my collection of installer scripts for a whole set of different tools, sdks etc, all of which run fine in WSL2, except Porter :(

I ran dig to see if there was anything wrong with DNS and it looks the same in WSL2 and cloudshell, in WSL2 it resolves just fine

$ dig +short cdn.porter.sh
portercdn.azureedge.net.
portercdn.afd.azureedge.net.
star-azureedge-prod.trafficmanager.net.
dual.t-0009.t-msedge.net.
t-0009.t-msedge.net.
Edge-Prod-LON21r3.ctrl.t-0009.t-msedge.net.
standard.t-0009.t-msedge.net.
13.107.246.19
13.107.213.19

And trying to wget or curl the file https://cdn.porter.sh/mixins/atom.xml also works in WSL2 just fine

benc-uk avatar Apr 05 '21 08:04 benc-uk

Seems related to Golang and certain DNS records/servers, see https://github.com/golang/go/issues/44135

It's trivial to reproduce in Go just by calling net.LookupHost("cdn.porter.sh"), but if you try it with a different hostname like "example.net" it's fine. Setting this env var GODEBUG=netdns=cgo fixes it and I no longer get any error for "cdn.porter.sh" but adding that to the install script seemed to have no effect

I wonder what is different about the Netlify DNS 🤔
I just tried with a quick site created on Netlify admiring-noyce-3afd82.netlify.app, and the resolves fine in DNS using net.LookupHost so yeah I'm outta ideas! ¯\_(ツ)_/¯

benc-uk avatar Apr 05 '21 09:04 benc-uk

@carolynvs yes, that's the error

squillace avatar Apr 05 '21 14:04 squillace

@benc-uk Thanks for the details! I will look into that further and see what can be changed in how dns is compiled in our binaries to fix it.

carolynvs avatar Apr 05 '21 14:04 carolynvs

Yeah @benc-uk double thanks on our part. This particular problem has been irritating us for months.

squillace avatar Apr 05 '21 15:04 squillace