Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

CI Builds started failing with "cannot import name '_distro'" #13

Closed
geerlingguy opened this issue Feb 5, 2020 · 5 comments · Fixed by #17
Closed

CI Builds started failing with "cannot import name '_distro'" #13

geerlingguy opened this issue Feb 5, 2020 · 5 comments · Fixed by #17

Comments

@geerlingguy
Copy link
Collaborator

geerlingguy commented Feb 5, 2020

SUMMARY

CI builds (using ansible-base) started failing in the past day or two with "cannot import name '_distro'"

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible-test

ANSIBLE VERSION

ansible-base devel

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

STEPS TO REPRODUCE
EXPECTED RESULTS

Tests pass.

ACTUAL RESULTS
Run command: ansible-doc -t connection community.kubernetes.kubectl
ERROR: Command "ansible-doc -t connection community.kubernetes.kubectl" returned exit status 250.
>>> Standard Error
ERROR! Unexpected Exception, this is probably a bug: cannot import name '_distro'
Run command: importer.py
See documentation for help: https://docs.ansible.com/ansible/devel/dev_guide/testing/sanity/import.html
ERROR: Found 8 import issue(s) on python 3.6 which need to be resolved:
ERROR: plugins/module_utils/common.py:27:0: traceback: ImportError: cannot import name '_distro'
ERROR: plugins/module_utils/raw.py:29:0: traceback: ImportError: cannot import name '_distro'
ERROR: plugins/module_utils/scale.py:26:0: traceback: ImportError: cannot import name '_distro' (at plugins/module_utils/common.py:27:0)
ERROR: plugins/modules/k8s.py:279:0: traceback: ImportError: cannot import name '_distro' (at plugins/module_utils/raw.py:29:0)
ERROR: plugins/modules/k8s_auth.py:152:0: traceback: ImportError: cannot import name '_distro'
ERROR: plugins/modules/k8s_info.py:140:0: traceback: ImportError: cannot import name '_distro' (at plugins/module_utils/common.py:27:0)
ERROR: plugins/modules/k8s_scale.py:121:0: traceback: ImportError: cannot import name '_distro' (at plugins/module_utils/common.py:27:0)
ERROR: plugins/modules/k8s_service.py:172:0: traceback: ImportError: cannot import name '_distro' (at plugins/module_utils/common.py:27:0)
@geerlingguy geerlingguy changed the title CI Builds started failing with CI Builds started failing with "cannot import name '_distro'" Feb 5, 2020
@geerlingguy
Copy link
Collaborator Author

Looks like it's related to ansible-community/collection_migration#277

@geerlingguy
Copy link
Collaborator Author

It should start working again in ~24 hours.

@geerlingguy
Copy link
Collaborator Author

Apparently if I build ansible-base directly, it may clear things up... also could uncover any other issues.

@geerlingguy
Copy link
Collaborator Author

geerlingguy commented Feb 5, 2020

On Ubuntu 18.04, to generate Ansible Base NWO, I'm trying:

apt update
apt install -y parallel git
git clone https://github.com/ansible-community/collection_migration.git
cd collection_migration
python3.7 -m venv .venv
. .venv/bin/activate
python3.7 -m pip install -r requirements.in -c requirements.txt
python3.7 -m migrate -s scenarios/nwo --convert-symlinks

Takes absolutely forever though. And at the end, it errored out:

ValueError: Each plugin needs to be assigned to one collection only. module_utils/network/nxos/utils/utils.py has already been processed as a part of 'nxos' collection.

@geerlingguy
Copy link
Collaborator Author

I got things back to a working-ish state (see PR #17), but now I'm getting more sanity test errors:

ERROR: Found 5 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/k8s.py:0:0: parameter-list-no-elements: Argument 'merge_type' in argument_spec defines type as list but elements is not defined
ERROR: plugins/modules/k8s_info.py:0:0: parameter-list-no-elements: Argument 'field_selectors' in argument_spec defines type as list but elements is not defined
ERROR: plugins/modules/k8s_info.py:0:0: parameter-list-no-elements: Argument 'label_selectors' in argument_spec defines type as list but elements is not defined
ERROR: plugins/modules/k8s_service.py:0:0: parameter-list-no-elements: Argument 'merge_type' in argument_spec defines type as list but elements is not defined
ERROR: plugins/modules/k8s_service.py:0:0: parameter-list-no-elements: Argument 'ports' in argument_spec defines type as list but elements is not defined

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant