Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Fails with 'Error: The "path" argument must be of type string. Received type undefined' #185

Open
1 of 3 tasks
ctron opened this issue Jun 16, 2021 · 1 comment
Open
1 of 3 tasks
Labels
bug Something isn't working

Comments

@ctron
Copy link

ctron commented Jun 16, 2021

Do the checklist before filing an issue:

Description

The actions fails with:

To configure your current shell, run:
source $HOME/.cargo/env
Error: The "path" argument must be of type string. Received type undefined

Workflow code

      - name: Install latest stable
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

Action output

/home/builder/actions-runner/_work/_temp/e7a37539-272f-47cf-9559-376c37ffd79c --default-toolchain none -y
info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: skipping toolchain installation


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, run:
source $HOME/.cargo/env
Error: The "path" argument must be of type string. Received type undefined

Expected behavior

It should succeed.

Additional context

This is running on an self-hosted runner. Both fedora34 and ubuntu-20.04 fail the same way.

@ctron ctron added the bug Something isn't working label Jun 16, 2021
@ctron
Copy link
Author

ctron commented Jun 16, 2021

Ok, after digging a bit into this issue: It seems that self hosted runner (when installed as service using ./svc.sh) get installed as "root", which doesn't seem to have "HOME" set, which then fails right here:

https://github.com/actions-rs/core/blob/4487ec12063a411d19993339db585c95b354ffb4/src/commands/rustup.ts#L89-L90

I guess just ignoring the error wasn't the best choice 😁

Anyway, it isn't an issue of this repository. And you can work around this by installing the service as a dedicated user:

./svc.sh install <user>

Which works better for me anyway.

lionel-faber added a commit to lionel-faber/core that referenced this issue Jan 3, 2022
$HOME is not defined by default on Windows.
$USERPROFILE will return the desired value

fixes actions-rs/toolchain#185, actions-rs/toolchain#137
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant