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

Not able to create file writer with NewS3FileWriterWithClient() for minio source #69

Open
charleenklang opened this issue Sep 25, 2023 · 1 comment

Comments

@charleenklang
Copy link

Hello,
I am trying to create a file writer with minio source using NewS3FileWriterWithClient.

fileWriter, err := minio.NewS3FileWriterWithClient(
	context.Background(),
	minioClient,
	bucketName,
	objectName,
)

As minio client I am using the minio go client :

minioClient, err := origMinio.New("<minio-endpoint>", &origMinio.Options{
        Creds:  credentials.NewStaticV4("<access-key-id>", "<access-key>", ""),
        Secure: true,
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
		},
    })

I am using self signed certificates that is why I am using InsecureSkipVerify for my testing purposes right now.

For some reason NewS3FileWriterWithClient() does not return anything, neither an error nor anything else. Does anybody know what I could do?

Thanks for helping :)

mschneider82 added a commit to mschneider82/parquet-go-source that referenced this issue Jan 16, 2025
PutObject blocks until the reader is closed.
@ns-gzhang
Copy link

ns-gzhang commented Feb 25, 2025

I have the same problem even with no SSL for my local testing.

    fw, err := mins.NewS3FileWriterWithClient(ctx, minioClient, bucketName, objectName)

It hang and never returned...
And minioClient works fine with PutObject() on its own.

Any idea to fix? Thanks!

Edit: Oh, just saw the fix. and PR is not merged... Thx.

Edit 2: write was successful with the fix. but read failed:

        fr, err := mins.NewS3FileReaderWithClient(ctx, minioClient, bucketName, objectName)
	if err != nil {
		log.Println("Can't open file")
		return
	}
	pr, err := reader.NewParquetReader(fr, new(Student), 4)
	if err != nil {
		log.Println("Can't create parquet reader:", err)
		return
	}

this resulted in
025/02/25 11:05:28 Can't create parquet reader: Object is nil
I could read the file downloaded with minioClient.FGetObject(). Any idea to fix this? Thanks.

Edit 3: Seems not many people are using the minio source. I was able to make it work with s3v2 and redirect to the minio endpoint.

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