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

Question: Could not connect to gRPC when using mysql80 docker image. #17346

Open
parikshitg opened this issue Dec 9, 2024 · 0 comments
Open

Comments

@parikshitg
Copy link

Question

I am trying to run a few queries inside vitess vitess/vttestserver:mysql80 docker container. I am getting a gRPC connector error like

W1209 12:47:39.001213   86415 component.go:39] [core] [Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "127.0.0.1:33575", ServerName: "127.0.0.1:33575", }. Err: connection error: desc = "error reading server preface: EOF"

But the same code is working fine with vitess/vttestserver:mysql57 docker image.
Here is my code:

vtgateconn.RegisterDialer("test_grpc", grpcvtgateconn.Dial(grpcDialOptions...))

	conn, err := vtgateconn.DialProtocol(context.Background(), "grpc", "localhost:33575")
	if err != nil {
		fmt.Printf("dial protocol err: %v", err)
		return
	}
	defer conn.Close()
	
session := conn.Session(target, &query.ExecuteOptions{
		IncludedFields: query.ExecuteOptions_ALL,
	})

	_, err = session.ExecuteBatch(context.Background(), []string{
		fmt.Sprintf(queryCreateTable, "mytable"),
		fmt.Sprintf(queryCreateVindex, "mytable"),
	}, nil)
	if err != nil {
		fmt.Println("session.execute err:", err)
		return
	}

Can any one please suggest, what could be the issue here?

@parikshitg parikshitg added Needs Triage This issue needs to be correctly labelled and triaged Type: Question labels Dec 9, 2024
@GuptaManan100 GuptaManan100 added Component: vttestserver and removed Needs Triage This issue needs to be correctly labelled and triaged labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants