ThibautMarechal / turborepo-remote-cache

MIT License
27 stars 5 forks source link

occasional "413 Payload Too Large" #514

Open macrozone opened 2 months ago

macrozone commented 2 months ago

Describe the bug

Sometimes locally or on the ci/cd, there is a warning "413 Payload Too Large":

WARNING failed to contact remote cache: Error making HTTP request: HTTP status client error (413 Payload Too Large) for url (https://example.com/turbo/api/v8/artifacts/xxxxx?teamId=xxxx)

This will prevent some builds from beeing cached.

To Reproduce

the turbo cache is hosted on cloud-run, which has unlimited request size, unless http-1 is used (no limit on http2). I assume the client and cache are using http2.

So not sure where the limit is set. Typically its somewhere set on the body-parsers.

Expected behavior

No warning is shown, all artifacts are cached regardless of size

macrozone commented 2 months ago

i currently assume the problem is with turbo repo not using http2 on the client

macrozone commented 2 months ago

ok i have a solution, its not turbo, its when you host it on cloud run.

i managed to add native http2 support to this repo here. I will update my findings with an MR

macrozone commented 2 months ago

opened a merge request https://github.com/ThibautMarechal/turborepo-remote-cache/pull/515