ducktors / turborepo-remote-cache

Open source implementation of the Turborepo custom remote cache server.
https://ducktors.github.io/turborepo-remote-cache/
MIT License
974 stars 92 forks source link

Error making HTTP request: HTTP status server error (501 Not Implemented) #402

Open bitttttten opened 1 month ago

bitttttten commented 1 month ago

🐛 Bug Report

We upgraded our monorepo to turbo@2.0.6, and after building we are seeing these errors on Vercel:

WARNING  failed to contact remote cache: Error making HTTP request: HTTP status server error (501 Not Implemented) for url https://our-remote-cache.s3.amazonaws.com/team_xxxxx/yyyyyyy?AWSAccessKeyId=xxxxxxxxxxxxxx&Content-Type=application%2Foctet-stream&Expires=xxxxx&Signature=xxxxxx&X-Amzn-Trace-Id=xxxxxx&x-amz-security-token=xxxx&teamId=xxxxxx&slug=xxxxx)

We are using the AWS Lambda + S3 setup as described https://ducktors.github.io/turborepo-remote-cache/running-in-lambda.

Are there any other steps we need to do? As I can't seem to find any info in the docs although perhaps I have missed something.

Your Environment

haseakito commented 1 month ago

I got the same error in my project as well. I got the following error in Google Cloud Platform.

failed to contact remote cache: Error making HTTP request: HTTP status client error (412 Precondition Failed)

We're using turbo@2.0.6 for our project.

fox1t commented 1 month ago

OK we need to check the support for version 2. There must be a new call (OPTIONS?) that checks with the server before calling it.

@matteovivona are we able to reproduce this internally?

fox1t commented 1 month ago

@bitttttten, can you please check if the cache is still working? Since it is a warning, it might be a non-blocking step.

matteovivona commented 1 month ago

OK we need to check the support for version 2. There must be a new call (OPTIONS?) that checks with the server before calling it.

@matteovivona are we able to reproduce this internally?

no. we cannot reproduce it and we are on turbo 2.0.7. it could be something on the lambda

matteovivona commented 1 month ago

Closing because it's a sort of duplicate of this https://github.com/ducktors/turborepo-remote-cache/issues/323

bitttttten commented 1 month ago

@matteovivona the cache doesn't not work no, we get cache misses on all our tasks. i will dig into the s3 bucket to see if the files are there, although i will have to do that later today.

btw i don't know if it is a duplicate because in that thread the error is a 4xx and here's its a 5xx so my instinct is that it's a different error as the response code is different

bitttttten commented 1 month ago

the additional comment and other issue you linked is a 412 error, my error is a 501

fox1t commented 1 month ago

Reopening this because we want to be sure it is a duplicate before closing.

relsunkaev commented 2 weeks ago

Similar issue. When redirecting turbo to an s3 pre-signed url, turbo would include the authorization header. s3 would throw this error because it was detecting multiple authorization methods.