Skip to content
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

500 when ansible-client acceses distribution that does not point to repository #909

Closed
ipanova opened this issue Apr 12, 2022 · 0 comments · Fixed by #911
Closed

500 when ansible-client acceses distribution that does not point to repository #909

ipanova opened this issue Apr 12, 2022 · 0 comments · Fixed by #911

Comments

@ipanova
Copy link
Member

ipanova commented Apr 12, 2022

Version
pulp-ansible 0.14

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

$ pulp ansible distribution create --name "test" --base-path "test"
Started background task /pulp/api/v3/tasks/6cc0bcd8-e767-47ec-85a4-fc229ba72c6c/
Done.
{
  "pulp_href": "/pulp/api/v3/distributions/ansible/ansible/66fbcc7d-4f9a-4dcd-ac0d-f917b1d70716/",
  "pulp_created": "2022-04-12T09:43:01.329738Z",
  "base_path": "test",
  "content_guard": null,
  "name": "test",
  "repository": null,
  "repository_version": null,
  "client_url": "https://pulp3-source-fedora34.fluffy.example.com/pulp_ansible/galaxy/test/",
  "pulp_labels": {}
}

(pulp) [vagrant@pulp3-source-fedora34 pulpcore]$ ansible-galaxy install -vv elasticsearch,6.2.4 -c -s https://pulp3-source-fedora34.fluffy.example.com/pulp_ansible/galaxy/test/
ansible-galaxy [core 2.12.4]
  config file = None
  configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/pulp/lib64/python3.9/site-packages/ansible
  ansible collection location = /home/vagrant/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/lib/pulp/bin/ansible-galaxy
  python version = 3.9.7 (default, Aug 30 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
  jinja version = 3.0.1
  libyaml = True
No config file found; using defaults
Starting galaxy role install process
- downloading role 'elasticsearch', owned by 
[WARNING]: - elasticsearch was NOT installed successfully: None (HTTP Code: 500, Message: Internal Server Error)
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

Traceback form the logs:

pulp [e4a12db90fe04f448772c444301dbb21]:  - admin [12/Apr/2022:09:43:11 +0000] "GET /pulp_ansible/galaxy/test/api/v1/roles/?owner__username=&name=elasticsearch HT>
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]: AttributeError: 'NoneType' object has no attribute 'latest_version'
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     distro_content = distro.repository.latest_version().content
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/home/vagrant/devel/pulp_ansible/pulp_ansible/app/galaxy/views.py", line 68, in get_queryset
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     queryset = self.filter_queryset(self.get_queryset())
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/rest_framework/mixins.py", line 38, in list
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     return self.list(request, *args, **kwargs)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/rest_framework/generics.py", line 199, in get
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     response = handler(request, *args, **kwargs)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     raise exc
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     self.raise_uncaught_exception(exc)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     response = self.handle_exception(exc)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     return self.dispatch(request, *args, **kwargs)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/django/views/generic/base.py", line 70, in view
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     return view_func(*args, **kwargs)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     response = wrapped_callback(request, *callback_args, **callback_kwargs)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:     response = get_response(request)
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]:   File "/usr/local/lib/pulp/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]: Traceback (most recent call last):
Apr 12 09:43:11 pulp3-source-fedora34.fluffy.example.com gunicorn[100411]: pulp [e4a12db90fe04f448772c444301dbb21]: django.request:ERROR: Internal Server Error: /pulp_ansible/galaxy/test/api/v1/roles/

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here. Please provide links to any previous discussions via Discourse or Bugzilla.

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

Successfully merging a pull request may close this issue.

1 participant