Skip to content

ApiException and 404 response when calling CustomObjectsApi #948

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

Closed
zmunro opened this issue Sep 5, 2019 · 3 comments
Closed

ApiException and 404 response when calling CustomObjectsApi #948

zmunro opened this issue Sep 5, 2019 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@zmunro
Copy link

zmunro commented Sep 5, 2019

What happened (please include outputs or screenshots):
When I try to call this API I get an ApiException and the request fails. Here is the error output:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/zach/Documents/dzd2/examples/custom_object.py", line 93, in <module>
    main()
  File "/Users/zach/Documents/dzd2/examples/custom_object.py", line 65, in main
    body=my_resource,
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/custom_objects_api.py", line 178, in create_namespaced_custom_object
    (data) = self.create_namespaced_custom_object_with_http_info(group, version, namespace, plural, body, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/custom_objects_api.py", line 277, in create_namespaced_custom_object_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 334, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 168, in __call_api
    _request_timeout=_request_timeout)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 377, in request
    body=body)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 266, in POST
    body=body)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 222, in request
    raise ApiException(http_resp=r)
kubernetes.client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': 'e1e34583-bc4d-45e2-96ec-9072d3624586', 'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff', 'Date': 'Thu, 05 Sep 2019 18:18:33 GMT', 'Content-Length': '19'})
HTTP response body: 404 page not found

What you expected to happen:
To not receive an error and the API to be called.

How to reproduce it (as minimally and precisely as possible):
Copy the custom_object.py file from the examples folder in this repo and try to run it with python3.7.4, you should get the same error.

Anything else we need to know?:

Environment:

  • Kubernetes version (kubectl version):
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T09:18:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.8-gke.10", GitCommit:"f53039cc1e5295eed20969a4f10fb6ad99461e37", GitTreeState:"clean", BuildDate:"2019-06-19T20:48:40Z", GoVersion:"go1.10.8b4", Compiler:"gc", Platform:"linux/amd64"}
  • OS (e.g., MacOS 10.13.6): MacOS 10.14.5
  • Python version (python --version) Python3.7.4
  • Python client version (pip list | grep kubernetes) 10.0.1
@zmunro zmunro added the kind/bug Categorizes issue or PR as related to a bug. label Sep 5, 2019
@micw523
Copy link
Contributor

micw523 commented Sep 5, 2019

Have you applied the yaml manifest first?

@zmunro
Copy link
Author

zmunro commented Sep 5, 2019

I am dumb

@beyondmars3
Copy link

Use python to call kubernetes client. The official demos are all wrong. Always ApiException 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants