e2e icon indicating copy to clipboard operation
e2e copied to clipboard

Minio is not ready even after `StartAndWaitReady` completes

Open matej-g opened this issue 4 years ago • 2 comments
trafficstars

Issue description

Trying to start Minio on the latest version of main, the server is not ready to handle requests, despite StartAndWaitReady being ran successfully already. Any immediate requests afterwards result in error response Server not initialized, please try again.

I suspect this could be an issue with the readiness probe upstream, since when setting up the same scenario with code version from before Minio image update in https://github.com/efficientgo/e2e/pull/4, everything is working correctly. However, I haven't confirmed the exact cause yet.

Minimal setup to reproduce

Run this test:

import (
	"context"
	"io/ioutil"
	"testing"

	"github.com/efficientgo/e2e"
        e2edb "github.com/efficientgo/e2e/db"
	"github.com/efficientgo/tools/core/pkg/testutil"
	"github.com/minio/minio-go/v7"
	"github.com/minio/minio-go/v7/pkg/credentials"
)

func TestMinio(t *testing.T) {
	e, err := e2e.NewDockerEnvironment("minio_test", e2e.WithVerbose())
	testutil.Ok(t, err)
	t.Cleanup(e.Close)

	const bucket = "minoiotest"
	m := e2edb.NewMinio(e, "minio", bucket)
	testutil.Ok(t, e2e.StartAndWaitReady(m))

	mc, err := minio.New(m.Endpoint("http"), &minio.Options{
		Creds: credentials.NewStaticV4(e2edb.MinioAccessKey, e2edb.MinioSecretKey, ""),
	})
	testutil.Ok(t, err)
	testutil.Ok(t, ioutil.WriteFile("test.txt", []byte("just a test"), 0755))

	_, err = mc.FPutObject(context.Background(), bucket, "obj", "./test.txt", minio.PutObjectOptions{})
	testutil.Ok(t, err)
}

matej-g avatar Aug 27 '21 09:08 matej-g

Yes, I seen that, let's fix it. 👍🏽

bwplotka avatar Aug 28 '21 16:08 bwplotka

Waiting until we can get buckets would do the work potentially. Issue on it's buggy readiness endpoint would be helpful too

bwplotka avatar Aug 28 '21 16:08 bwplotka

After all this time, it seems like the fix I applied to thanos-io/thanos#5615 worked well. I think we can now bring it upstream (here) and follow up with some cleanup in Thanos. 🤘

douglascamata avatar Oct 25 '22 17:10 douglascamata