question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent value for `runner.temp` when running in a container

See original GitHub issue

Describe the bug

It appears https://github.com/actions/runner/pull/1762 only partly fixed the problem. Looking at a failed run https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621 the variable runner.temp is expanded with two different values.

In the following workflow snippet:

    runs-on: ubuntu-latest
    container:
      image: centos:centos7
    steps: 
      - name: Download Ruby bundle
        uses: actions/download-artifact@v3
        with:
          name: codeql-ruby-bundle
          path: ${{ runner.temp }}
      - name: Unzip Ruby bundle
        shell: bash
        run: unzip -q -d "${{ runner.temp }}/ruby-bundle" "${{ runner.temp }}/codeql-ruby-bundle.zip"

The use of path: ${{ github.temp }} in the with: clause of the download step was expanded correctly:

  with:
    name: codeql-ruby-bundle
    path: /home/runner/work/_temp

but the variable was expanded wrongly in the run: step.

unzip -q -d "/home/runner/work/_temp/ruby-bundle" "/home/runner/work/_temp/codeql-ruby-bundle.zip"

Expected behavior All uses of the runner.temp variable inside the steps should be expanded to same value. The same for any of the other folder related variables.

Runner Version and Platform

Version of your runner? ‘2.303.0’

OS of the machine running the runner? Linux

What’s not working?

Job fails with a “file not found” error message.

Job Log Output

If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.

23s
0s
Run actions/download-artifact@v3
/usr/bin/docker exec  738c06c08904026388[1](https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621#step:6:1)a29ebc5944bd1ae51256[8](https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621#step:6:9)[9](https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621#step:6:10)97cdb84589427445afc1e39 sh -c "cat /etc/*release | grep ^ID"
Starting download for codeql-ruby-bundle
Directory structure has been setup for the artifact
Total number of files that will be downloaded: 1
Artifact codeql-ruby-bundle was downloaded to /__w/_temp
Artifact download has finished successfully
0s
Run unzip -q -d "/home/runner/work/_temp/ruby-bundle" "/home/runner/work/_temp/codeql-ruby-bundle.zip"
unzip:  cannot find or open /home/runner/work/_temp/codeql-ruby-bundle.zip, /home/runner/work/_temp/codeql-ruby-bundle.zip.zip or /home/runner/work/_temp/codeql-ruby-bundle.zip.ZIP.
Error: Process completed with exit code 9.

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aibaarscommented, Mar 22, 2023

Yes indeed, we already switched to RUNNER_TEMP which worked as expected.

Thanks for helping me understand what it going on. In the end the expansion is not inconsistent. It’s just the way how action inputs are translated to environment variables that made it look like there was an inconsistency.

0reactions
nikola-jokiccommented, Mar 22, 2023

Exactly 😄 Envs are getting translated for sure I think you can leverage env instead of template to get the container path: RUNNER_TEMP for example That one will get translated for sure

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker compose, running containers in net:host
If I run all services manually by using docker run --net = "host" everything is working fine. In the documentation I read that...
Read more >
Troubleshoot pipeline runs - Azure DevOps
Learn how to troubleshoot pipeline runs in Azure Pipelines and Team Foundation Server.
Read more >
Container runner reference
Container runner supports claiming and running tasks from multiple resource classes concurrently, as well as customization of the Kubernetes resources ...
Read more >
How to Handle the Incompatible Types Error in Java
The Java incompatible types error happens when a value assigned to a variable or returned by a method is incompatible with the one...
Read more >
Mocha - the fun, simple, flexible JavaScript test framework
Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found