openrca / orca

Root Cause Analysis for Kubernetes
https://openrca.io
Apache License 2.0
90 stars 10 forks source link

the server could not find the requested resource / kubernetes.client.rest.ApiException: (404) #37

Open aleksandra-galara opened 4 years ago

aleksandra-galara commented 4 years ago

The following error occurs in logs of orca pod:

11:08:31 probe.1 | 2020-04-03 11:08:31,498 - orca.topology.probe - INFO - Consuming events for entity: kubernetes/replica_set
11:08:31 probe.1 | Unhandled exception
11:08:31 probe.1 | Traceback (most recent call last):
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/cotyledon/_utils.py", line 95, in exit_on_exception
11:08:31 probe.1 |     yield
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/cotyledon/_service.py", line 139, in _run
11:08:31 probe.1 |     self.run()
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/orca/topology/probe.py", line 50, in run
11:08:31 probe.1 |     probe.run()
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/orca/topology/probe.py", line 141, in run
11:08:31 probe.1 |     self._upstream_proxy.get_events(handler=self)
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/orca/topology/infra/k8s/upstream.py", line 26, in get_events
11:08:31 probe.1 |     for event in self._client.watch():
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/orca/common/clients/k8s/client.py", line 90, in watch
11:08:31 probe.1 |     for event in self._watch_resource():
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/watch/watch.py", line 142, in stream
11:08:31 probe.1 |     resp = func(*args, **kwargs)
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api/extensions_v1beta1_api.py", line 3906, in list_replica_set_for_all_namespaces
11:08:31 probe.1 |     (data) = self.list_replica_set_for_all_namespaces_with_http_info(**kwargs)  # noqa: E501
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api/extensions_v1beta1_api.py", line 4001, in list_replica_set_for_all_namespaces_with_http_info
11:08:31 probe.1 |     collection_formats=collection_formats)
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 345, in call_api
11:08:31 probe.1 |     _preload_content, _request_timeout)
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 176, in __call_api
11:08:31 probe.1 |     _request_timeout=_request_timeout)
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 366, in request
11:08:31 probe.1 |     headers=headers)
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 241, in GET
11:08:31 probe.1 |     query_params=query_params)
11:08:31 probe.1 |   File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 231, in request
11:08:31 probe.1 |     raise ApiException(http_resp=r)
11:08:31 probe.1 | kubernetes.client.rest.ApiException: (404)
11:08:31 probe.1 | Reason: Not Found
11:08:31 probe.1 | HTTP response headers: HTTPHeaderDict({'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Fri, 03 Apr 2020 11:08:31 GMT', 'Content-Length': '174'})
11:08:31 probe.1 | HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}\n'
11:08:31 probe.1 | 
bzurkowski commented 4 years ago

Kubernetes client for Python currently doesn't support Kubernetes 1.16, therefore several watch endpoints fail. The latest supported Kubernetes release confirmed to work with Open RCA is 1.15.

After the pull request for 1.16 compatibility is merged, the issue should be reviewed and closed.