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

Some S3 compatible services does not have chunked upload properly implemented #21778

Open
stevefan1999-personal opened this issue Nov 11, 2022 · 0 comments · May be fixed by #21780
Open

Some S3 compatible services does not have chunked upload properly implemented #21778

stevefan1999-personal opened this issue Nov 11, 2022 · 0 comments · May be fixed by #21780
Labels
type/enhancement An improvement of existing functionality

Comments

@stevefan1999-personal
Copy link

stevefan1999-personal commented Nov 11, 2022

Oops seems like the template is totally disregarded, so I will just put in some ad-hoc info here.

Description

The title speaks itself. This is prominent in the case of OpenStack Swift, prior to 2.11.0, does not implement chunked upload properly and just let the data passthrough, causing a corruption in the object store side.

This issue can be remediated by testing for the compatibility of this specific feature by uploading a big chunk of zeroed data (whatever it is) and retrieving it and see if it is still all zeroes. Also remember it should be tested per defined storage type because not everyone might use the same S3 endpoint. This is just a one-off test from startup so I wouldn't say the API call would be very high.

Well..although the more obvious answer is that QNAP should move on from an ancient version of OpenShift Swift (they are using 1.11.0)

Environment

  • Gitea Version: 1.18.0-rc0

From your first screenshot it looks like QuObjects saved the chunked upload into the file without removing the chunk parts. Maybe you can configure something to allow chunked uploads? Otherwise I don't know if we can help you.

edit: Looks like you found the problem.

If you can compile Gitea you may try this (minio.go):

func (m *MinioStorage) Save(path string, r io.Reader, size int64) (int64, error) {
	uploadInfo, err := m.client.PutObject(
		m.ctx,
		m.bucket,
		m.buildMinioPath(path),
		r,
		size,
- 		minio.PutObjectOptions{ContentType: "application/octet-stream"},
+ 		minio.PutObjectOptions{ContentType: "application/octet-stream", DisableContentSha256: true},
	)
	if err != nil {
		return 0, convertMinioErr(err)
	}
	return uploadInfo.Size, nil
}

That may disable the signature for uploads.

https://github.com/minio/minio-go/blob/36e5116001d9e05dc27e8ecc790d261bd1632906/api.go#L841

Originally posted by @KN4CK3R in #21320 (comment)

@lunny lunny added the type/enhancement An improvement of existing functionality label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
2 participants