ansible / galaxy

Legacy Galaxy still available as read-only on https://old-galaxy.ansible.com - looking for the new galaxy -> https://github.com/ansible/galaxy_ng
Apache License 2.0
855 stars 329 forks source link

Galaxy fails to accept new collection #2223

Open michalmedvecky opened 4 years ago

michalmedvecky commented 4 years ago

Bug Report

SUMMARY

Publishing collection does not work

STEPS TO REPRODUCE
ansible-galaxy collection build
ansible-galaxy collection publish -c --api-key <redacted> michalmedvecky-krb5-1.0.0.tar.gz
EXPECTED RESULTS

Should be published .... ?

ACTUAL RESULTS
ERROR! Galaxy import process failed: __new__() takes 3 positional arguments but 4 were given (Code: None)

This happens with the official Galaxy server. I tried running my own galaxy in Docker (from master branch), and fails the same way.

michalmedvecky commented 4 years ago

Changing https://github.com/ansible/galaxy/blob/devel/galaxy/importer/loaders/role.py#L232

to

dependencies.append(models.DependencyInfo(*name.rsplit('.', 1)))

2 changed to 1 made the thing work.

I can't really tell what's happening.

michalmedvecky commented 4 years ago

@chouseknecht this is happening with the production galaxy.ansible.com, so I don't think priority/low is the right tag

awcrosby commented 4 years ago

@michalmedvecky it sounds like you might be putting a collection name into the role dependencies file, can you check that?

michalmedvecky commented 4 years ago

Indeed. What's wrong about this approach?

awcrosby commented 4 years ago

@michalmedvecky the role dependencies file is not supported in collections. (and also galaxy is expecting roles, not collections, in the role dependencies file, so the difference in format is why we are seeing an exception).

If you are trying to have collection_a depend on collection_b, an example of collection dependencies is shown here: https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html