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.

list_api_service: ValueError: Invalid value for `service`, must not be `None`

See original GitHub issue

Hello, I try to get apiservice using in python doing:

config.load_kube_config(kubectl_config_full_path)
api_instance = client.ApiregistrationV1Api()
response = api_instance.list_api_service()
print("Api services: " + str(response))

but I get the following error:

ValueError: Invalid value for service, must not be None

I have a AWS EKS 1.15 as Kubernetes Master. Python 3.6.8. python kubernetes client 10.0.0 Ubuntu 16.04.6 LTS

Update: I’ve tested it with python kubernetes client 11.0.0 and I get the same error

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
roycaihwcommented, Jun 9, 2020

Looks like this is another occurrence of https://github.com/kubernetes-client/gen/issues/52 and has been fixed by https://github.com/kubernetes/kubernetes/pull/85728 in Kubernetes 1.18. Kubernetes sometimes incorrectly restricts a field to be required but the apiserver may omits the field in real responses. These responses break the generated clients since the generated client-side validation expects the required field to exist.

For now the workaround is either to avoid de-serializing the response so the client-side validation doesn’t kick in, or to remove the client-side validation if you have access to your local module code. Once we cut a new release with the 1.18 openapi spec, the generated client won’t expect the field to be required.

1reaction
clausa20commented, Jun 1, 2020

@MoShitrit thanks for the workaround, it fits ok for me. Regards.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: Invalid value for selector, must not be None
It's because they changed the validation to happen in the constructor, rather that later -- which is not what the notebook was expecting....
Read more >
Python kubernetes library equivalent of `kubectl get node
I'm running into this same issue and I don't know how to get around it. What worked for you ApproximateIdentity?
Read more >
Bug #1905481 “Python Kubernetes client raises exception ...
In sysinv log, the error "Kubernetes exception in kube_get_nodes: Invalid value for `names`, must not be `None`" appears every minute.
Read more >
kfp.dsl._container_op — Kubeflow Pipelines documentation
NOTE: A notable difference is that `name` is not required and will not be processed for ... size_string) is None: raise ValueError( 'Invalid...
Read more >
ValueError: Invalid value for selector, must not be None
Starting with intro_notebook.ipynb at 3rd step I get an error: ValueError: Invalid value for `selector`, must not be `None`. Here is the code:...
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