-
Notifications
You must be signed in to change notification settings - Fork 771
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: runtime error: invalid memory address or nil pointer dereference #892
Comments
Okay, that is so odd that you're getting my folder...
Can you post the full command you're using? |
ran from the directory containing the docker-compose.yml file i tried converting.... "my"-MacBook-Pro:azure$ kompose convert goroutine 1 [running]: |
@pkelleratwork Ah, that's better! Are you able to post the docker-compose.yaml file that you are using? |
sorry - cant post it here.... |
its pretty standard, nothing wild. front end, back end, proxy in it. |
One thing to check if if you've got any blank environment variables within it. That may be one of the reasons. For example, if you have: env:
- MYSECRETPASS and |
confirmed no blank env variables. there are foo=${bar} using a .env file to populate, but nothing blank echo $MYSECRETPASS is also blank |
Without the |
here you go... verified I get the same error with this "fake" on.. |
I found the same issue, here is a minimal working version: '3'
services:
segfault-central:
image: alpine
deploy:
resources:
limits:
cpus: '0.01'
memory: 256M
reservations:
cpus: '0.01'
memory: 128M |
Hey @Code0x58 I was unable to replicate the issue with either your above docker-compose.yaml file or the modified one with limits / reservations removed.
|
Hey @pkelleratwork so it looks like it's an issue with the Changing to |
thanks @cdrage - I'll give it a shot! |
I found out where it's happening, https://github.com/kubernetes/kompose/blob/master/pkg/loader/compose/v3.go#L322 Now it's time to debug and see how to fix it. Looks like it happens if there is a blank variable somewhere within the implementation. |
@cdrage - changed version to "2", it worked :) -MacBook-Pro:kompose $ kompose convert |
Hey @cdrage, the file you pasted had both of them removed, with one of them removed it blows up for me: version: '3'
services:
segfault-central:
image: alpine
deploy:
resources:
limits:
cpus: '0.01'
memory: 256M |
I just got hit with the same issue (and fix) as @Code0x58 mentioned on #892 (comment). v1.6.0 (e4adfef), macOs 10.13.1 (17B1003) With a simple service:
These work:
These don't work:
An error, but not a SIGSEGV for this:
|
For the resources case that myself and @gak encountered, I believe the issue is caused by these two lines. @pkelleratwork @cdrage after some cutting down it appears that the minimum way to reproduce the error is:
Similarly, stripping out all of the listed (rather than mapped) environment variables which didn't have a A quick look made me think the issue is around here but I am not sure; I think there is enough for someone to look into. This is a bug rather than a rough edge from exceptional use, as this is supported by |
close by #926 |
Thanks @cdrage , it help me a lot! |
version 1.6.0 (e4adfef)
macOS 10.13.2
kompose convert =
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x221af2b]
goroutine 1 [running]:
github.com/kubernetes/kompose/pkg/loader/compose.dockerComposeToKomposeMapping(0xc4205dc6c0, 0x20, 0xc42045d820, 0x1, 0x1, 0xc4200d35f0)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/pkg/loader/compose/v3.go:323 +0x45b
github.com/kubernetes/kompose/pkg/loader/compose.parseV3(0xc4203686f0, 0x1, 0x1, 0x1, 0x1, 0x0, 0x30, 0x27e2280)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/pkg/loader/compose/v3.go:113 +0x22b
github.com/kubernetes/kompose/pkg/loader/compose.(*Compose).LoadFile(0x370a980, 0xc4203686f0, 0x1, 0x1, 0xc4200d3080, 0x0, 0x0, 0x9, 0x7)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/pkg/loader/compose/compose.go:186 +0x4d2
github.com/kubernetes/kompose/pkg/app.Convert(0x100000100, 0x0, 0x0, 0x0, 0x0, 0x28a1b28, 0x4, 0x0, 0x28b5b4d, 0x15, ...)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/pkg/app/app.go:227 +0x145
github.com/kubernetes/kompose/cmd.glob..func3(0x36d8660, 0x370a980, 0x0, 0x0)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/cmd/convert.go:95 +0x4d
github.com/kubernetes/kompose/vendor/github.com/spf13/cobra.(*Command).execute(0x36d8660, 0x370a980, 0x0, 0x0, 0x36d8660, 0x370a980)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/vendor/github.com/spf13/cobra/command.go:704 +0x2c6
github.com/kubernetes/kompose/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x36d8aa0, 0x36d8ee0, 0x2499880, 0x36d8be0)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/vendor/github.com/spf13/cobra/command.go:785 +0x30e
github.com/kubernetes/kompose/vendor/github.com/spf13/cobra.(*Command).Execute(0x36d8aa0, 0x0, 0xc420315f48)
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/vendor/github.com/spf13/cobra/command.go:738 +0x2b
github.com/kubernetes/kompose/cmd.Execute()
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/cmd/root.go:92 +0x31
main.main()
/home/wikus/dropbox/dev/go/src/github.com/kubernetes/kompose/main.go:22 +0x20
The text was updated successfully, but these errors were encountered: