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

ContainerStats no longer works with 5.0.1 #449

Open
rwmajor2 opened this issue Mar 30, 2022 · 3 comments
Open

ContainerStats no longer works with 5.0.1 #449

rwmajor2 opened this issue Mar 30, 2022 · 3 comments

Comments

@rwmajor2
Copy link

Is this a BUG REPORT or FEATURE REQUEST?:

Description

I am using this client in our own workflows. Recently, we started getting this error on Windows (but not on Linux):

Error
Failed to retrieve Container statistics from Container ID '8676942cf3ac4f06b7ff34d7bbefb171'. Request error: GET npipe://localhost:80/containers/2fe41ffc821f49e5552d8325aa9ba02a2b65ad6032e613b9ece47d126f8d2b37/stats?stream=0: 200

We have been using 5.0.1 for some time now and not sure what has changed. Has the Docker Engine API on Windows changed for container stats?

How to reproduce

[Add steps on how to reproduce this issue]

What do you expect

[Describe what do you expect to happen]

What happened instead

[Describe the actual results]

Software:

  • docker version: [Add the output of docker version here, both client and server]
  • Spotify's docker-client version: [Add docker-client version here]

Full backtrace

[Paste full backtrace here]
@rwmajor2
Copy link
Author

More details if I am debugging correctly:
javax.ws.rs.client.ResponseProcessingException: com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance oforg.mandas.docker.client.messages.ImmutableMemoryStats$Stats$Builder, problem: Cannot build Stats, some of required attributes are not set [totalActiveFile, totalInactiveFile, cache, totalCache, totalActiveAnon, totalInactiveAnon, hierarchicalMemoryLimit, mappedFile, totalMappedFile, totalPgmajfault, pgpgin, totalPgpgin, pgpgout, totalPgpgout, totalPgfault, rss, totalRss, rssHuge, totalRssHuge, totalUnevictable] at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 1645] (through reference chain: org.mandas.docker.client.messages.ImmutableContainerStats$Builder["memory_stats"]->org.mandas.docker.client.messages.ImmutableMemoryStats$Builder["stats"])

@dmandalidis
Copy link
Owner

Hi @rwmajor2,

(sorry for not coming back into this sooner)

I 'm afraid the information you provide is not very helpful. As a side note, getting the container stats has a unit test associated with it and I don't remember it failing during the past months.

To be more precise and in order to help you I would need answers to the following questions:

  • Was it working before? if yes, what has changed? Did you upgrade Docker on windows?
  • Does it work if using docker-client latest version?
  • Try to curl and post back the response you 're getting

Cheers,
Dimitris

@rwmajor2
Copy link
Author

rwmajor2 commented May 5, 2022

Hi @dmandalidis after digging into this more, the root cause I think is that there is a difference in how memory stats is reporting depending on if using cgroup v1 vs. cgroup v2. I believe your client today supports the cgroup v1. However, memory stats when using cgroup v2 uses different key/value pairs.

I finally started to find some info on the Memory Stats issue: hashicorp/nomad#10251.
https://docs.docker.com/desktop/windows/release-notes/#docker-desktop-430

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