python icon indicating copy to clipboard operation
python copied to clipboard

Request info is not included in ApiException

Open redixin opened this issue 2 years ago • 3 comments

When I query nonexistent resource type, I got ApiException:

kubernetes.client.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': '9954faf3-7258-4619-b6b4-c3ac0b55a340', 'Cache-Control': 'no-cache, private', 'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff', 'X-Kubernetes-Pf-Flowschema-Uid': 'cee19ddf-4747-45cb-93a7-e774fe2a061e', 'X-Kubernetes-Pf-Prioritylevel-Uid': '1d97a02a-9039-4fde-bf2e-1e9779e51408', 'Date': 'Thu, 04 Aug 2022 10:14:55 GMT', 'Content-Length': '19'})
HTTP response body: b'404 page not found\n'

This is not helpful enough, because it not possible to figure out what actually was requested. It would be very helpful if there was request info included as well.

What you expected to happen:

kubernetes.client.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': '9954faf3-7258-4619-b6b4-c3ac0b55a340', 'Cache-Control': 'no-cache, private', 'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff', 'X-Kubernetes-Pf-Flowschema-Uid': 'cee19ddf-4747-45cb-93a7-e774fe2a061e', 'X-Kubernetes-Pf-Prioritylevel-Uid': '1d97a02a-9039-4fde-bf2e-1e9779e51408', 'Date': 'Thu, 04 Aug 2022 10:14:55 GMT', 'Content-Length': '19'})
HTTP response body: b'404 page not found\n'
HTTP request headers: <REQUEST HEADERS HERE>
HTTP request URI: <REQUEST URI HERE>

Environment: Python 3.10.4 kubernetes 24.0.0-snapshot /home/eye/work/k8s-python-client

redixin avatar Aug 04 '22 10:08 redixin

Assign the issue to me please. And thanks for pointing it out

Abdullium avatar Aug 08 '22 14:08 Abdullium

ApiException is generated by openapi-generator. Please open the issue in the upstream

roycaihw avatar Aug 15 '22 16:08 roycaihw

@roycaihw thanks for help. Reported and proposed a fix into upstream: https://github.com/OpenAPITools/openapi-generator/issues/13214

redixin avatar Aug 17 '22 22:08 redixin

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 15 '22 22:11 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Dec 15 '22 23:12 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Jan 14 '23 23:01 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jan 14 '23 23:01 k8s-ci-robot