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

"tar (child): Cannot connect to d: resolve failed" error when intalling on Windows #28

Closed
slonopotamus opened this issue Feb 28, 2020 · 10 comments
Assignees

Comments

@slonopotamus
Copy link

slonopotamus commented Feb 28, 2020

Run eregon/use-ruby-action@v1
  with:
    ruby-version: jruby
https://github.com/ruby/ruby-builder/releases/download/builds-no-warn/jruby-9.2.10.0-windows-latest.tar.gz
"C:\Program Files\Git\usr\bin\tar.exe" xz -C C:\Users\runneradmin\.rubies -f d:\a\_temp\faffe4a1-577f-4d8d-912c-b897e86696ba
tar (child): Cannot connect to d: resolve failed

gzip: stdin: unexpected end of file
/usr/bin/tar: Child returned status 128
/usr/bin/tar: Error is not recoverable: exiting now
##[error]The process 'C:\Program Files\Git\usr\bin\tar.exe' failed with exit code 2

Failure log: https://github.com/slonopotamus/asciidoctor-epub3/runs/474587790?check_suite_focus=true#step:3:6

No changes were done in repo since previous run 3 days ago that worked successfully: https://github.com/slonopotamus/asciidoctor-epub3/runs/467944869?check_suite_focus=true#step:3:5

There's also evidence that it worked yesterday: https://github.com/asciidoctor/asciidoctor-pdf/runs/471779090

Same failure in a different project: https://github.com/asciidoctor/asciidoctor-pdf/runs/474207029#step:3:8

@eregon
Copy link
Member

eregon commented Feb 28, 2020

One big difference between those two runs:

"C:\Program Files\Git\usr\bin\tar.exe" xz -C C:\Users\runneradmin\.rubies -f d:\a\_temp\faffe4a1-577f-4d8d-912c-b897e86696ba
tar (child): Cannot connect to d: resolve failed

and

C:\windows\system32\tar.exe xz -C C:\Users\runneradmin\.rubies -f d:\a\_temp\5b913b12-b74b-4b19-a622-fd348135a918

So tar.exe from C:\Program Files\Git\usr\bin doesn't work well.

We're using the official actions/tool-cache's extractTar() here:

await tc.extractTar(downloadPath, rubiesDir)

So it must be a bug of that or of the GitHub Actions image.

@eregon
Copy link
Member

eregon commented Feb 28, 2020

Seems very similar to actions/toolkit#194

@MSP-Greg
Copy link
Collaborator

@eregon

Been there, done that. There's more issues with the 'git' tar also. I think it won't do lzma?

Was just going to do the following around ruby_builder.js:38:

  const downloadPath = await tc.downloadTool(url)
  if (os.platform() === 'win32') {
    let args = [ '-xz', '-C', rubiesDir, '-f',  downloadPath ]
    await exec.exec('C:\\Windows\\system32\\tar.exe', args)
  } else {
    await tc.extractTar(downloadPath, rubiesDir)
  }

@eregon
Copy link
Member

eregon commented Feb 28, 2020

@MSP-Greg That looks good, could you make a PR?
Could you use platform instead of os.platform() there?

@eregon
Copy link
Member

eregon commented Feb 28, 2020

@MSP-Greg
Copy link
Collaborator

could you make a PR?

Yes.

As mentioned, the git tar is messy, I've had to feed it 'nix' style paths.

As I've dug more into some of the custom actions, some seem to warrant replacing. For instance, one had a dependency on another one, and the dependency had been updated a couple of times, but it wasn't accounted for in the main action. IOW, there's often unneeded layers added.

Like with this, I wasn't sure if node had a library like Ruby has, or whether they were just shelling out. We might as well shell out and use the native Windows tar...

@eregon
Copy link
Member

eregon commented Feb 28, 2020

I filed an issue, it's a bug of the new GitHub Actions Windows images: actions/runner-images#480

@MSP-Greg
Copy link
Collaborator

See PR #29

@eregon
Copy link
Member

eregon commented Feb 28, 2020

Fixed by #29, released in https://github.com/ruby/setup-ruby/releases/tag/v1.20.1, v1 branch updated, so this should work fine now.
The upstream bug has also been addressed, but that one might take some time to be deployed: actions/runner-images#480 (comment)

@slonopotamus
Copy link
Author

Thanks for all these investigations & a quick fix!

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

No branches or pull requests

3 participants