Well, when you visit that URL that results in a HTML response (soft 404) (instead the expected, parsable JSON), the repository/resource apparently doesn’t exist: https://galaxy.ansible.com/v1/roles/?owner__username=geerlingguy&name=composer
So the ansible galaxy tool tries to ensure that composer role exists, but it cannot find that role in the ansible galaxy repository under that user (
geerlingguy) and role (
Ansible Galaxy role page for that
composer role from user
There is an old, closed issue that matches the issue quite well: https://github.com/ansible/ansible/issues/63596
It has been fixed with later releases.
IMHO the ansible galaxy CLI tool is not compatible (anymore) with the current Ansible Galaxy.
It is probably an outdated ansible or ansible galaxy release and should be updated.
Side note: Slightly modifying that URL in the error message results in a correct API call + response btw:
/api part is missing in the URL.