-
Notifications
You must be signed in to change notification settings - Fork 98
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
oci python sdk required for this module - random encounter #255
Comments
@khain0 Can you follow the steps from this troubleshooting guide to resolve the issue. If you still face the issue, please enable the debug mode using logging guide and share debug logs with us to help us identify the issue. |
OCI python SDK is installed in the image and Execution Environment works as intended most of the time (it starts OCI instances), but sometimes randomly it throws an error "oci python sdk required for this module." job_39509 run on 06.11.2023 with this error (job file attached), but since that time I had almost 100 job with success execution. The error occurs exactly like this since may 2023 - once every few dozen template runs it fails. It does not matter which version of oci python sdk I use. |
Do you have any conclusions regarding this issue? |
@khain0 By default, Ansible gathers facts and executes all tasks on the machines that match the As I can see in your playbook that you are using Attached log |
oci-ee_v3.yml.txt I came with this error here to indicate that there is a bug in your code and I would like you to start to try to find the error. Giving advice which are inconsistent with reality does not help at all. Attachemnts: yaml file used to build EE with command: ansible-builder build -v 3 --no-cache -f oci-ee_v3.yml -t localhost/oci:3.02 |
Do you have any clue what could be wrong? |
@dineshsuthar786 In regards this issue, the python interpreter is being forced to be used, and there is only one python installed even with forcing the interpreter, the error of the collection not recognizing the interpreter is showed.
The import from oci succeeds inside the container image (execution environment), this suggests a problem with the collection code where they test the imports available, as follows is the python installed in the container image that is randomly failing:
There could be issues with how the code handles its python imports. |
Gentle reminder, last comment was done over a month ago. |
Issue Report
Error "oci python sdk required for this module" appears randomly when oci python sdk is used via OCI collection inside Execution Environment in Ansible Automation Platform. I built an image with ansible-builder and imported it as Execution Environment. Templates are run every day which executes starts and stops of instances (Virtual Machines) inside OCI. The code is executed inside EE in purpose (using local_actions in ansible module) to be able to start OCI instance which is currently not running.
The thing is a template works normally with the EE in sense python sdk is available. On average once every several dozen of launching the template the issue occurs: OCI python sdk is missing. I would like to point out that NO changes are made to EE nor template nor playbook. Red Hat Support Team pointed out that this issue be inside the code of oci_version_utils.py
A clear and concise description of what the issue is.
When template is started inside Execution Environment sometimes it reports that OCI python sdk is missing.
A clear and concise description of what you expected to happen.
When template is started inside Execution Environment it always finds OCi python SDK
OS version: Red Hat Enterprise Linux 8.8
Ansible version:
ansible [core 2.15.4]
OCI Python SDK version:
python3.9 -c "import oci;print(oci.version)"
2.114.0
OCI Ansible Modules version:
ansible-galaxy collection list
/home/runner/.ansible/collections/ansible_collections
Collection Version
oracle.oci 4.33.0
Ansible playbook to reproduce the issue
name: Including environemnt specific variables
include_vars: "{{ oci_env }}.yml"
tags: always
name: Get all instances in compartment
local_action:
module: oci_compute_instance_facts
compartment_id: "{{ compartment_id }}"
register: instances_list
tags: always
The text was updated successfully, but these errors were encountered: