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

Galaxy versions api not returning a record with page_size=50 on role cloudalchemy.prometheus #2912

Open
nrdufour opened this issue Apr 10, 2022 · 3 comments

Comments

@nrdufour
Copy link

Bug Report

SUMMARY

If you try to retrieve version 2.10.0 of role cloudalchemy.prometheus, ansible-galaxy will claim the version doesn't exist even though it's present.

STEPS TO REPRODUCE

Use the following Ansible version:

ansible 2.10.8
...
  python version = 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0]

And set the following in requirements.yml:

  - src: cloudalchemy.prometheus
    version: 2.10.0

And finally, retrieve the role with ansible-galaxy install -r ./requirements.yml

EXPECTED RESULTS

The role is properly installed.

ACTUAL RESULTS

By fetching the role with ansible-galaxy install -r ./requirements.yml
you obtain the following:

Starting galaxy role install process
- downloading role 'prometheus', owned by cloudalchemy
[WARNING]: - cloudalchemy.prometheus was NOT installed successfully: - the specified version (2.10.0) of cloudalchemy.prometheus was not found in the list of available
versions
...
...
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

Here is the same with -vvvv:

Starting galaxy role install process
Processing role cloudalchemy.prometheus
Initial connection to galaxy_server: https://galaxy.ansible.com
...
Calling Galaxy at https://galaxy.ansible.com/api/
Found API version 'v1, v2' with Galaxy server default (https://galaxy.ansible.com/api/)
- downloading role 'prometheus', owned by cloudalchemy
Calling Galaxy at https://galaxy.ansible.com/api/v1/roles/?owner__username=cloudalchemy&name=prometheus
Calling Galaxy at https://galaxy.ansible.com/api/v1/roles/22403/versions/?page_size=50
Calling Galaxy at https://galaxy.ansible.com/api/v1/roles/22403/versions/?page=2&page_size=50
Calling Galaxy at https://galaxy.ansible.com/api/v1/roles/22403/versions/?page=3&page_size=50
[WARNING]: - cloudalchemy.prometheus was NOT installed successfully: - the specified version (2.10.0) of cloudalchemy.prometheus was not found in the list of available
versions 
...
...
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

I did dig a bit into those api calls and they indeed return no version 2.10.0.
But if you change the page_size value to anything else than 50 (like 40 or 60), then suddenly this version will appear in page 2.
Would this mean that the api has a pagination problem?

@twoequaldots
Copy link

This is also reproducible on this version of ansible:

ansible-playbook [core 2.12.4]
...
  executable location = /usr/bin/ansible-playbook
  python version = 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0]
  jinja version = 3.0.3
  libyaml = True

@jwbennet
Copy link

I hit this same issue with ansible-galaxy 2.14.1. I checked the API calls using verbose mode like described above and when Galaxy returns the final page of results it repeats some version numbers like they were not sorted prior to pagination.

@s-hertel
Copy link

s-hertel commented Sep 8, 2023

This will affect all versions of ansible-galaxy, because it's an issue with the Galaxy server.

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

No branches or pull requests

4 participants