question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docker.stack.ps: ValidationError

See original GitHub issue

Version: 0.14.0

Hello! One more bug found.

So I have a stack and one of services is broken:

 ➜  0.3.0118 git:(master) ✗ docker stack ps test1
ID             NAME                    IMAGE                                              NODE             DESIRED STATE   CURRENT STATE             ERROR                              PORTS
jmzs1ntvjxd6   test1_name1.1   name1:2.3.0131                    Running         Pending 43 seconds ago    "no suitable node (scheduling …"
...

I’ve tried to do next

for l in docker.stack.ps("test1"):
    print(l.id). # jmzs1ntvjxd6...
    print(' l', l.labels). # ERROR!

Error:

---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
~/.../updater/venv/lib/python3.7/site-packages/python_on_whales/client_config.py in _fetch_and_parse_inspect_result(self, reference)
    211         try:
--> 212             return self._parse_json_object(json_object)
    213         except pydantic.error_wrappers.ValidationError as err:

~/.../updater/venv/lib/python3.7/site-packages/python_on_whales/components/task.py in _parse_json_object(self, json_object)
    178     def _parse_json_object(self, json_object: Dict[str, Any]) -> TaskInspectResult:
--> 179         return TaskInspectResult.parse_obj(json_object)
    180 

~/.../updater/venv/lib/python3.7/site-packages/pydantic/main.cpython-37m-darwin.so in pydantic.main.BaseModel.parse_obj()

~/.../updater/venv/lib/python3.7/site-packages/pydantic/main.cpython-37m-darwin.so in pydantic.main.BaseModel.__init__()

ValidationError: 1 validation error for TaskInspectResult
NodeID
  field required (type=value_error.missing)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gabrieldemarmiessecommented, Feb 19, 2021

Great! Thanks! I’ll work on a fix. This helps a lot. This will go right to the unit tests.

0reactions
zvadymcommented, Feb 19, 2021

it works now! thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ECS] docker compose ps tries to locate a stack that has been ...
I am using the current engine + cloud integration: max:~/environment/yelb/deployments/platformdeployment/Docker (master) $ docker version ...
Read more >
docker stack ps
Lists the tasks that are running as part of the specified stack. Note. This is a cluster management command, and must be executed...
Read more >
Serverless + Docker - adding command in dockerfile results in ...
I have a serverless project I am using with localstack and Docker. ... ServerlessError: ValidationError: Stack with id pond5-api-local does ...
Read more >
Get Started, Part 5: Stacks - Docker Documentation
A stack is a group of interrelated services that share dependencies, ... You can corroborate this visualization by running docker stack ps <stack>...
Read more >
StatefulSets - Kubernetes
Failing to specify a matching Pod Selector will result in a validation error during StatefulSet creation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found