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

"Error: TypeError: Expected signal to be an instanceof AbortSignal" when retrieving cached files #687

Closed
tetchel opened this issue Jan 8, 2021 · 6 comments

Comments

@tetchel
Copy link

tetchel commented Jan 8, 2021

I've written an action which downloads a number of executables and caches them using @actions/cache:
https://github.com/redhat-actions/openshift-cli-installer/

Workflow here:
https://github.com/redhat-actions/openshift-cli-installer/runs/1670875424

Checking the cache for helm 3.1.3...
##[debug]Resolved Keys:
##[debug]["oci_helm_3.1.3_linux_amd64"]
##[debug]Checking zstd --version
##[debug]*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
##[debug]Resource Url: https://artifactcache.actions.githubusercontent.com/KuUXHpFvGOy0aS8vdXRfkYqXmiHMnxoJXt9OW4bxjm3HMLBzYK/_apis/artifactcache/cache?keys=oci_helm_3.1.3_linux_amd64&version=a3496a09f37d31c59c6f157823a74f6311019c9abfd35c16c1887b169b0251c2
::add-mask::***
##[debug]Cache Result:
##[debug]{"scope":"refs/heads/main","cacheKey":"oci_helm_3.1.3_linux_amd64","cacheVersion":"a3496a09f37d31c59c6f157823a74f6311019c9abfd35c16c1887b169b0251c2","creationTime":"2021-01-08T20:09:18.4133333Z","archiveLocation":"***"}
##[debug]Archive Path: /home/runner/work/_temp/64dbf1b1-3cdc-4600-983d-d237861f11ae/cache.tzst
##[debug]Use Azure SDK: true
##[debug]Download concurrency: 8
##[debug]Request timeout (ms): 30000
##[debug]Failed to delete archive: Error: ENOENT: no such file or directory, unlink '/home/runner/work/_temp/64dbf1b1-3cdc-4600-983d-d237861f11ae/cache.tzst'
Error: TypeError: Expected signal to be an instanceof AbortSignal

I get that same error when fetching any file from the cache.

edit: Edited to remove references to the large file because it is not the cause.

@tetchel tetchel changed the title Caching large file appears to corrupt the cache for all existing files "Error: TypeError: Expected signal to be an instanceof AbortSignal" when retrieving cached files. Jan 8, 2021
@tetchel tetchel changed the title "Error: TypeError: Expected signal to be an instanceof AbortSignal" when retrieving cached files. "Error: TypeError: Expected signal to be an instanceof AbortSignal" when retrieving cached files Jan 8, 2021
@tetchel
Copy link
Author

tetchel commented Jan 11, 2021

The issue was node-fetch/node-fetch#784 because I switched to webpack from ncc.

I fixed it with node-fetch/node-fetch#784 (comment)

@tetchel tetchel closed this as completed Jan 11, 2021
@rnett
Copy link

rnett commented Jun 4, 2021

I'm getting this as well, it would be nice to have an actual fix.

@tetchel
Copy link
Author

tetchel commented Jun 4, 2021

It is a problem with the webpack minimizer (terser plugin) stripping class names, and node-fetch depending on class names at runtime. it is not a problem with this library.

@rnett
Copy link

rnett commented Jun 4, 2021

Yeah, but as node-fetch doesn't seem like they are going to fix it (and I'm not familiar enough with JS to know whether it's even possible), a workaround here would be nice. Not sure whether that's possible, either.

@tetchel
Copy link
Author

tetchel commented Jun 4, 2021

unfortunately since node-fetch won't fix it you have to fix it in your bundler config.

if you're using ncc, you could probably not pass the -m/--minify flag and that may fix it at the expense of some bundle size.

@rnett
Copy link

rnett commented Jun 4, 2021

I'm using webpack, and the workarounds in that thread (the last one at least) work, it's just fragile.

diamondburned added a commit to diamondburned/cache-install that referenced this issue Dec 6, 2022
This could fix the AbortSignal error. I'm not sure. NodeJS is weird.
This shouldn't ever be an issue. What the fuck?

Relevant issues:

- actions/toolkit#687
- node-fetch/node-fetch#784
goto-bus-stop added a commit to goto-bus-stop/setup-zig that referenced this issue Jun 25, 2023
goto-bus-stop added a commit to goto-bus-stop/setup-zig that referenced this issue Jun 25, 2023
* Cache the zig compiler locally

* logging

* npm update

* verboser

* os.arch

* debug

* log signal

* address actions/toolkit#687

* correct path

* add a cache: false option

* share size

* zigpath

* path.join skull
goto-bus-stop added a commit to goto-bus-stop/setup-zig that referenced this issue Jun 25, 2023
* Cache the zig compiler locally

* logging

* npm update

* verboser

* os.arch

* debug

* log signal

* address actions/toolkit#687

* correct path

* add a cache: false option

* share size

* zigpath

* path.join skull
goto-bus-stop added a commit to goto-bus-stop/setup-zig that referenced this issue Jun 25, 2023
* deps: use esbuild

* deps: update tool-cache

* Fix tool-cache usage (#45)

* cache log

* log

* log

* use resolved ver for cache

* build

* log cache

* log

* use version as key

* deps

* loggggggg

* method name

* improve log

* ci: tweak versions

* include version for commit deps

* trailing

* mistake

* Use github cache (#53)

* Cache the zig compiler locally

* logging

* npm update

* verboser

* os.arch

* debug

* log signal

* address actions/toolkit#687

* correct path

* add a cache: false option

* share size

* zigpath

* path.join skull

* target node12

* changelog: add 1.4.0
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

2 participants