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

init-pants action fails in curl command after #21 #22

Open
rajeshwar-nu opened this issue May 8, 2023 · 6 comments
Open

init-pants action fails in curl command after #21 #22

rajeshwar-nu opened this issue May 8, 2023 · 6 comments

Comments

@rajeshwar-nu
Copy link

PR #21 introduced using ${{ runner.temp }} instead of temp directory /tmp to download get-pants script.
The curl command fails with error curl: (23) Failure writing output to destination since the default worker temp directory /home/runner/work/_temp does not exist.
The fix would be to use flag https://curl.se/docs/manpage.html#--create-dirs which will create the directory if it does not exists.
The final command would look like this
curl --create-dirs --proto '=https' --tlsv1.2 -fsSLo ${{ runner.temp }}/get-pants.sh

@kaos
Copy link
Member

kaos commented May 8, 2023

Thanks for the report @rajeshwar-nu.
PR welcome if you want to submit that change to speed up the process :)

@benjyw
Copy link
Sponsor Contributor

benjyw commented May 8, 2023

Ooof, that is super annoying, that runner.temp doesn't exist... @rajeshwar-nu a PR would be most welcome! Thanks.

@eguiraud
Copy link

We just got hit by this issue from May last year -- it's still present in the latest v8 tag.

Adding this step before the init-pants action works around the problem, but it would be great to have a fix upstream:

- name: Create runner.temp
  run: |
    # work around https://github.com/pantsbuild/actions/issues/22
    mkdir -p ${{ runner.temp }}

@benjyw
Copy link
Sponsor Contributor

benjyw commented Feb 21, 2024

@eguiraud Could you send a PR in this repo with the fix? Thanks!

@eguiraud
Copy link

I am not sure whether the one above is the most appropriate fix (nor, if it is, where to put it exactly in this repo)

@benjyw
Copy link
Sponsor Contributor

benjyw commented Feb 21, 2024

That seems like the right fix to me. Adding --create-dirs to the curl command works, but only for curl, and if in the future some change tries to use the temp dir in a different way, it would fail again. And the change would go here: https://github.com/pantsbuild/actions/blob/main/init-pants/action.yaml

HOWEVER... @eguiraud Are you running in a container? The issue may be actions/runner#965, in which case none of these solutions are robust. The container user may or may not be able to mkdir, but you'd be creating a container tempdir at a path that only makes sense on the host, which is sketchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants