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: Handle numeric 3rd party service use of HTTP_EXPOSE or HTTPS_EXPOSE, fixes #2266 #2252

Merged
merged 1 commit into from May 21, 2020

Conversation

rfay
Copy link
Member

@rfay rfay commented May 13, 2020

The Problem/Issue/Bug:

It is possible to use a numeric value for HTTP_EXPOSE or HTTPS_EXPOSE environment variables in a 3rd-party service.

The code assumes that it will be a string, and crashes with

panic: interface conversion: interface {} is int, not string
goroutine 1 [running]:
github.com/drud/ddev/pkg/ddevapp.(*DdevApp).Describe(0xc00013adc0, 0xc0001c86c0, 0x8, 0x8)
        /workdir/pkg/ddevapp/ddevapp.go:270 +0x31a4
github.com/drud/ddev/cmd/ddev/cmd.glob..func25(0x219d1c0, 0x21d7d90, 0x0, 0x0)
        /workdir/cmd/ddev/cmd/list.go:41 +0x268
github.com/spf13/cobra.(*Command).execute(0x219d1c0, 0x21d7d90, 0x0, 0x0, 0x219d1c0, 0x21d7d90)
        /workdir/vendor/github.com/spf13/cobra/command.go:830 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0x219e340, 0x0, 0x0, 0x0)
        /workdir/vendor/github.com/spf13/cobra/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
        /workdir/vendor/github.com/spf13/cobra/command.go:864
github.com/drud/ddev/cmd/ddev/cmd.Execute()
        /workdir/cmd/ddev/cmd/root.go:140 +0x3c
main.main()
        /workdir/cmd/ddev/main.go:8 +0x20

This was reported in TYPO3 slack by Elias Häußler, thanks!, https://typo3.slack.com/archives/C8TRNQ601/p1589356915138500

The docker-compose.selenium.yaml that caused this problem is posted at https://gist.github.com/eliashaeussler/df4d277a6c390094436ce2e34783fc3f

How this PR Solves The Problem:

Make sure the environment variable value is a string before using it.

Manual Testing Instructions:

Workaround for affected users

Just change the affected HTTP_EXPOSE line to

- HTTP_EXPOSE=4444

for example, instead of - HTTP_EXPOSE: 4444

Automated Testing Overview:

Related Issue Link(s):

Release/Deployment notes:

@rfay rfay force-pushed the 20200513_handle_numeric_env_val branch from f4c1bd4 to 70a2fb6 Compare May 14, 2020 00:16
@rfay rfay force-pushed the 20200513_handle_numeric_env_val branch from 70a2fb6 to 16a6d36 Compare May 15, 2020 23:34
@rfay rfay changed the title Panic: Handle numeric 3rd party service use of HTTP_EXPOSE or HTTPS_EXPOSE Panic: Handle numeric 3rd party service use of HTTP_EXPOSE or HTTPS_EXPOSE, fixes #2266 May 19, 2020
@rfay rfay merged commit 6f3f0fc into ddev:master May 21, 2020
@rfay rfay deleted the 20200513_handle_numeric_env_val branch May 21, 2020 21:43
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

Successfully merging this pull request may close these issues.

additional service breaks ddev describe with "panic: interface conversion: interface {} is int, not string"
1 participant