Unable to import roles anymore: namespace different from github organization

Hi everybody,
I ended up in opening this bug Unable to import roles anymore: namespace different from github organization · Issue #3299 · ansible/galaxy · GitHub because I can’t find out how to import my roles anymore.

Even if my Galaxy namespace (mmul) is different from my GitHub organization (mmul-it), things worked before, but today if I do:

$ ansible-galaxy role import -vvvv --token <REDACTED> --role-name mmul.kubelab mmul-it kubelab

I’m getting this error message:

ansible-galaxy [core 2.16.0]
  config file = /home/rasca/Git/mmul-it/kubelab/ansible.cfg
  configured module search path = ['/home/rasca/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rasca/Labs/venvs/ansible/lib/python3.10/site-packages/ansible
  ansible collection location = /home/rasca/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rasca/Labs/venvs/ansible/bin/ansible-galaxy
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/home/rasca/Labs/venvs/ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /home/rasca/Git/mmul-it/kubelab/ansible.cfg as config file
Initial connection to galaxy_server: https://galaxy.ansible.com/api/
Opened /home/rasca/.ansible/galaxy_token
Calling Galaxy at https://galaxy.ansible.com/api/
Found API version 'v3, pulp-v3, v1' with Galaxy server beta (https://galaxy.ansible.com/api/)
Calling Galaxy at https://galaxy.ansible.com/api/v1/imports/
ERROR! None (HTTP Code: 403, Message: Forbidden)

Does anyone have any suggestion on this?

Many thanks,

Raoul

I’ve lost also access to my namespace. After login, I become markuman0 which has not access to my former namespace markuman.

Youe issue might be solved if you just import from public, without using the --token or import from SCM/github.com.

@markuman I just fixed your namespaces. Can you check again please?

Yes, looks good now @tannerjc

But is this behaviour somewhere announced?
Or the workflow how to retain the access?

@markuman it’s a longstanding bug in the new galaxy that I’ve been trying to find the root cause of for a while now.

@tannerjc somewhere it was linked correctly

Bildschirmfoto vom 2023-12-04 20-05-47

@markuman it’s no longer like that though …

image

@rascasoft I’ve set mmul as the provider of mmul-it which should give you permission to upload/delete roles from that namespace.

I don’t think that the galaxy cli or API have ever supported <namespace>.<name> for the --role-name argument. Had you been using this up till now?

It seems ti work now, thanks.

About the namespace.role name it was just a test, so nothing to worry about.

Many thanks!

@tannerjc there’s another bit that it’s worth fixing, if you can. There’s still the mmul-it namespace, that can be removed to make everything clean.

Many thanks again,

Raoul

@tannerjc hi again, I feel like this is not a “bit” as I was writing before: today I’ve tried to import the third role (kpa_generator) inside my mmul namespace ( Use native GitHub Action for Galaxy import · mmul-it/kpa_generator@9ec1c88 · GitHub ), and it seems to have worked, but it imported the role inside mmul-it which at this point needs to be deleted at all.

Can you help me also on this?

Many thanks,

Raoul

If the role is hosted in MMUL · GitHub, it’s expected that it get’s imported into the “mmul-it”. Currently, the only way a role hosted in MMUL · GitHub could end up in the “mmul” namespace is if it existed on old-galaxy and was grandfathered in. There are plans in the roadmap to try to enable the workflow you desire, but it’s not currently possible.

Do you own “mmul” on github? docs for changing a role namespace

@tannerjc I’m really confused. Actually I’ve a mixed situation that needs to be fixed. It’s no big deal to me to change to namespace to mmul-it (I don’t own GitHub’s mmul), but I need help on this since I cannot do it on my own, and actually even if I see two roles under mmul-it a namespace with that name doesn’t exists.
My rascasoft user in Galaxy can see just its namespace and the mmul one:

Can this be fixed on your side?

@tannerjc are there news on this? I need to understand how I to set up the import process and then, in case, revisit the documentation of my projects.

Let me know if I can do anything to accelerate the fixing process.

Many thanks.

Hey @tannerjc any news on this?

@rascasoft I’ve been working on a possible solution here support legacy role import overrides for namespace and name. by jctanner · Pull Request #2011 · ansible/galaxy_ng · GitHub

Documentation and examples to follow once the rest of the team and some of the regular stakeholders have chimed in.

Many thanks @tannerjc I see that the commit got merged, and I have two questions:

  1. What do I need to wait to get things working? Because at the moment I still see the import going to the wrong namespace.
  2. Can I (or you) remove the mmul Galaxy namespace that will create a lot of confusion when everything will be working again?

Many thanks again for your support.

Here’s what needs to happen before the patch lands in production:

We need to keep the mmul namespace around until we’ve vetted that you have a way to continue uploading role[versions].

Hey @tannerjc hi! I don’t know where we are with all the needed steps, but I can confirm that things now work as expected, and the fix was good.

So I feel like we can remove the mmul-it namespace, since I’m able to upload roles there https://galaxy.ansible.com/ui/standalone/namespaces/9440/.

NOTE that in the previous messages I asked for mmul namespace to be removed, but that’s an error, it is mmul-it that needs to be removed.

Many thanks!

Raoul