Mirantis / launchpad

Other
28 stars 45 forks source link

launchpad V1.3.0 seg faults when https_proxy is not set to check for downloads #82

Open pjmcquade opened 3 years ago

pjmcquade commented 3 years ago

Hi Folks,

Host is RHEL 7.9

# ./launchpad-linux-x64 version
version: 1.3.0
commit: 706d2b4
# uname -a
Linux localhost 3.10.0-1160.25.1.el7.x86_64 #1 SMP Tue Apr 13 18:55:45 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

steps to replicate:

# export https_proxy=proxy:8080
# ./launchpad-linux-x64 download-launchpad
FATA[0000] No upgrade available

unset the proxy:

# ./launchpad-linux-x64 apply --debug --disable-upgrade-check --accept-license --disable-telemetry --config launchpad.yml
DEBU analytics disabled, not tracking event 'Cluster Apply Started'
DEBU opened config file from /root/docker_install/launchpad.yml
DEBU migrated configuration from launchpad.mirantis.com/v1.2 to launchpad.mirantis.com/mke/v1.3
INFO Note: The configuration has been migrated from a previous version
INFO       to see the migrated configuration use: launchpad describe config
DEBU loaded configuration:
apiVersion: launchpad.mirantis.com/mke/v1.4
kind: mke+msr
metadata:
:
:  REDACTED COMPANY INFO, but emits the YAML configuration file
: 
DEBU preparing phase 'Check For Upgrades'
INFO ==> Running phase: Check For Upgrades
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x754e55]

goroutine 1 [running]:
github.com/Mirantis/mcc/pkg/docker/hub.LatestTag(0xa55d20, 0x8, 0xa510b8, 0x3, 0xffffffffffffff00, 0x0, 0x0, 0x0, 0x0)
        github.com/Mirantis/mcc/pkg/docker/hub/hub.go:37 +0x2d5
github.com/Mirantis/mcc/pkg/product/mke/phase.(*UpgradeCheck).Run(0xc0004ec320, 0xb8529d, 0xeddce0)
        github.com/Mirantis/mcc/pkg/product/mke/phase/upgrade_check.go:25 +0xa6
github.com/Mirantis/mcc/pkg/phase.(*Manager).Run(0xc0000e7970, 0x0, 0x0)
        github.com/Mirantis/mcc/pkg/phase/manager.go:91 +0x293
github.com/Mirantis/mcc/pkg/product/mke.(*MKE).Apply(0xc0004e4540, 0xa50000, 0x5, 0x0)
        github.com/Mirantis/mcc/pkg/product/mke/apply.go:58 +0x929
github.com/Mirantis/mcc/cmd.NewApplyCommand.func1(0xc0002e1c00, 0x0, 0x0)
        github.com/Mirantis/mcc/cmd/apply.go:72 +0x28f
github.com/urfave/cli/v2.(*Command).Run(0xc000021320, 0xc0002e1740, 0x0, 0x0)
        github.com/urfave/cli/v2@v2.2.0/command.go:164 +0x4dd
github.com/urfave/cli/v2.(*App).RunContext(0xc0002f0480, 0xb1b1d0, 0xc0000260a0, 0xc00001e080, 0x8, 0x8, 0x0, 0x0)
        github.com/urfave/cli/v2@v2.2.0/app.go:306 +0x810
github.com/urfave/cli/v2.(*App).Run(...)
        github.com/urfave/cli/v2@v2.2.0/app.go:215
main.main()
        command-line-arguments/main.go:95 +0x476
# 

However, if I set the http_proxy variable the command works. Why is the launchpad binary checking for upgrades despite the --disable-upgrade-checks flag being set?

Thanks!

kke commented 3 years ago

The --disable-upgrade-check only disables the launchpad's own self-upgrade check.

That error comes from trying to find the latest version of mke using docker hub to notify when there's a newer mke version available.

There's no way to disable that check 😞 - it should be changed to just ignore any error and move forward in case the version check fails.