openfaas / faas-cli

Official CLI for OpenFaaS
https://www.openfaas.com/
Other
798 stars 224 forks source link

Script to install faas-cli suddenly fails due to new response from github #767

Closed andeplane closed 4 years ago

andeplane commented 4 years ago

Current recommended install script curl -sSL https://cli.openfaas.com | sh fails because https://github.com/openfaas/faas-cli/releases/latest suddenly returns location with lowercase L, so curl -sI https://github.com/$OWNER/$REPO/releases/latest | grep Location gives nothing.

Expected Behaviour

Running the command should install faas-cli.

Current Behaviour

Running the command fails:

...
Step 6/24 : RUN curl -sSL https://cli.openfaas.com | sh
 ---> Running in 2310e0d1c65f
Failed while attempting to install faas-cli. Please manually install:
1. Open your web browser and go to https://github.com/openfaas/faas-cli/releases
2. Download the latest release for your platform. Call it 'faas-cli'.
3. chmod +x ./faas-cli
4. mv ./faas-cli /usr/local/bin
5. ln -sf /usr/local/bin/faas-cli /usr/local/bin/faas
The command '/bin/sh -c curl -sSL https://cli.openfaas.com | sh' returned a non-zero code: 1
script returned exit code 1

Possible Solution

Grep on case insensitive location?

Steps to Reproduce (for bugs)

Just run curl -sSL https://cli.openfaas.com | sh

Context

Docker build using faas-cli suddenly failed.

Your Environment

Dockerfile with FROM python:3.7 base image. Also happens on my macOS.

alexellis commented 4 years ago

Hi @andeplane we are aware of this problem, thank you for flagging it. This happens oddly only some of the time.

It would appear to be a problem with GitHub's servers, they are going through some bumpy waters this week.

I think my changes to the CLI with grep -i have helped, can you retry?

Alex

alexellis commented 4 years ago

I think this will need patching in k3sup, arkade, inlets and ofc-bootstrap too, so that grep -i is used instead of grep. The Location header is now being forced to lowercase some of the time by the GitHub servers.

andeplane commented 4 years ago

Worked now at least. I see the change in get.sh so looks good :)

andeplane commented 4 years ago

I'll close this as I see it as resolved.