Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.92k stars 396 forks source link

Draft History panic #615

Closed radu-matei closed 6 years ago

radu-matei commented 6 years ago

Both on Windows and WSL I get the following:

On WSL:

radu:/mnt/c/Projects/go/src/github.com/Azure/draft/examples/example-go$ draft history
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x12436c6]

goroutine 1 [running]:
github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv.Time(...)
        /mnt/c/Projects/go/src/github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv/timeconv.go:40
github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv.Format(0x0, 0x1771564, 0x18, 0xc42045d980, 0xc42031a480)
        /mnt/c/Projects/go/src/github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv/timeconv.go:47 +0x26
github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv.String(0x0, 0x2, 0xc420881b98)
        /mnt/c/Projects/go/src/github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv/timeconv.go:57 +0x40
main.toBuildHistory(0xc4203bc400, 0x40, 0x40, 0xc420135840, 0xc42016ea60, 0xa)
        /mnt/c/Projects/go/src/github.com/Azure/draft/cmd/draft/history.go:132 +0x22c
main.(*historyCmd).run(0xc420245680, 0x0, 0x0)
        /mnt/c/Projects/go/src/github.com/Azure/draft/cmd/draft/history.go:67 +0x2d9
main.newHistoryCmd.func1(0xc420168fc0, 0x25a5c90, 0x0, 0x0, 0x0, 0x0)
        /mnt/c/Projects/go/src/github.com/Azure/draft/cmd/draft/history.go:36 +0x2a
github.com/Azure/draft/vendor/github.com/spf13/cobra.(*Command).execute(0xc420168fc0, 0x25a5c90, 0x0, 0x0, 0xc420168fc0, 0x25a5c90)
        /mnt/c/Projects/go/src/github.com/Azure/draft/vendor/github.com/spf13/cobra/command.go:698 +0x47a
github.com/Azure/draft/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4201e3680, 0xc42000e010, 0xc4201e3680, 0xc420765f70)
        /mnt/c/Projects/go/src/github.com/Azure/draft/vendor/github.com/spf13/cobra/command.go:783 +0x30e
github.com/Azure/draft/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4201e3680, 0x0, 0x0)
        /mnt/c/Projects/go/src/github.com/Azure/draft/vendor/github.com/spf13/cobra/command.go:736 +0x2b
main.main()
        /mnt/c/Projects/go/src/github.com/Azure/draft/cmd/draft/draft.go:177 +0x2d

On Windows:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x12779ad]

goroutine 1 [running]:
github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv.Time(...)
        C:/Projects/go/src/github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv/timeconv.go:40
github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv.Format(0x0, 0x17b892c, 0x18, 0xc0424ee980, 0xc042218000)
        C:/Projects/go/src/github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv/timeconv.go:47 +0x2d
github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv.String(0x0, 0x2, 0xc0428d3b78)
        C:/Projects/go/src/github.com/Azure/draft/vendor/k8s.io/helm/pkg/timeconv/timeconv.go:57 +0x47
main.toBuildHistory(0xc04275ac00, 0x40, 0x40, 0xc0421bf460, 0xc042483100, 0xa)
        C:/Projects/go/src/github.com/Azure/draft/cmd/draft/history.go:134 +0x2ca
main.(*historyCmd).run(0xc04238d630, 0x0, 0x0)
        C:/Projects/go/src/github.com/Azure/draft/cmd/draft/history.go:68 +0x2e0
main.newHistoryCmd.func1(0xc0421ee900, 0x23f1df8, 0x0, 0x0, 0x0, 0x0)
        C:/Projects/go/src/github.com/Azure/draft/cmd/draft/history.go:37 +0x31
github.com/Azure/draft/vendor/github.com/spf13/cobra.(*Command).execute(0xc0421ee900, 0x23f1df8, 0x0, 0x0, 0xc0421ee900, 0x23f1df8)
        C:/Projects/go/src/github.com/Azure/draft/vendor/github.com/spf13/cobra/command.go:698 +0x481
github.com/Azure/draft/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0422698c0, 0xc04206a000, 0xc0422698c0, 0xc0425b3f70)
        C:/Projects/go/src/github.com/Azure/draft/vendor/github.com/spf13/cobra/command.go:783 +0x315
github.com/Azure/draft/vendor/github.com/spf13/cobra.(*Command).Execute(0xc0422698c0, 0x0, 0x0)
        C:/Projects/go/src/github.com/Azure/draft/vendor/github.com/spf13/cobra/command.go:736 +0x32
main.main()
        C:/Projects/go/src/github.com/Azure/draft/cmd/draft/draft.go:177 +0x34

Haven't had a chance to try on macOS, once I try I will come back with an update here.

fibonacci1729 commented 6 years ago

@radu-matei any luck confirming or denying this results from a stale cluster?

radu-matei commented 6 years ago

Deleted the existing config maps and now it works!

Thanks!