setup-ocaml icon indicating copy to clipboard operation
setup-ocaml copied to clipboard

`Error: getCacheEntry failed: Cache service responded with 500`

Open MisterDA opened this issue 3 years ago • 6 comments

setup-ocaml is failing on my new projects with

Run ocaml/setup-ocaml@v2
  with:
    ocaml-compiler: 4.05.x
    opam-pin: true
    opam-depext: true
    opam-local-packages: *.opam
    opam-disable-sandboxing: false
    dune-cache: false
    cache-prefix: v1
    github-token: ***
Retrieve the opam cache
  Error: getCacheEntry failed: Cache service responded with 500

hopefully it's just a temporary failure.

MisterDA avatar Dec 12 '21 14:12 MisterDA

https://github.com/actions/cache/issues/698

arthurfiorette avatar Dec 12 '21 19:12 arthurfiorette

Posting here for visibility. This issue should now be mitigated. https://github.com/actions/cache/issues/698#issuecomment-992069658

dhadka avatar Dec 13 '21 03:12 dhadka

@dhadka I wonder if this should really be treated as error in the Action. I think you should just only warn or tell in the console about this kind of error. And it's probably not something that should be done on our side, but something that should be addressed on the actions package side.

smorimoto avatar Dec 13 '21 07:12 smorimoto

@smorimoto Yeah, the issue currently is that the cache NPM module and the cache action behave differently with error handling. The NPM module does not handle exceptions and will throw, it's up to the caller to catch and handle them. It's the cache action that is handling and suppressing those errors - https://github.com/actions/cache/blob/bd492913657217c4685db3a9cac721bca7d62caa/src/save.ts#L55.

On one hand, by throwing errors, the NPM module lets consumers decide how to handle errors. But it's also not documented in https://github.com/actions/toolkit/tree/main/packages/cache that callers can and should catch these errors. Maybe as a way to support both cases we have the NPM module handle these errors by default but provide a throwOnError: true argument?

dhadka avatar Dec 13 '21 15:12 dhadka

Fair enough. I think it's enough to just put something on the documentation.

smorimoto avatar Dec 30 '21 10:12 smorimoto

The problem here is that errors can also occur when pulling the cache. For now, I've improved the error handling on pushing the cache in #371, but the one on pulling will be a bit more complicated. (But it's not the cache package's responsibility.)

smorimoto avatar Dec 30 '21 11:12 smorimoto