operator-sdk
operator-sdk copied to clipboard
Ansbile operator/python3-requests.noarch version 2.20.0-5.el8_10 compatability issues
There is an issue with the ansible operator reonciliation loop when it can't find the stdout files. The logs are below.
Environment
Operator type:
language ansible
Kubernetes cluster type:
OpenShift 4.16
$ operator-sdk version
v1.15 (but appears to affect 1.14 and 1.13 as well, have not checked earler versions)
We are using the Red hat ose-ansible-operator as our base image: https://catalog.redhat.com/software/containers/openshift4/ose-ansible-operator/5cdc9a53bed8bd5717d6345e?architecture=amd64&image=676105a18b460ba7686399d3&container-tabs=dockerfile
When building the application image we do a yum update on that image. That updates the python3-requests.noarch version from 2.20.0-3.el8_8 to 2.20.0-5.el8_10, this seems to cause the issue. When i exclude this package from the yum update it resolves the issue.
Raising the bug to highlight that there is a bug in the ansible operator or it's compatibility with the new version of python3-requests.noarch.
2025-01-10T14:47:49.938311838Z {"level":"error","ts":"2025-01-10T14:47:49Z","logger":"runner","msg":"Traceback (most recent call last):\n File \"/usr/lib/python3.6/site-packages/ansible_runner/__main__.py\", line 598, in main\n res = run(**run_options)\n File \"/usr/lib/python3.6/site-packages/ansible_runner/interface.py\", line 178, in run\n r.run()\n File \"/usr/lib/python3.6/site-packages/ansible_runner/runner.py\", line 94, in run\n self.status_callback('starting')\n File \"/usr/lib/python3.6/site-packages/ansible_runner/runner.py\", line 85, in status_callback\n ansible_runner.plugins[plugin].status_handler(self.config, status_data)\n File \"/usr/lib/python3.6/site-packages/ansible_runner_http/events.py\", line 38, in status_handler\n urlpath=plugin_config['runner_path'])\n File \"/usr/lib/python3.6/site-packages/ansible_runner_http/events.py\", line 18, in send_request\n return session.post(url_actual, headers=headers, json=(data))\n File \"/usr/lib/python3.6/site-packages/requests/sessions.py\", line 583, in post\n return self.request('POST', url, data=data, json=json, **kwargs)\n File \"/usr/lib/python3.6/site-packages/requests/sessions.py\", line 535, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/lib/python3.6/site-packages/requests/sessions.py\", line 648, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/lib/python3.6/site-packages/requests/adapters.py\", line 584, in send\n request, verify, proxies=proxies, cert=cert\n File \"/usr/lib/python3.6/site-packages/requests/adapters.py\", line 457, in get_connection_with_tls_context\n **host_params, pool_kwargs=pool_kwargs\n File \"/usr/lib/python3.6/site-packages/urllib3/poolmanager.py\", line 229, in connection_from_host\n return self.connection_from_context(request_context)\n File \"/usr/lib/python3.6/site-packages/urllib3/poolmanager.py\", line 239, in connection_from_context\n pool_key_constructor = self.key_fn_by_scheme[scheme]\nKeyError: 'http+unix'\n","job":"4632125492890882793","name":"CRD","namespace":"ns","error":"exit status 1","stacktrace":"github.com/operator-framework/operator-sdk/internal/ansible/runner.(*runner).Run.func1\n\toperator-sdk/internal/ansible/runner/runner.go:269"}
2025-01-10T14:47:49.979135257Z {"level":"error","ts":"2025-01-10T14:47:49Z","logger":"reconciler","msg":"Failed to get ansible-runner stdout","job":"4632125492890882793","name":"CRD","namespace":"ns","error":"open /tmp/ansible-operator/runner/our.company.com/v1/CRD/ns/cr/artifacts/4632125492890882793/stdout: no such file or directory","stacktrace":"github.com/operator-framework/operator-sdk/internal/ansible/controller.(*AnsibleOperatorReconciler).Reconcile\n\toperator-sdk/internal/ansible/controller/reconcile.go:226\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\toperator-sdk/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:122\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\toperator-sdk/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:323\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\toperator-sdk/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\toperator-sdk/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:235"}
2025-01-10T14:47:49.979218878Z {"level":"error","ts":"2025-01-10T14:47:49Z","msg":"Reconciler error","controller":"CRD-controller","object":{"name":"CRD","namespace":"ns"},"namespace":"ns","name":"CRD","reconcileID":"099d6025-287b-4b71-92d2-ff226895212a","error":"open /tmp/ansible-operator/runner/our.company.com/v1/CRD/ns/cr/artifacts/4632125492890882793/stdout: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\toperator-sdk/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:329\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\toperator-sdk/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\toperator-sdk/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:235"}