ducktors / turborepo-remote-cache

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

Nothing added to S3 bucket #396

Closed thekevinbrown closed 2 days ago

thekevinbrown commented 2 days ago

🐛 Bug Report

I have configured the server on Lambda with S3 as per https://ducktors.github.io/turborepo-remote-cache/running-in-lambda.html. I configured .turbo/config.json as per the docs as well. Nothing is ever stored in the s3 bucket, and the logs don't seem to indicate any errors other than 404s. I'm not sure what to do to debug this.

To Reproduce

Deploy in Lambda following the docs

Expected Behaviour

I expected build artifacts to land in S3, or for errors to be logged.

Actual Behaviour

Logs show no function errors that would indicate there's an issue. 404s are returned. I don't see where turbo is uploading the artifacts.


timestamp message
1719898363385 INIT_START Runtime Version: nodejs:18.v30 Runtime Version ARN: arn:aws:lambda:ap-southeast-2::runtime:4403fb92bc1d064cfa93d3f1e30261509399c739d52b0aec344c3d13847b635e
1719898364655 START RequestId: f1e36934-219a-48af-b523-f75feb2ce0d3 Version: $LATEST
1719898364852 {"severity":"INFO","level":30,"time":1719898364850,"pid":8,"hostname":"169.254.99.189","reqId":"33zoVnyOQGOO320h_TNBzg-0","req":{"method":"POST","url":"//v8/artifacts/events?slug=exogee","hostname":"24ebnxsqo5isjteph2igqmhk6m0npwoa.lambda-url.ap-southeast-2.on.aws","remoteAddress":"103.106.231.21"},"message":"incoming request"}
1719898364856 {"severity":"INFO","level":30,"time":1719898364855,"pid":8,"hostname":"169.254.99.189","reqId":"33zoVnyOQGOO320h_TNBzg-0","message":"Route POST://v8/artifacts/events?slug=exogee not found"}
1719898364861 {"severity":"INFO","level":30,"time":1719898364861,"pid":8,"hostname":"169.254.99.189","reqId":"33zoVnyOQGOO320h_TNBzg-0","res":{"statusCode":404},"responseTime":9.234183000022313,"message":"request completed"}
1719898364871 END RequestId: f1e36934-219a-48af-b523-f75feb2ce0d3
1719898364871 REPORT RequestId: f1e36934-219a-48af-b523-f75feb2ce0d3 Duration: 215.71 ms Billed Duration: 216 ms Memory Size: 1024 MB Max Memory Used: 198 MB Init Duration: 1269.23 ms

I'm not certain this is a bug in turborepo-remote-cache yet, but I am unsure how to debug what's going on here.

Your Environment

thekevinbrown commented 2 days ago

I found logs for some PUT requests, and it looks like Turbo is using routes that this doesn't create?

{"severity":"INFO","level":30,"time":1719896889256,"pid":8,"hostname":"169.254.107.141","reqId":"J4tZq9GIQxOfXJv0YJ6OXw-4","req":{"method":"PUT","url":"//v8/artifacts/d364b6d612272232?slug=exogee","hostname":"24ebnxsqo5isjteph2igqmhk6m0npwoa.lambda-url.ap-southeast-2.on.aws","remoteAddress":"103.106.231.21"},"message":"incoming request"},
{"severity":"INFO","level":30,"time":1719896889273,"pid":8,"hostname":"169.254.107.141","reqId":"J4tZq9GIQxOfXJv0YJ6OXw-4","message":"Route PUT://v8/artifacts/d364b6d612272232?slug=exogee not found"},
{"severity":"INFO","level":30,"time":1719896889274,"pid":8,"hostname":"169.254.107.141","reqId":"J4tZq9GIQxOfXJv0YJ6OXw-4","res":{"statusCode":404},"responseTime":17.527318999986164,"message":"request completed"}

Does the server currently create a /v8/ route?

Edit: I see in the tests that it should, why is this a 404?

thekevinbrown commented 2 days ago

Looks like it was the extra slash, e.g. I had this in my .turbo/config.json

{
    "apiurl": "https://24ebnxsqo5isjteph2igqmhk6m0npwoa.lambda-url.ap-southeast-2.on.aws/"
}

Switching it to:

{
    "apiurl": "https://24ebnxsqo5isjteph2igqmhk6m0npwoa.lambda-url.ap-southeast-2.on.aws"
}

Fixed it.