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

Permission for the home directory: panic: runtime error: invalid memory address or nil pointer dereference #8250

Closed
volker-schukai opened this issue Aug 12, 2024 · 3 comments
Labels
bug Something isn't working customer issue panic

Comments

@volker-schukai
Copy link

[dolt	] panic: runtime error: invalid memory address or nil pointer dereference
[dolt	] [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x23e62d8]
[dolt	] 
[dolt	] goroutine 1 [running]:
[dolt	] github.com/dolthub/dolt/go/libraries/doltcore/env.(*DoltCliConfig).GetStringOrDefault(...)
[dolt	] 	github.com/dolthub/dolt/go/libraries/doltcore/env/config.go:154
[dolt	] main.runMain()
[dolt	] 	github.com/dolthub/dolt/go/cmd/dolt/dolt.go:477 +0x20b8
[dolt	] main.main()
[dolt	] 	github.com/dolthub/dolt/go/cmd/dolt/dolt.go:247 +0x13

Version: 1.38.0
NIXOS: 24.05
dockerTools

I have been able to narrow down the problem to the following:

  • dolt is running as user x (docker container)
  • the home directory of x exists, but x has no rights to write or read in the home directory.
  • If I change the rights (x), it works.
  • in the other case, panic.

Of course, this could just be a correlation.

With the right environment, the error does not seem to occur, so it does not seem
to be a tragic bug, but a panic is never really good.

@fulghum fulghum added panic bug Something isn't working labels Aug 12, 2024
@fulghum
Copy link
Contributor

fulghum commented Aug 12, 2024

Thanks for taking the time to report this one @volker-schukai 🙏

I'm able to repro the issue by running sudo -u nobody dolt version. I think there are likely a few codepaths that could trigger this, so I'll explore a bit more and get a change out to turn this into a better error message.

@fulghum
Copy link
Contributor

fulghum commented Aug 13, 2024

We've released Dolt 1.42.11 with a fix for this issue.

The root cause here was that our code that validates the global configuration directory wasn't getting run early enough and some other code had been added before the validation and tried to use the global configuration. I moved up that validation/error-checking code and also added some news tests for global config directories without execute permission and without read/write permission.

Thanks for taking the time to let us know about this problem. Let us know if there's anything else we can do to help you build with Dolt!

@bpf120
Copy link

bpf120 commented Aug 19, 2024

@volker-schukai Thank you again for filing and using Dolt! We'd love to learn about what you are building. Feel free to email me or join our Discord if you want to share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working customer issue panic
Projects
None yet
Development

No branches or pull requests

4 participants