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

inspectContainer fails decoding #86

Open
paolino opened this issue Jan 6, 2022 · 2 comments
Open

inspectContainer fails decoding #86

paolino opened this issue Jan 6, 2022 · 2 comments

Comments

@paolino
Copy link

paolino commented Jan 6, 2022

hello
I get 2 errors inspecting containers

  • [WARN] DockerClientDecodeError "Error in $.Config.Cmd: parsing [] failed, expected Array, but encountered Null"
  • [WARN] DockerClientDecodeError "Error in $.Config: key \"StopSignal\" not found"
[a.pv@ansible 18:07:21 ~] docker version
Client: Docker Engine - Community
 Version:           20.10.11
 API version:       1.41
 Go version:        go1.16.9
 Git commit:        dea9396
 Built:             Thu Nov 18 00:38:53 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       847da18
  Built:            Thu Nov 18 00:37:17 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

where should I look to fix them? any hint very appreciated

@jprider63
Copy link
Collaborator

Hi @paolino. If you want to fix this, you probably need to modify the FromJSON instance for ContainerConfig to parse a null "Cmd" as []. For "StopSignal", I'm not sure what should be returned if the key isn't provided. Maybe SIGTERM since the API says that's the default.

Can you create a test case for the JSON response you're seeing?

@paolino
Copy link
Author

paolino commented Jan 7, 2022

Hi, I changed almost all [x] to a newtype to support 'null' encoding. It's quite an invasive change because it was detecting this all over the ContainerConfig encoding. I have 100 containers in production which slowly made me fix the [x] . But I haven't checked the API docs.
Sadly I messed up the indentation and hlint things so a PR is not ready.
Btw you can have a look here and if you think it's something useful I can try o port it back to the original style. In that case, I need to know which indenter should I use :-)

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

2 participants