cURL connectivity issues

Hi,
We started seeing connectivity issues in jobs that have IP ranges feature enabled. We’re using cimg/base:edge docker image. Some error examples are:

#!/bin/bash -eo pipefail
curl -Ss https://get.helm.sh/helm-v3.5.4-linux-amd64.tar.gz -o /tmp/helm.tar.gz
tar -zxf /tmp/helm.tar.gz -C /tmp
sudo mv -f /tmp/linux-amd64/helm /usr/local/bin/helm      
curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to get.helm.sh:443 
Exited with code exit status 35
curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to baltocdn.com:443

These happen randomly. In most cases, rerunning the failed job would solve the issue.
Is anyone experiencing the same issue?

Hi @chenyang,

Thank you for sharing your issue with us.

We have received reports from other users regarding a similar issue.
It is being looked into on our end, but one workaround to unblock you would be to write a script that retries the curl command if it fails.

Here is an example adapted to your current script:

- run: 
    name: Install Helm
    command: |
        BASE_URL="https://get.helm.sh"
        TAR_FILE="helm-v3.5.4-linux-amd64.tar.gz"
        n=0
        until [ "$n" -ge 5 ]
        do
            curl -Ss ${BASE_URL}/${TAR_FILE} -o /tmp/helm.tar.gz && \
            tar -zxf /tmp/helm.tar.gz -C /tmp && \
            sudo mv -f /tmp/linux-amd64/helm /usr/local/bin/helm && \
            break
            echo -e "\nCurl command failed. Retrying again...\n"
            n=$((n+1)) 
            sleep 1
        done

This will try the curl command up until 5 times if it fails.

Certain versions of cURL contain retry options, but I was unable to get it to work when it fails due to an ssl error (as it is in this case).

Please let me know if this will work for your use case, and I am happy to answer any additional questions.

Thank you!

1 Like

Thanks @aaronclark We eventually end up with building our own docker image with Helm installed. But I tried your solution it appears to work perfectly. Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.