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

Segmentation violation when running ddev list with invalid entry in global_config.yaml #2483

Closed
mtelgkamp opened this issue Sep 1, 2020 · 1 comment

Comments

@mtelgkamp
Copy link
Contributor

Describe the bug
I somehow had an invalid entry in the global_config.yaml similar to this one:

project_info:
  Test:
    approot: ""

Running ddev list in my home directory caused a panic:

$ ddev list
unable to create project at project root : ddev config is not useful in your home directory (/home/XXX)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x9e9af9]

goroutine 1 [running]:
github.com/drud/ddev/pkg/ddevapp.GetProjects(0xbfcb9659b19b2800, 0x2190f1c, 0x11952a0, 0xc89a3d, 0x9, 0xcdc178)
	/workdir/pkg/ddevapp/utils.go:355 +0x619
github.com/drud/ddev/pkg/ddevapp.List(0x0, 0x1)
	/workdir/pkg/ddevapp/ddevapp.go:123 +0xa5
github.com/drud/ddev/cmd/ddev/cmd.glob..func26(0x1188cc0, 0x11c6870, 0x0, 0x0)
	/workdir/cmd/ddev/cmd/list.go:26 +0x45
github.com/spf13/cobra.(*Command).execute(0x1188cc0, 0x11c6870, 0x0, 0x0, 0x1188cc0, 0x11c6870)
	/workdir/vendor/github.com/spf13/cobra/command.go:846 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x1189f20, 0x5f4de1e6, 0x319a241d, 0xc22ad2c278)
	/workdir/vendor/github.com/spf13/cobra/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/workdir/vendor/github.com/spf13/cobra/command.go:887
github.com/drud/ddev/cmd/ddev/cmd.Execute()
	/workdir/cmd/ddev/cmd/root.go:153 +0x3c
main.main()
	/workdir/cmd/ddev/main.go:21 +0xf4

To Reproduce

  1. Create an (additional) project entry with an empty approot in the global_config.yaml
  2. Start Terminal in home directory
  3. Run ddev list
  4. See error

Expected behavior
The list of all projects should be shown (and ddev config should not be called).

Additionally it might be good to notify the user on the invalid entry and give an option to delete it or just delete the entry and notify the user that it was deleted?

I did not add this entry manually, so it is possible that this entry is generated by ddev also this should be prevented.

Version and configuration information (please complete the following information):

  • Host computer OS and Version: Ubuntu 20.04.1
  • DDEV-Local version v1.16.0-alpha2

Additional context
Trying to delete the entry with ddev stop --unlist Test does not work (also causes a segmentation violation).

@rfay
Copy link
Member

rfay commented Sep 1, 2020

Thanks for this report - with this good detail it ought to be solvable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants