Skip to content
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

Operator throws error that it cannot find StatefulSet #370

Open
rgelsi opened this issue Jun 22, 2022 · 1 comment
Open

Operator throws error that it cannot find StatefulSet #370

rgelsi opened this issue Jun 22, 2022 · 1 comment

Comments

@rgelsi
Copy link

rgelsi commented Jun 22, 2022

I get the following error message since version 2.13.0 of the operator:

kopf.objects         [ERROR   ] Timer 'ping_cratedb' failed with an exception. Will retry.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/kopf/_core/actions/execution.py", line 283, in execute_handler_once
    result = await invoke_handler(
  File "/usr/local/lib/python3.8/site-packages/kopf/_core/actions/execution.py", line 378, in invoke_handler
    result = await invocation.invoke(
  File "/usr/local/lib/python3.8/site-packages/kopf/_core/actions/invocation.py", line 117, in invoke
    result = await fn(**kwargs)  # type: ignore
  File "main.py", line 188, in ping_cratedb
    await ping_cratedb_status(namespace, name, logger)
  File "/usr/local/lib/python3.8/site-packages/crate/operator/handlers/handle_ping_cratedb_status.py", line 45, in ping_cratedb_status
    desired_instances = await get_desired_nodes_count(namespace, name)
  File "/usr/local/lib/python3.8/site-packages/crate/operator/operations.py", line 76, in get_desired_nodes_count
    statefulset = await apps.read_namespaced_stateful_set(
  File "/usr/local/lib/python3.8/site-packages/kubernetes_asyncio/client/api_client.py", line 189, in __call_api
    raise e
  File "/usr/local/lib/python3.8/site-packages/kubernetes_asyncio/client/api_client.py", line 182, in __call_api
    response_data = await self.request(
  File "/usr/local/lib/python3.8/site-packages/kubernetes_asyncio/client/rest.py", line 193, in GET
    return (await self.request("GET", url,
  File "/usr/local/lib/python3.8/site-packages/kubernetes_asyncio/client/rest.py", line 187, in request
    raise ApiException(http_resp=r)
kubernetes_asyncio.client.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: <CIMultiDictProxy('Audit-Id': 'd3d05d53-6632-4a88-b1c6-608ccee8275d', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '1a3ff758-6cfc-4d4d-94e5-00a5c2db0c49', 'X-Kubernetes-Pf-Prioritylevel-Uid': '37b126f9-ff88-4ed8-8297-6ddbfc19e47c', 'Date': 'Wed, 22 Jun 2022 12:36:27 GMT', 'Content-Length': '264')>
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"statefulsets.apps \"crate-data-hot-cratedb-cluster\" not found","reason":"NotFound","details":{"name":"crate-data-hot-cratedb-cluster","group":"apps","kind":"statefulsets"},"code":404}

As far as I have understood, the StatefulSet name to check was incorrectly hard-coded to "crate-data-hot-{name}" in change_compute.py

Operator Version: 2.13.0
CrateDB Version: 4.8.1
Kubernetes Version: 1.21.0

@remear
Copy link

remear commented Jan 27, 2023

I've encountered this, and also a failure in the cluster creation method, when using a minikube cluster with version 1.25+. I don't see those errors on, say, a minikube cluster running Kubernetes v1.23.2. After some deeper diving, I noticed that some resources like the PodDisruptionBudget were not being created. The Kubernetes API has introduced deprecations and removals for several beta APIs. After updating the crate operator locally to use non-beta APIs, these errors went away for me. I'm currently blocked on validating further due to #460.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants