Repository navigation
Closed
Labels
Description
A common scenario that seems to be constantly happening on pipelines execution is the following:
- the pod was deployed but wasn't in a READY state yet
https://github.com/pulp/pulp-operator/runs/7098586003?check_suite_focus=true#step:12:52
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
example-pulp-api-7677695b64-c6blm 0/1 Running 0 80s 172.17.0.9 minikube <none> <none>
- just after that we started to do API requests
https://github.com/pulp/pulp-operator/runs/7098586003?check_suite_focus=true#step:12:88
http: error: ConnectionError: HTTPConnectionPool(host='localhost', port=24880): Max retries exceeded with url: /api/galaxy/pulp/api/v3/status/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f67cdd63160>: Failed to establish a new connection: [Errno 111] Connection refused')) while doing GET request to URL: http://localhost:24880/api/galaxy/pulp/api/v3/status/
output=
rc=1
- until it exhausted all retries (failing the pipeline)
https://github.com/pulp/pulp-operator/runs/7098586003?check_suite_focus=true#step:12:605
ERROR 4: Status page never accessible or returning success
- in a later check of the pod status (during the show logs job), we could verify that it was restarted:
https://github.com/pulp/pulp-operator/runs/7098586003?check_suite_focus=true#step:16:40
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
example-pulp-api-7677695b64-c6blm 1/1 Running 1 (29m ago) 33m 172.17.0.9 minikube <none> <none>
## exit code 137 (received SIGKILL from host)
example-pulp-api-7677695b64-c6blm 137
As @fao89 noticed, this started to happen after updating minikube to v1.26.
To help try to mitigate this issue, while we investigate it further, we could modify the pulp-operator-check-and-wait.sh script to check if the API process is in a listening state already (not the ideal solution, but can be helpful):
| if [[ $(echo "$pods" | grep -c -v -E "STATUS|Running") -eq 0 && $(echo "$pods" | grep -c "web") -eq 1 ]]; then |
- if [[ $(echo "$pods" | grep -c -v -E "STATUS|Running") -eq 0 && $(echo "$pods" | grep -c "api") -eq 1 ]]; then
+ api_pod=$(kubectl get pods -l app.kubernetes.io/component=api -oname)
+ if [[ $(echo "$pods" | grep -c -v -E "STATUS|Running") -eq 0 && $(echo "$pods" | grep -c "api") -eq 1 && $(kubectl logs "$api_pod"|grep 'Listening at: ') ]]; then
Activity
git-hyagi commentedon Jun 30, 2022
An even better approach would be to use the
kubectl waitcommand (still experimental but seems to be better than the "grep" workaround).fao89 commentedon Jun 30, 2022
we use it on backup/restore:
https://github.com/pulp/pulp-operator/blob/main/.ci/scripts/backup_and_restore.sh#L30
it's been working well so far
Wait for OperatorFinishedExecution
Wait for OperatorFinishedExecution
Wait for OperatorFinishedExecution
Wait for OperatorFinishedExecution
Wait for OperatorFinishedExecution
Wait for OperatorFinishedExecution
Wait for OperatorFinishedExecution
Wait for OperatorFinishedExecution