Giter Site home page Giter Site logo

Comments (5)

Jaryt avatar Jaryt commented on July 25, 2024

Hi @mockdeep ! Thanks for submitting this issue. Can you inform us on how often this occurs? I believe this might be an issue with the install script provided by nvm, or with github being flaky on clone connections. While searching around for issues like this, I kept stumbling across posts where people are changing the port from ssh to ssl: https://gist.github.com/kcc0/d88150ace547976cfcccd578f30c816a

However, I think that might be a solution to when the 22 port is blocked by a firewall, which doesn't apply here.

from node-orb.

mockdeep avatar mockdeep commented on July 25, 2024

Hi @Jaryt, thanks for the quick response. We see this issue a handful of times each week. I think it's probably our largest source of flake in our test suite at the moment.

Out of curiosity, I was looking at how asdf installs node and it looks like they use node-build. I've got no idea how that is different from nvm, but maybe worth looking into?

Also, should the installation be cached so that it doesn't need to be reinstalled each time? I wonder if that might reduce the flake some, too.

from node-orb.

Jaryt avatar Jaryt commented on July 25, 2024

I'd have to investigate the caching of .nvm further to ensure that it's stable. But since you are encountering this, I would encourage you to experiment with caching /home/circleci/.nvm and letting us know how you fair! (I will experiment with this as well, once I get the chance)

from node-orb.

mockdeep avatar mockdeep commented on July 25, 2024

This is failing pretty hard for us right now. I haven't had a chance to try the caching, yet, but we're seeing a ton of failures with exit status 18. It's hard to tell anything else about why it is failing from the output:

output
#!/bin/bash -eo pipefail
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi

# FUNCTIONS
get_yarn_version () {
    if [[ "$NODE_PARAM_YARN_VERSION" == "" ]]; then
    YARN_ORB_VERSION=$(curl -Ls -o /dev/null -w "%{url_effective}" \
        "https://github.com/yarnpkg/yarn/releases/latest" | sed 's:.*/::' | cut -d 'v' -f 2 | cut -d 'v' -f 2)
    echo "Latest version of Yarn is $YARN_ORB_VERSION"
    else
    YARN_ORB_VERSION="$NODE_PARAM_YARN_VERSION"

    echo "Selected version of Yarn is $YARN_ORB_VERSION"
    fi
}

installation_check () {
    echo "Checking if YARN is already installed..."
    if command -v yarn > /dev/null 2>&1; then
    if yarn --version | grep "$YARN_ORB_VERSION" > /dev/null 2>&1; then
        echo "Yarn $YARN_ORB_VERSION is already installed"
        exit 0
    else
        echo "A different version of Yarn is installed ($(yarn --version)); removing it"

        if uname -a | grep Darwin > /dev/null 2>&1; then
        brew uninstall yarn > /dev/null 2>&1
        elif grep Alpine /etc/issue > /dev/null 2>&1; then
        apk del yarn > /dev/null 2>&1
        elif grep Debian /etc/issue > /dev/null 2>&1; then
        $SUDO apt-get remove yarn > /dev/null 2>&1 && \
            $SUDO apt-get purge yarn > /dev/null 2>&1
        elif grep Ubuntu /etc/issue > /dev/null 2>&1; then
        $SUDO apt-get remove yarn > /dev/null 2>&1 && \
            $SUDO apt-get purge yarn > /dev/null 2>&1
        elif command -v yum > /dev/null 2>&1; then
        yum remove yarn > /dev/null 2>&1
        fi

        $SUDO rm -rf "$HOME/.yarn" > /dev/null 2>&1
        $SUDO rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg > /dev/null 2>&1
    fi
    fi
}

get_yarn_version
installation_check

# install yarn
echo "Installing YARN v$YARN_ORB_VERSION"
curl -L -o yarn.tar.gz --silent "https://yarnpkg.com/downloads/$YARN_ORB_VERSION/yarn-v$YARN_ORB_VERSION.tar.gz"

$SUDO tar -xzf yarn.tar.gz && rm yarn.tar.gz

$SUDO mkdir -p /opt/yarn
$SUDO mv yarn-v"${YARN_ORB_VERSION}"/* /opt/yarn

$SUDO rm -rf "yarn-v${YARN_ORB_VERSION}"

$SUDO chmod 777 "/opt/yarn"

$SUDO ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn
$SUDO ln -s /opt/yarn/bin/yarnpkg /usr/local/bin/yarnpkg
$SUDO ln -s /opt/yarn/bin/yarn.js /usr/local/bin/yarn.js

$SUDO mkdir -p ~/.config

if uname -a | grep Darwin; then
    $SUDO chown -R "$USER:$GROUP" ~/.config
    $SUDO chown -R "$USER:$GROUP" /opt/yarn
else
    $SUDO chown -R "$(whoami):$(whoami)" /opt/yarn
    $SUDO chown -R "$(whoami):$(whoami)" ~/.config
fi

# test/verify version
echo "Verifying YARN install"
if yarn --version | grep "$YARN_ORB_VERSION" > /dev/null 2>&1; then
    echo "Success! Yarn $(yarn --version) has been installed to $(which yarn)"
else
    echo "Something went wrong; the specified version of Yarn could not be installed"
    exit 1
fi

Latest version of Yarn is 1.22.17
Checking if YARN is already installed...
A different version of Yarn is installed (1.22.5); removing it
Installing YARN v1.22.17

Exited with code exit status 18

CircleCI received exit code 18

from node-orb.

Jaryt avatar Jaryt commented on July 25, 2024

Moving to backlog as we will be escalating this to our images team.

from node-orb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.