Open wagoodman opened 5 years ago
Is this the same issue?
dive 7a6163/gemirro
Fetching image... (this can take a while with large images)
Image not available locally. Trying to pull '7a6163/gemirro'...
Using default tag: latest
latest: Pulling from 7a6163/gemirro
df9b9388f04a: Pull complete
837e9cfc7e43: Pull complete
c7850f1a8c23: Pull complete
2f1b0fc20e43: Pull complete
f56d8c6ef3c8: Pull complete
0b54a7d44491: Pull complete
3342773e8061: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:0940d05f9b48ef25fa1aba244636d5b09642234b3c33baaa8703eedae5d6aaa5
Status: Downloaded newer image for 7a6163/gemirro:latest
docker.io/7a6163/gemirro:latest
Parsing image...
Analyzing image...
panic: (*logrus.Entry) (0xa1ea80,0xc000070300)
goroutine 1 [running]:
github.com/sirupsen/logrus.Entry.log(0xc0000a4240, 0xc000336150, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/wagoodman/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:216 +0x2ce
github.com/sirupsen/logrus.(*Entry).Panic(0xc000070240, 0xc0001d78f0, 0x1, 0x1)
/home/wagoodman/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:290 +0xce
github.com/sirupsen/logrus.(*Logger).Panic(0xc0000a4240, 0xc0001d78f0, 0x1, 0x1)
/home/wagoodman/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/logger.go:271 +0x73 github.com/sirupsen/logrus.Panic(...)
/home/wagoodman/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/exported.go:123
github.com/wagoodman/dive/image.newDockerImageConfig(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/wagoodman/github/dive/image/docker_image.go:45 +0x1de
github.com/wagoodman/dive/image.(*dockerImageAnalyzer).Analyze(0xc000229140, 0xc0000a2008, 0xc0001d7c08, 0x1)
/home/wagoodman/github/dive/image/docker_image.go:159 +0x15e
github.com/wagoodman/dive/runtime.Run(0x7ffc95b43d39, 0xe, 0x0, 0x0, 0xa2d453, 0x8, 0x0, 0x0, 0x0)
/home/wagoodman/github/dive/runtime/run.go:103 +0x54d
github.com/wagoodman/dive/cmd.doAnalyzeCmd(0xee4f60, 0xc00028de40, 0x1, 0x1)
/home/wagoodman/github/dive/cmd/analyze.go:35 +0x157
github.com/spf13/cobra.(*Command).execute(0xee4f60, 0xc000094030, 0x1, 0x1, 0xee4f60, 0xc000094030) /home/wagoodman/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xee4f60, 0x0, 0xee51c0, 0xc0001d7f68) /home/wagoodman/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2c0
github.com/spf13/cobra.(*Command).Execute(...)
/home/wagoodman/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
github.com/wagoodman/dive/cmd.Execute()
/home/wagoodman/github/dive/cmd/root.go:34 +0x32
main.main() /home/wagoodman/github/dive/main.go:38 +0xac
From @1138-4EB (https://github.com/wagoodman/dive/issues/233#issuecomment-555648922) Two different variants of this error:
The first one is because there is no tty and dive does require it (unless in CI mode). Hence, I would suggest to add a message/note when this error is handled and dive is being executed inside a container. I believe I have some golang function to detect this latter condition, but I don't know where is the error reported in the codebase. The message would suggest users to use -t (and -i?).
The second type of error might be trickier. Of course, dive should not crash, but exit gracefully. Apart from that, I don't think that any specific message can be shown. Requiring winpty is specific to some platforms/terminals, and there is no easy mechanism to identify the context from inside the container. A generic message may be added, tho.