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

unable to connect unix abstract socket #4835

Closed
iwctwbai opened this issue Oct 1, 2021 · 4 comments
Closed

unable to connect unix abstract socket #4835

iwctwbai opened this issue Oct 1, 2021 · 4 comments
Assignees

Comments

@iwctwbai
Copy link

iwctwbai commented Oct 1, 2021

NOTE: if you are reporting is a potential security vulnerability or a crash,
please follow our CVE process at
https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md instead of
filing an issue here.

Please see the FAQ in our main README.md, then answer the questions below
before submitting your issue.

What version of gRPC are you using?

1.41.0

What version of Go are you using (go version)?

1.41.0

What operating system (Linux, Windows, …) and version?

Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-77-generic x86_64)

What did you do?

If possible, provide a recipe for reproducing the error.
python

server.add_insecure_port("unix-abstract:abstract_unix_socket_test")

golang

        // rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix \x00abstract_unix_socket_test: connect: connection refused"
	// unless you use unix:@abstract_unix_socket_test
	conn, err := grpc.Dial("unix-abstract:abstract_unix_socket_test", grpc.WithInsecure())  
	if err != nil {
		panic(err)
	}
	defer func(conn *grpc.ClientConn) {
		err := conn.Close()
		if err != nil {
			panic(err)
		}
	}(conn)
	c := service.NewTestClient(conn)
        _, err := c.Work(...})
	if err != nil {
		panic(err)
	}
@easwars easwars self-assigned this Oct 4, 2021
@easwars
Copy link
Contributor

easwars commented Oct 5, 2021

This could be an interop issue between the Python server and the Go client.

I have an example here with a Go server and a Go client, and it seems to work just fine: #4848.

Also, could you enable logging on the Go client to let us know what you see. Thanks.

@iwctwbai
Copy link
Author

iwctwbai commented Oct 5, 2021

let's ignore Python

server code

	netw, addr := "unix", "\x00"+"abstract_unix_socket_test_1"
	lis, err := net.Listen(netw, addr)
	if err != nil {
		panic(err)
	}

is ok

	unixServer, err := net.ResolveUnixAddr("unix", "@abstract_unix_socket_test_1")
	if err != nil {
		panic(err)
	}
	
	lis, err := net.ListenUnix("unix", unixServer)
	if err != nil {
		panic(err)
	}

an error occurred

in fact,run netstat -ax | grep abstract

@easwars

you will notice that the above two methods have different paths

but shouldn't they be equivalent

@easwars
Copy link
Contributor

easwars commented Oct 7, 2021

@iwctwbai What you are describing seems to be a generic Go issue, not something specific to gRPC.

@iwctwbai
Copy link
Author

iwctwbai commented Oct 7, 2021

yse i will put forward this question to golang team when I have time

@iwctwbai iwctwbai closed this as completed Oct 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants