-
Notifications
You must be signed in to change notification settings - Fork 336
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
Import error for Azure Monitor even if all requirements are installed #805
Comments
I was able to resolve this by executing On my machine, |
thx for sharing @fiskhest ; I will try this out |
Does your problem still exist? |
Well, if I follow the officially documented steps required to install this collection:
the problem still very much exists, because that file contains I can reproduce this on two separate laptops. |
@fiskhest First, ansible-collection requires ansible version higher than 2.9, please update it to the latest; If python3 is used, install in PIP3 mode. Could you try again? Thank you very much! |
Got any other terribly misguided suggestions dodging my very clear reproduction and fix? |
@fiskhest @pun-ky Sorry for the trouble caused to you, the pull request related to the upgrade of 'azure mgmt-monitor' is #701, which contains azCollection 1.11.0 or the higer version. Use the accompanying version test. Thank you very much! Or you can install the latest version tests like this
|
I also run into this in Ansible with Python 3.9.7: "ModuleNotFoundError: No module named 'azure.mgmt.monitor.version' @l3ender suggested can also be a sequence issue in some cases, which is plausible: #715 (comment) from azure.mgmt.monitor import MonitorManagementClient
dir(MonitorManagementClient)
['DEFAULT_API_VERSION', 'LATEST_PROFILE', '_PROFILE_TAG', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_get_api_version', '_models_dict', 'action_groups', 'activity_log_alerts', 'activity_logs', 'alert_rule_incidents', 'alert_rules', 'autoscale_settings', 'baseline', 'baselines', 'close', 'data_collection_endpoints', 'data_collection_rule_associations', 'data_collection_rules', 'diagnostic_settings', 'diagnostic_settings_category', 'event_categories', 'guest_diagnostics_settings', 'guest_diagnostics_settings_association', 'log_profiles', 'management_group_diagnostic_settings', 'metric_alerts', 'metric_alerts_status', 'metric_baseline', 'metric_definitions', 'metric_namespaces', 'metrics', 'models', 'operations', 'predictive_metric', 'private_endpoint_connections', 'private_link_resources', 'private_link_scope_operation_status', 'private_link_scoped_resources', 'private_link_scopes', 'scheduled_query_rules', 'service_diagnostic_settings', 'subscription_diagnostic_settings', 'tenant_activity_logs', 'vm_insights'] |
@nleiva Since the problem you encountered has not been copied yet, the problem you mentioned @jaydestro has been resolved through the new version. Can you reinstall it and try? Thank you very much! |
@pun-ky @fiskhest I just ran into this as well. From what I can tell, it looks like the actual issue is being masked since any import failure below will just return that generic azure/plugins/module_utils/azure_rm_common.py Lines 227 to 285 in 0a7eb5e
It looks like the newer versions of the
|
@Fred-sun please check out the reply by @benjdudas highlighting the problem with the python library imports in the collection. Users will continue to hit this issue until this is resolved. |
@nleiva Sorry for replying to you so late. Are you using the old version and installing a new dependency? Please try upgrading the current latest version“ansible-galaxy collection install azure.azcollection --force ” ! In another Pull Request (relate link: #751) ! have removed these unused imports. Thank you very much! |
Thank you for the pointer to the PR @Fred-sun. That solves the problem. So, in summary, this issue was introduced in |
Greate, I will close this issue! Thank you very much! |
SUMMARY
Upgrading requirements causing a problem with Monitor dependency.
IMO - https://stackoverflow.com/a/70717476/3360007 - this is still true, it looks for me also buggy.
ISSUE TYPE
ANSIBLE VERSION
2.8.x
COLLECTION VERSION
1.10.0
OS / ENVIRONMENT
RHEL-based / CentOS
EXPECTED RESULTS
Be able to install recent requirements for Ansible Azure Collection.
Upgrade failed and I needed to downgrade:
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: