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

Panic when fuse fails to start #2013

Closed
enocom opened this issue Oct 31, 2023 · 0 comments · Fixed by #2205 or #2195
Closed

Panic when fuse fails to start #2013

enocom opened this issue Oct 31, 2023 · 0 comments · Fixed by #2205 or #2195
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@enocom
Copy link
Member

enocom commented Oct 31, 2023

When the fuse binary is missing, the user doesn't have read access, user_allow_other isn't set, etc., the Proxy will panic instead of reporting the error and exiting gracefully.

Stacktrace:

enocom@instance-1:~$ ./cloud-sql-proxy --fuse /cloudsql
2023/10/31 19:42:46 Authorizing with Application Default Credentials
2023/10/31 19:42:46 The proxy has started successfully and is ready for new connections!
/usr/bin/fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
2023/10/31 19:42:46 The proxy has encountered a terminal error: FUSE mount failed: "/cloudsql": fusermount exited with code 256
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xbc3052]

goroutine 1 [running]:
github.com/hanwen/go-fuse/v2/fuse.(*Server).Unmount(0x658bb9?)
        /workspace/GOPATH/pkg/mod/github.com/hanwen/go-fuse/[email protected]/fuse/server.go:128 +0x12
github.com/GoogleCloudPlatform/cloud-sql-proxy/v2/internal/proxy.(*Client).unmountFUSE(0x0?)
        /workspace/internal/proxy/proxy_other.go:183 +0x85
github.com/GoogleCloudPlatform/cloud-sql-proxy/v2/internal/proxy.(*Client).Close(0xc000564280)
        /workspace/internal/proxy/proxy.go:647 +0x5c
github.com/GoogleCloudPlatform/cloud-sql-proxy/v2/cmd.runSignalWrapper.func7()
        /workspace/cmd/root.go:821 +0x2d
github.com/GoogleCloudPlatform/cloud-sql-proxy/v2/cmd.runSignalWrapper(0xc000632780)
        /workspace/cmd/root.go:911 +0x160c
github.com/GoogleCloudPlatform/cloud-sql-proxy/v2/cmd.NewCommand.func3(0xc00057e300, {0xc000500fa0, 0x7, 0xf6388a})
        /workspace/cmd/root.go:361 +0x17
github.com/spf13/cobra.(*Command).execute(0xc00057e300, {0xc00003e250, 0x2, 0x2})
        /workspace/GOPATH/pkg/mod/github.com/spf13/[email protected]/command.go:940 +0x87c
github.com/spf13/cobra.(*Command).ExecuteC(0xc00057e300)
        /workspace/GOPATH/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
        /workspace/GOPATH/pkg/mod/github.com/spf13/[email protected]/command.go:992
github.com/GoogleCloudPlatform/cloud-sql-proxy/v2/cmd.Execute()
        /workspace/cmd/root.go:76 +0x25
main.main()
        /workspace/main.go:25 +0xf
@enocom enocom added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 31, 2023
enocom added a commit that referenced this issue Apr 25, 2024
If the fuse server fails to mount, the call to Close should not panic.
This commit ensures that no panic's happen if fuse isn't properly
configured.

Fixes #2013
enocom added a commit to GoogleCloudPlatform/alloydb-auth-proxy that referenced this issue Apr 25, 2024
If the FUSE mount has not succeeded due to misconfiguration, the Proxy
should still shutdown without panicing.

Related to GoogleCloudPlatform/cloud-sql-proxy#2013
enocom added a commit to GoogleCloudPlatform/alloydb-auth-proxy that referenced this issue Apr 25, 2024
If the FUSE mount has not succeeded due to misconfiguration, the Proxy
should still shutdown without panicing.

Related to GoogleCloudPlatform/cloud-sql-proxy#2013
enocom added a commit to GoogleCloudPlatform/alloydb-auth-proxy that referenced this issue Apr 25, 2024
If the FUSE mount has not succeeded due to misconfiguration, the Proxy
should still shutdown without panicing.

Related to GoogleCloudPlatform/cloud-sql-proxy#2013
enocom added a commit that referenced this issue Apr 26, 2024
If the fuse server fails to mount, the call to Close should not panic.
This commit ensures that no panic's happen if fuse isn't properly
configured.

Fixes #2013
enocom added a commit that referenced this issue Apr 26, 2024
If the fuse server fails to mount, the call to Close should not panic.
This commit ensures that no panic's happen if fuse isn't properly
configured.

Fixes #2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
1 participant