Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multipart upload error on GCS #4794

Closed
everpcpc opened this issue Jun 24, 2024 · 8 comments
Closed

Multipart upload error on GCS #4794

everpcpc opened this issue Jun 24, 2024 · 8 comments

Comments

@everpcpc
Copy link
Contributor

Save gcs cache failed: Error: Unexpected (permanent) at Writer::write, context: { uri: https://storage.googleapis.com/upload/storage/v1/b/xxx/o?uploadType=resumable&name=cloud/cache/Linux/go/xxx/xxx/cache.tzst&upload_id=ACJd0No-AuMDWKM0kCVnjavxxx686_MltwDqow-J_vbVrZ0mfhyxxxokY0Oql7cjS4yWlqs4CD-_HjTPmasgjbHcZ, response: Parts { status: 400, version: HTTP/1.1, headers: {"content-type": "text/plain; charset=utf-8", "content-length": "261", "date": "Mon, 24 Jun 2024 02:55:25 GMT", "server": "UploadServer"} }, service: gcs, path: Linux/go/xxx/xxx/cache.tzst, write_buf: 65536 } => Invalid request. The number of bytes uploaded is required to be equal or greater than 262144, except for the final request (it's recommended to be the exact multiple of 262144). The received request contained 65536 bytes, which does not meet this requirement.

code:

const op = new Operator(provider, { endpoint, bucket, root });
const rs = fs.createReadStream(archivePath);
const w = await op.writer(object);
const ws = w.createWriteStream();
await pipeline(rs, ws);
await finished(rs);
@Xuanwo
Copy link
Member

Xuanwo commented Jun 24, 2024

Hi, which version are you using? The latest version will set correct chunk for every storage service.

@everpcpc
Copy link
Contributor Author

@everpcpc
Copy link
Contributor Author

https://www.npmjs.com/search?q=%40opendal
It seems like @opendal/lib-darwin-x64 release failed

@Xuanwo
Copy link
Member

Xuanwo commented Jun 24, 2024

https://www.npmjs.com/search?q=%40opendal

It seems like @opendal/lib-darwin-x64 release failed

Yes, it did fail. Let's address it.

According to this issue, services like gcs require to align with specific size to upload successfully. Users either need to set chunk or meet the requirements by hand.

AFAIK, nodejs doesn't support setting chunk in 0.45.1, so we have to add a buffer for this writer.

@Xuanwo
Copy link
Member

Xuanwo commented Jun 24, 2024

Yes, it did fail. Let's address it.

Should be fixed in #4798

It's related to our CI env changes...

@Xuanwo
Copy link
Member

Xuanwo commented Jul 1, 2024

Hi, @everpcpc, this should be address in next release.

@Xuanwo
Copy link
Member

Xuanwo commented Jul 3, 2024

Sorry, nodejs release failed: https://github.com/apache/opendal/actions/runs/9771241606/job/26973848658

I will get it fixed and start a new release now.

@Xuanwo
Copy link
Member

Xuanwo commented Jul 7, 2024

Hi, @everpcpc, this issue should have been fixed. Please give it a try. Welcome to report new issues if it still exists.

image

@Xuanwo Xuanwo closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants