-
Notifications
You must be signed in to change notification settings - Fork 332
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
InvalidApiVersionParameter) The api-version '2021-03-01' is invalid #1739
Comments
@khain0 This error is caused by the inconsistency between the version of azure.azcolleciton you installed and the required version of azure-mgmt-network. We have updated to the latest version in PR #1697, so the required package also needs to be updated simultaneously. Thank you!
|
@Fred-sun cat requirements.yml
cat requirements.txt
Output from building an image
At the end I get an error:
|
I switched to ansible-builder version 3.1.0 (previous one was 3.0.0).
I took dependencies from https://github.com/ansible-collections/azure/blob/v2.7.0/requirements.txt
I get the error while building Execution Environment
No idea why it tries to get version 19.1.0 of azure-mgmt-network from requirements. |
@khain0 From the error, it is caused by the version conflict. Can you uninstall 'azure-mgmt-network' and try it again? Thank you!!
|
It does not work like that. ansible-builder builds an images based on requirements. I do not have installation on azue-mgmt-network locally. |
When I use requirements from dev. https://github.com/ansible-collections/azure/blob/dev/requirements.txt
|
Two lists are created during building an image using ansible-builder with requiremesnts downgraded to version 2.7.0 of azure collection: https://github.com/ansible-collections/azure/blob/v2.7.0/requirements.txt
At the end I get
|
@khain0 What kind of environment are you working in? Could you please help provide the versions of azure. azcollection and azure-mgmt-network? |
@Fred-sun
The result of the command should be a podman image whith ansible collection and python modules installed inside the image. ansible-builder runs on Red Hat Enterprise Linux 8.10
azure-mgmt-network version is taken from requirements.txt:
The whole output of command:
|
If I understand it correctly we need to use dev branch of azure.collection to be able to install azure-mgmt-network==26.0.0. Otherwise it forces version 19.1.0 of azure-mgmt-network which is a dependency for azure.collection version 2.7.0, correct? |
@khain0 From your execution log, it is very strange why you installed requirements.txt twice, Moreover, the two versions of the installation are not the same. The versions of azure-mgmt-network are v19.1.0 and v26.0.0, and the two versions conflict, resulting in the installation failure. Thank you!
|
The requirements are not installed twice.
The question is how to omit this behavior? |
Hello, I can provide some info on how ansible-builder works. When a galaxy requirement is specified the build process will look for the requirements.txt in each ansible module and use that for the python requirements. This makes sense since the ansible module would not be usable without the python dependencies. As you have noticed that adding an additional requirements.txt to the ansible-builder will not remove the one provided by the ansible module, in this case the requirements.txt that were released with azure-collection-2.7.0. The only way around this would be to rebuild the galaxy file and use a local version:
snippet from execution environment:
requirements.yml
I hope this helps and hopefully we have a 3.0.0 release of azure-ansible soon. |
I perform all the steps you mentioned and I changed MANIFEST.json to 2.7.1 before making new tarball.
The same error is thrown when trying to install the collection:
|
Checksum for download azure collection version 2.7.0:
|
Oops, I'm sorry. I forgot that it's a special format tarball that needs to be created with ansible-galaxy.
You will now have the new collection in the current directory which you can copy to your execution environment build dir. |
It wants me to have dnf in my image.
Unfortunately I do not figured out how to use build_image in yaml version 3 which could contain dnf command
|
Add the following to your ee.yml
|
I build the Execution Environment successfully and imported it to Ansible Automation Platform.
but it thorws an error:
|
I think you may be missing some additional pieces
|
I added the following to requirements.txt:
I get the error:
@p3ck |
I use requirements.txt from https://github.com/ansible-collections/azure/blob/dev/requirements.txt and added:
Seems you are missing one module in your requirements.txt in dev branch
Execution Environment was built successfully.
The error itself:
|
@khain0 The code for the dev branch is up to date and aze-mgmt-network has been updated to v26.0.0 (relate PR #1697). So if you install azure.azcollection ==2.7.0, install requirment.txt in the package. File is located in the local directory ~ /. Ansible/collection/azure/azcollection/requirments. TXT. In addition, the dev branch we will release as soon as possible, should be before the end of the month, will avoid this problem. Thank you! |
I build version 2.7.0 with the following requirements:
I substitute version 2021-03-01 with 2021-04-01 under /usr/share/ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py
|
@khain0 Yes, but the 'azure-mgmt-network' version installed in your environment is higher than v19.1.0, so you should have the latest dependency package installed. However, this did not match the version we requested for v19.1.0, which led to this error. Thank you! |
I don't get it. I have version 19.1.0 of azure-mgmt-network installed. Why you stated the version is higher than that? |
@Fred-sun
I guess something else have to be change to ensure compatible api version is used.
Procedure to build collection from dev:
|
@khain0 This problem can be confirmed to be caused by version conflict. I am pushing forward the release of v3.0.0 as soon as possible, which should solve this problem. Thank you! |
@khain0 The azure.azcollection version v2.7.1 requires azure-mgmt-network version v19.1.0, thank you! |
@Fred-sun so why requirements.txt in dev branch contains azure-mgmt-network==26.0.0? |
@khain0 The Dev branch is the development version and has not been released yet, we will update the latest code to the dev branch and release it at intervals. Thank you! |
@khain0 Yes, the code in the dev branch specifies the API version 'v2024-01-01' thanks! |
@khain0 The latest version v3.0.0 has been released, can you try it again? Thanks! |
@khain0 According to the information you provided, the version you installed is the latest (v3.0.0), because I saw that it was installed on the container, could you please help to make the following judgment?
|
SUMMARY
Invoking azure_rm_virtualnetwork_info ends with error InvalidApiVersionParameter
ISSUE TYPE
COMPONENT NAME
azure_rm_virtualnetwork_info
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible Automation Platform 4.5.8 (bundle version 2.4.1)
Execution Environment build based on registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:latest
STEPS TO REPRODUCE
cat requirements.yml
cat requirements.txt
cat azure_deploy_host/tasks/main.yml
EXPECTED RESULTS
Getting virtual network info on Azure West Europe Region works fine. I can get virtual networks info succesfully.
ACTUAL RESULTS
Getting virtual network info on Azure East US 2 Region does NOT work.
The error is:
JSON job details:
CHARACTERIZATION/ISOLATION
Module works for Azure West Europe, but does not work for Azure East US 2 region.
The text was updated successfully, but these errors were encountered: