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

EEXIST err on windows when adding to cache. #550

Open
2 of 5 tasks
xiaost opened this issue Feb 6, 2025 · 6 comments
Open
2 of 5 tasks

EEXIST err on windows when adding to cache. #550

xiaost opened this issue Feb 6, 2025 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@xiaost
Copy link

xiaost commented Feb 6, 2025

Description:

EEXIST on windows when adding to cache.

Setup go version spec 1.17
Attempting to download 1.17...
matching 1.17...
Acquiring 1.17.13 from https://github.com/actions/go-versions/releases/download/1.17.13-2779743212/go-1.17.13-win32-x64.zip
Extracting Go...
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'D:\Users\cloudwego\actions-runner\_work\_temp\go-1.17.13-win32-x64.zip' -DestinationPath 'D:\Users\cloudwego\actions-runner\_work\_temp\7aab9b3[8](https://github.com/cloudwego/hertz/actions/runs/13171441602/job/36766483015#step:3:9)-3551-4f2b-8256-964286efbe30' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('D:\Users\cloudwego\actions-runner\_work\_temp\go-1.17.13-win32-x64.zip', 'D:\Users\cloudwego\actions-runner\_work\_temp\7aab[9](https://github.com/cloudwego/hertz/actions/runs/13171441602/job/36766483015#step:3:10)b38-3551-4f2b-8256-964286efbe30', $true) }"
Successfully extracted go to D:\Users\cloudwego\actions-runner\_work\_temp\7aab9b38-3551-4f2b-8256-964286efbe30
Adding to the cache ...
EEXIST: file already exists, symlink 'D:\Users\cloudwego\actions-runner\_work\_tool\go\1.17.13\x64' -> 'D:\Users\cloudwego\actions-runner\_work\_tool\go\1.17.13\x64'
Falling back to download directly from Go
Install from dist
Acquiring go1.17.13 from https://storage.googleapis.com/golang/go1.17.13.windows-amd64.zip
Extracting Go...
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'D:\Users\cloudwego\actions-runner\_work\_temp\go1.17.[13](https://github.com/cloudwego/hertz/actions/runs/13171441602/job/36766483015#step:3:14).windows-amd64.zip' -DestinationPath 'D:\Users\cloudwego\actions-runner\_work\_temp\7ce9b72f-9f68-4f76-aa7f-f1f7b8fffbf6' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('D:\Users\cloudwego\actions-runner\_work\_temp\go1.17.13.windows-amd64.zip', 'D:\Users\cloudwego\actions-runner\_work\_temp\7ce9b72f-9f68-4f76-aa7f-f1f7b8fffbf6', $true) }"
Successfully extracted go to D:\Users\cloudwego\actions-runner\_work\_temp\7ce9b72f-9f68-4f76-aa7f-f1f7b8fffbf6
Adding to the cache ...
Error: Failed to download version 1.[17](https://github.com/cloudwego/hertz/actions/runs/13171441602/job/36766483015#step:3:18): Error: EEXIST: file already exists, symlink 'D:\Users\cloudwego\actions-runner\_work\_tool\go\1.17.13\x64' -> 'D:\Users\cloudwego\actions-runner\_work\_tool\go\1.17.13\x64'

Action version:

actions/setup-go@v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

go1.17

Repro steps:
https://github.com/cloudwego/hertz/actions/runs/13171441602/job/36766483015

Expected behavior:

no error

Actual behavior:

error with EEXIST

@xiaost xiaost added bug Something isn't working needs triage labels Feb 6, 2025
@xiaost
Copy link
Author

xiaost commented Feb 6, 2025

It only happens when the first run we setup a new env.

and the next run will be

Found in cache @ D:\Users\cloudwego\actions-runner\_work\_tool\go\1.17.13\x64

I think it's not caused by go version.
it also reproduced here: https://github.com/cloudwego/hertz/actions/runs/13171441602/job/36766961921

@gowridurgad
Copy link

Hi @xiaost,
Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.

@priyagupta108 priyagupta108 self-assigned this Feb 10, 2025
@VinGarcia
Copy link

I am having this same error using setup-go@v4:

Successfully extracted go to C:\actions-runner-m0rFq_work_temp\e6f1231e-8acf-471e-acab-3c810beba5f0
Adding to the cache ...
Error: Failed to download version 1.23: Error: EEXIST: file already exists, symlink 'D:\actions-runner-m0rFq_work_tool\go\1.23.6\x64' -> 'D:\actions-runner-m0rFq_work_tool\go\1.23.6\x64'

But at least in my case it doesn't happen the first time, it happens on the second time when the file is already there.

I was actually able to make this error stop happening by just deleting the entire _work\_tool|go directory with this command:

      - name: Cleanup Workdir to workaround a setup-go bug
        # The bug mentioned above causes setup-go to fail downloading
        # Golang because "the file already exists", but disabling
        # cache doesn't fix it, so we'll just delete it manually.
        run: |
          if (Test-Path "${{ github.workspace }}\..\..\_tool\go") {
            Remove-Item -Path "${{ github.workspace }}\..\..\_tool\go" -Recurse -Force;
          }

But then I don't have the cache which means the Windows CI is taking a long time to finish, as it has to download and install Golang everytime.

@priyagupta108
Copy link
Contributor

Hi there 👋,
Thank you for your report. I have attempted to reproduce the issue on my end but was unable to do so.
Could you please try setting the environment variable AGENT_ISSELFHOSTED=1 in your workflow?

on:
...

env:
  AGENT_ISSELFHOSTED: 1

@xiaost
Copy link
Author

xiaost commented Feb 14, 2025

Thanks @priyagupta108 , it works now. is the env var required for self-hosted runners? didn't know.

we're testing self-hosted windows. Didn't see this err on Linux before.

Setup go version spec stable
stable version resolved as 1.24.0
Attempting to download 1.24.0...
matching 1.24.0...
Acquiring 1.24.0 from https://github.com/actions/go-versions/releases/download/1.24.0-13277276272/go-1.24.0-win32-x64.zip
Extracting Go...
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'D:\Users\cloudwego\actions-runner\_work\_temp\go-1.24.0-win32-x64.zip' -DestinationPath 'D:\Users\cloudwego\actions-runner\_work\_temp\dec3[8](https://github.com/cloudwego/hertz/actions/runs/13176018484/job/37212393077#step:3:9)1e9-659f-46f4-9fde-9b5862075237' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('D:\Users\cloudwego\actions-runner\_work\_temp\go-1.24.0-win32-x64.zip', 'D:\Users\cloudwego\actions-runner\_work\_temp\dec381e[9](https://github.com/cloudwego/hertz/actions/runs/13176018484/job/37212393077#step:3:10)-659f-46f4-9fde-9b5862075237', $true) }"
Successfully extracted go to D:\Users\cloudwego\actions-runner\_work\_temp\dec381e9-659f-46f4-9fde-9b5862075237
Adding to the cache ...
Successfully cached go to D:\Users\cloudwego\actions-runner\_work\_tool\go\1.24.0\x64
Added go to the path
Successfully set up Go version stable
go version go1.24.0 windows/amd64

@VinGarcia
Copy link

By the way, I almost forgot to answer, adding AGENT_ISSELFHOSTED=1 also fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants