cloudflare / serverless-registry

A container registry backed by Workers and R2.
Apache License 2.0
994 stars 35 forks source link

Error: Network connection lost. #69

Open pierre818181 opened 1 month ago

pierre818181 commented 1 month ago

I get this error once all the PATCH requests are done and the finishUpload is called. I can consistently reproduce this at the same stage during push.

Is this something to do with my Cloudflare plan?

Stack:

error error Error: Network connection lost.: undefined: Error: Network connection lost.
    at async R2Registry.finishUpload (index.js:6416:7)
    at async index.js:5246:22
    at async fetch (index.js:13:27)
    at async Object.fetch (index.js:13:27)
    at async Object.fetch (index.js:6482:19)

This is the object that is there when it errors:

obj {"storageClass":"Standard","range":{"offset":0,"length":6134971208},"customMetadata":{},"httpMetadata":{},"uploaded":"2024-10-21T21:43:08.398Z","checksums":{},"httpEtag":"\"3cc9dd57fa02f8e14c383472bfabc35a-62\"","etag":"3cc9dd57fa02f8e14c383472bfabc35a-62","size":6134971208,"version":"7e6d4efe355af1ee966e8cd0f43699e2","key":"7e97b421-1689-4691-83c0-aeef01faf2b4"}

Is it because the size is too big?

gabivlj commented 1 month ago

Hello! Thank you for the issue. I am curious to see how are you pushing layers? Docker push? Whats your container image like?

gabivlj commented 1 month ago

I found out the issue, the layer you are trying to push is more than 5gib, which goes against the R2 limits as we try to do a copy to change the path of the object. I will try to have some fix for this.

pierre818181 commented 1 month ago

Sure @gabivlj

pierre818181 commented 1 month ago

Hello! Thank you for the issue. I am curious to see how are you pushing layers? Docker push? Whats your container image like?

we are using the index.ts inside push folder to push

pierre818181 commented 1 week ago

@gabivlj any chance you have been able to look into this?

gabivlj commented 1 week ago

Hi @pierre818181, I looked into this, I think I know a possible solution, just haven't gotten to implementing yet! Sorry for the issue, will get to this when I get some time.