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

ddev get drud/ddev-platformsh fails with panic #4579

Closed
1 task done
rfay opened this issue Jan 24, 2023 · 4 comments
Closed
1 task done

ddev get drud/ddev-platformsh fails with panic #4579

rfay opened this issue Jan 24, 2023 · 4 comments

Comments

@rfay
Copy link
Member

rfay commented Jan 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Run a Diagnostic and Paste Link Here

No response

Expected Behavior

ddev get drud/ddev-platformsh shouldn't panic

Actual Behavior

Panic.

Steps To Reproduce

$ ddev get drud/ddev-platformsh
Downloading https://api.github.com/repos/drud/ddev-platformsh/tarball/v0.6.4
v0.6.4_4272473176.tar.gz 99.83 KiB / 99.83 KiB [====================================] 100.00% 0s
panic: interface conversion: interface {} is bool, not string

goroutine 1 [running]:
github.com/drud/ddev/pkg/util.YamlToDict({0x102bf3680?, 0x140001f7560?})
	/Users/rfay/workspace/ddev/pkg/util/yamltools.go:33 +0x510
github.com/drud/ddev/pkg/util.YamlToDict({0x102bf3680?, 0x140001f74d0?})
	/Users/rfay/workspace/ddev/pkg/util/yamltools.go:38 +0x39c
github.com/drud/ddev/pkg/util.YamlToDict({0x102bf5420?, 0x140001f7260?})
	/Users/rfay/workspace/ddev/pkg/util/yamltools.go:58 +0x6d4
github.com/drud/ddev/pkg/util.YamlToDict({0x102bf5420?, 0x140001f71d0?})
	/Users/rfay/workspace/ddev/pkg/util/yamltools.go:60 +0x61c
github.com/drud/ddev/cmd/ddev/cmd.glob..func29(0x103035a00?, {0x140000ac900?, 0x1, 0x1})
	/Users/rfay/workspace/ddev/cmd/ddev/cmd/get.go:190 +0xe48
github.com/spf13/cobra.(*Command).execute(0x103035a00, {0x140000ac8d0, 0x1, 0x1})
	/Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:860 +0x4ac
github.com/spf13/cobra.(*Command).ExecuteC(0x103039100)
	/Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:974 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:902
github.com/drud/ddev/cmd/ddev/cmd.Execute()
	/Users/rfay/workspace/ddev/cmd/ddev/cmd/root.go:143 +0x40
main.main()
	/Users/rfay/workspace/ddev/cmd/ddev/main.go:20 +0xac

Anything else?

This happens when the following is in .platform.app.yaml:

    nodejs:
      # Install node version manager
      # See https://www.npmjs.com/package/n
      n: "*"
@rfay
Copy link
Member Author

rfay commented Jan 24, 2023

DDEV is trying to parse the line n: "*" and that fails; the single-character key comes out to be false, which can't be converted to a string. Just changing that to

    nodejs:
      nx: '*'

makes everything work fine.

I'm not sure whether this is a bug in the yaml parser or something DDEV's doing that's odd. A single-character key is unusual, but I don't see why it would fail.

@rfay
Copy link
Member Author

rfay commented Jan 24, 2023

@rfay
Copy link
Member Author

rfay commented Jan 24, 2023

Weirder still, I can use a: "*" or b: "*" or z: "*" without trouble.

@rfay
Copy link
Member Author

rfay commented Jan 26, 2023

Oh look at this, https://stackoverflow.com/a/44213322/215713 - "That n is the, pre-2009, canonical representation in YAML for the boolean "False" value." - which is what we see here.

@rfay rfay closed this as completed in 82a8153 Jan 27, 2023
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

1 participant