Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions failing at installation of Node.js #309

Closed
PhilippImhof opened this issue Aug 8, 2024 · 16 comments · Fixed by #313 or innocampus/moodle-local_listcoursefiles#13 · May be fixed by #312
Closed

GitHub Actions failing at installation of Node.js #309

PhilippImhof opened this issue Aug 8, 2024 · 16 comments · Fixed by #313 or innocampus/moodle-local_listcoursefiles#13 · May be fixed by #312

Comments

@PhilippImhof
Copy link

A few days ago, some of my CI checks randomly failed at the install moodle-plugin-ci step. After a few retries, all checks finally passed. In the meantime, things have become worse. Currently, all checks are constantly failing. Some other developers reported the same in the dev chat.

 0/9 [>---------------------------]   0% < 1 sec [Starting install]
 2/9 [======>---------------------]  22% 15 secs [Moodle assets]
 3/9 [=========>------------------]  33% 15 secs [Install plugins]
 4/9 [============>---------------]  44% 16 secs [Installing Node.js]
In VendorInstaller.php line [12](https://github.com/PhilippImhof/moodle-quiz_essaydownload/actions/runs/10297980501/job/28511977093#step:6:13)9:
                                
  Node.js installation failed.  
                                
install [--moodle MOODLE] [--data DATA] [--repo REPO] [--branch BRANCH] [--plugin PLUGIN] [--db-type DB-TYPE] [--db-user DB-USER] [--db-pass DB-PASS] [--db-name DB-NAME] [--db-host DB-HOST] [--db-port DB-PORT] [--not-paths NOT-PATHS] [--not-names NOT-NAMES] [--extra-plugins EXTRA-PLUGINS] [--no-init] [--no-plugin-node] [--node-version NODE-VERSION]
Error: Process completed with exit code 1.
@kabalin
Copy link
Member

kabalin commented Aug 8, 2024

Test run on main branch fails too. Latest release of ubuntu-22.04 bumped nvm to 0.40.0. Looks to me as related nvm-sh/nvm#3405.

@jrchamp
Copy link
Contributor

jrchamp commented Aug 8, 2024

Maybe actions/setup-node is a more reliable way to install Node.js?

@stronk7
Copy link
Member

stronk7 commented Aug 11, 2024

Coincidentally I arrived to this issue, worth checking it. It seems that some incompatibility between nvm (that we use to install the target nodejs version) and GitHub actions may be the root of the problem: nvm-sh/nvm#3405

A fix is being worked on, based on the last comments there…

@stronk7
Copy link
Member

stronk7 commented Aug 11, 2024

Ah, @kabalin , just saw your comment now! Snap!

@kabalin kabalin mentioned this issue Aug 11, 2024
@kabalin
Copy link
Member

kabalin commented Aug 11, 2024

A fix is being worked on, based on the last comments there…

Yeah, runner-images would need to be updated too following the fix in nvm, will take time. Temporary workaround is to install nvm 0.39.7 explicitly like at #310.

@kabalin
Copy link
Member

kabalin commented Aug 13, 2024

Just to note, if we go for GH Action #303 (#53), this could be easily fixed for everyone without need to add workaround to individual workflows.

@Ghostscypher
Copy link

Ghostscypher commented Aug 13, 2024

Solved mine temporarily by adding the following before Install moodle-plugin-ci step

      - name: Install NVM and Node
        run: |
          curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
          export NVM_DIR="$HOME/.nvm"
          [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
          nvm install 20
          nvm use 20

Just a temporary fix before this plugin is updated

@kabalin
Copy link
Member

kabalin commented Aug 13, 2024

Just a temporary fix before this plugin is updated

So, you are installing version 20 explicitly, can you share the workflow? I would expect install step to fail as it only bypass node installation if NVM_DIR is undefined. Installing v0.40.0 is not necessary, it is already of that version in ubuntu-22.04 image we use (which actually cause of regression).

The easiest workaround for now is described in #310, a one-liner fix to downgrade nvm.

jmorrph added a commit to ild-thl/moodle-block_disealytics that referenced this issue Aug 13, 2024
@ljharb
Copy link

ljharb commented Aug 13, 2024

set +e is a much easier workaround than downgrading nvm, fwiw.

@kabalin
Copy link
Member

kabalin commented Aug 14, 2024

set +e is a much easier workaround than downgrading nvm, fwiw.

Hmm, does not seem have effect (unless I am using it wrong way)
https://github.com/kabalin/moodle-plugin-ci/actions/runs/10384715590/job/28752387566#step:6:168

@ljharb
Copy link

ljharb commented Aug 15, 2024

You're using it correctly afaict (altho . /home/runner/.nvm/nvm.sh && nvm install && nvm use can just be . /home/runner/.nvm/nvm.sh --install), but I only see a moodle error and not the actual result of running that command?

mdjnelson added a commit to mdjnelson/moodle-mod_customcert that referenced this issue Aug 18, 2024
This is a temporary fix and if this is fixed upstream we should
consider reverting this.
mdjnelson added a commit to mdjnelson/moodle-mod_customcert that referenced this issue Aug 18, 2024
This is a temporary fix and if this is fixed upstream we should
consider reverting this.
mdjnelson added a commit to mdjnelson/moodle-mod_customcert that referenced this issue Aug 18, 2024
This is a temporary fix and if this is fixed upstream we should
consider reverting this.
mdjnelson added a commit to mdjnelson/moodle-mod_customcert that referenced this issue Aug 18, 2024
This is a temporary fix and if this is fixed upstream we should
consider reverting this.
gjb2048 added a commit to gjbarnard/moodle-format_grid that referenced this issue Aug 19, 2024
semteacher added a commit to semteacher/moodle-mod_booking that referenced this issue Aug 19, 2024
gjb2048 added a commit to gjbarnard/moodle-format_grid that referenced this issue Aug 20, 2024
gjb2048 added a commit to gjbarnard/moodle-format_grid that referenced this issue Aug 20, 2024
gjb2048 added a commit to gjbarnard/moodle-format_grid that referenced this issue Aug 20, 2024
sh-csg added a commit to sh-csg/moodle-availability_user that referenced this issue Aug 21, 2024
FelixDiLenarda added a commit to FelixDiLenarda/moodle-local_listcoursefiles that referenced this issue Aug 22, 2024
MartinGauk pushed a commit to innocampus/moodle-local_listcoursefiles that referenced this issue Aug 22, 2024
kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Aug 22, 2024
Install 0.39.7 explicitly as part of vendor installation, so we have control over the version we use.

For cases where nvm is not required (pre-installed in the image, use
--no-nvm param for install command)

Fixes moodlehq#309
kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Aug 22, 2024
Install 0.39.7 explicitly as part of vendor installation, so we have control over the version we use.

For cases where nvm is not required (pre-installed in the image, use
--no-nvm param for install command)

Fixes moodlehq#309
kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Aug 22, 2024
Install 0.39.7 explicitly as part of vendor installation, so we have control over the version we use.

For cases where nvm is not required (pre-installed in the image, use
--no-nvm param for install command)

Fixes moodlehq#309
kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Aug 22, 2024
Install 0.39.7 explicitly as part of vendor installation, so we have control over the version we use.

For cases where nvm is not required (pre-installed in the image, use
--no-nvm param for install command)

Fixes moodlehq#309
gjb2048 added a commit to Wunderbyte-GmbH/moodle-theme_lexa that referenced this issue Aug 22, 2024
kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Aug 23, 2024
@kabalin
Copy link
Member

kabalin commented Aug 23, 2024

We fixed this in 4.5.4 release, those who added temporary workaround can safely remove it. Sorry for delaying the fix and thanks for your patience :)

@jrchamp
Copy link
Contributor

jrchamp commented Aug 23, 2024

@kabalin Thank you so much! Can a similar fix be applied to the 3.x branch? We still do some testing against older versions which do not work with 4.x

georgmaisser pushed a commit to Wunderbyte-GmbH/moodle-mod_booking that referenced this issue Aug 26, 2024
FelixDiLenarda added a commit to FelixDiLenarda/moodle-local_listcoursefiles that referenced this issue Aug 28, 2024
FelixDiLenarda added a commit to innocampus/moodle-local_listcoursefiles that referenced this issue Aug 29, 2024
kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Aug 29, 2024
We should not rely on success exit status from nvm.sh loading.

Fixes moodlehq#309
@kabalin
Copy link
Member

kabalin commented Aug 29, 2024

@kabalin Thank you so much! Can a similar fix be applied to the 3.x branch? We still do some testing against older versions which do not work with 4.x

Yep, the fix has been released for 3.x too.

@ljharb
Copy link

ljharb commented Aug 29, 2024

fwiw v0.40.1 of nvm has been released, which should fix this issue.

RiedleroD added a commit to necodeIT/lb_planner_plugin that referenced this issue Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants
@ljharb @stronk7 @kabalin @jrchamp @Ghostscypher @PhilippImhof and others