distributions icon indicating copy to clipboard operation
distributions copied to clipboard

"distro not supported" when it is.

Open fredcooke opened this issue 3 years ago • 7 comments

You construct a URL and then try to get it with curl then for ANY failure reason you go and say the distro isn't supported.

For some clients there is an obnoxious MITM SSL sniffing VPN involved and local builds (best practice before pushing a change) always fail as the "trust me, it's fine" CA cert is not injected into the containers you're building.

Instead, I have a few suggestions to make this less irritating:

  1. Get the HTTP response code and fail with the "not supported error" ONLY for 404.
  2. For any other bad response code, dump it out with a "something went wrong, check our network"
  3. If you get an actual script failure because bad cert then dump that out for the user to deal with
  4. Provide an option external to the script to give curl the "ZFG" approach and turn off cert checking for bad behaving networks

Any/all of these, applied to every script in "rpm" and likely similar for other dirs, would be super welcome. Multiple times over the last few years I've had a "damn it, node has dropped support for X" sinking feeling and it's been far enough between that I don't remember the real reason until I've spent some time digging only to go "FFS" 50% at these node scripts and 50% at the MITM network architecture.

Please help those less fortunate than yourselves deal with bad security policies.

Thanks in advance :-)

fredcooke avatar Dec 08 '21 03:12 fredcooke

Just ran into this issue with one of our GitLab Pipelines. Changing the Dockerfile from

ubuntu:focal to ubuntu:latest

fixed it

//Nothing that Interesting to you, but maybe someone else has.

otherwiseGG avatar Dec 08 '21 22:12 otherwiseGG

@otherwiseDE you should never use :latest for any docker FROM line or other reference as your build is not deterministic and even if you have it in source control there isn't even a clue of intent when it all goes to custard because they released a new version with a package missing or replace apt or whatever. Sounds like you didn't have the same issue as that change would not have fixed my situation. My situation wasn't really broken, the install scripts are.

fredcooke avatar Dec 09 '21 02:12 fredcooke

Is the what you're seeing (the formatting is annoying, sorry) ?

Get:46 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [50.4 kB]
Fetched 11.6 MB in 11s (1,089 kB/s)
Reading package lists... Done

Confirming "focal" is supported...

  • curl -sLf -o /dev/null 'https://deb.nodesource.com/node_16.x/dists/focal/Release'

Your distribution, identified as "focal", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support

Clearly focal is supposed to be supported

iceback avatar Dec 15 '21 22:12 iceback

@iceback did you found any solution for this issue?

This is my curl command curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

Would it work with v18.04 of ubuntu for example?

iLaurian avatar Jan 01 '22 10:01 iLaurian

@iLaurian. To tell the truth I've largely forgotten the context. Other than it's my Ubu20 machine at home and I'm not there right now

iceback avatar Jan 01 '22 16:01 iceback

Nevermind I found out that the version was deprecated before the release of Ubuntu20.04

iLaurian avatar Jan 01 '22 16:01 iLaurian

I overcame the original problem identified in this issue (i.e. fails to detect distro because the rpm fails to download due to proxy config) by making sure the environment was set up for root with all the proxy vars and then using '-i' when invoking sudo which causes a full login to root (i.e. reading the environment variables form the profile). Hope this helps.

e.g. curl -fsSL https://rpm.nodesource.com/setup_14.x | sudo -i bash -

mattqm avatar Jan 13 '22 03:01 mattqm

thanks @mattqm for the proposed solution

JesusPaz avatar Jan 03 '23 19:01 JesusPaz