myoung34 / docker-github-actions-runner

This will run the new self-hosted github actions runners with docker-in-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Github/actions: GetError: Can't use 'tar -xzf' extract archive file return code: 2

bdoublet91 opened this issue · comments

Hi,

I use github action with self hosted runners and I don't get problem until now.

name: CI mirroring

# Controls when the action will run. 
on:
  push:
  pull_request:
  schedule:
    # * is a special character in YAML so you have to quote this string
    - cron:  '30 2 * * *'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: self-hosted
    timeout-minutes: 15
    
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:          
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

I want to checkout my private github repo to execute action but get error that I haven't before:

 Current runner version: '2.278.0'
Runner name: 'runner_1'
Runner group name: 'Default'
Machine name: '2526d86f2a75'
GITHUB_TOKEN Permissions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2'
Error: Can't use 'tar -xzf' extract archive file: /tmp/runner/_actions/_temp_0207f89a-ccec-4204-a7b6-533817e1094e/cef27ea4-0563-40a2-ac70-c94e38e49e4d.tar.gz. return code: 2.

When I use github runner with ubuntu-latest, it's working so I think there is something wrong with my self hosted runner.
I use docker self hosted runner from this project https://github.com/myoung34/docker-github-actions-runner
All working well, runners start, connect to github and get idle state.
When I execute pipeline, runner take the job and execute but get this error. I don't know what change.

I have tar binary and the error means that tar was executed but failed so maybe the download of tar.gz file failed.

which tar
/usr/bin/tar

Can you help me to debug this ? debug logs, some checks, any idea.

Thanks you

Best regards

Return code 2 for tar means there was a file read error. You'll want to check permissions for the file and extract path

Thanks for your quick answer !
yeah, I read this on tar documentation.

here my workdir_runner:

ls -ahl /tmp/runner/_actions/
total 12K
drwxr-xr-x 3 nobody nogroup 4.0K May 26 21:27 .
drwxr-xr-x 6 nobody nogroup 4.0K May 26 21:27 ..
drwxr-xr-x 3 nobody nogroup 4.0K May 26 21:27 actions

seems like folder are created because I have Folder with my repo name but there is no tar.gz file.
Could be deleted after the job failed ? or doesnt exist ?

Do you know what is this tar.gz file ?

There is some command I can reproduce to test the download of tar.gz file manually ?

This is not something I'm familiar with, the tar usage I've had has had no issues locally or in testing

Ok I'll dig this problem and do a feedback it I find a solution.
Thanks

OK found it.

    volumes:
      - '/tmp/runner:/tmp/runner'
      # needs to be the same path on host and inside the container,

I thought this setting was necessary if you use docker command in github-runner. So I set up the host path and container path differently and this error occured. So I rollback and it's ok now.

Just a question ? If I don't use docker command, why did this happen ? I mean, why I can't use different path for host and container for workdir runner ?

The issue can be closed. Thanks

Just a question ? If I don't use docker command, why did this happen ? I mean, why I can't use different path for host and container for workdir runner ?

I think this is internal to the way github runners work outside their infra more than it is docker, but I'm not completely sure.

Ok, anyway, thanks you for your job about this project.

I'm getting the same error right now.

image

This started happening for us this morning too. No changes in code between the working and breaking state

Started happening to us in the past couple of hours too.

Although we're using a different self hosted runner.

The same is happening to us, we aren't even using hosted runners

We're having the same issue, it fails sometimes on all our workflows, using the github hosted runners

Same error here. Randomly failing test runs with the error given in the issue. Restarting the run might help, but not always.

Same error here also 👋

Same problem. It happened since this morning. 🥲

actions/runner#1923 seems like a better place to track this issue, though.

Still happening here without any changes on our end

It happens randomly for me (for a few CI runs this morning)

looks like it's working now..

Thanks for all the quick info. Looks like something upstream was definitely broken. It's worth leaving feedback on actions/runner#1923