Unable to import role into galaxy namespace based on github org

Hey everyone,

i am not able to import roles into my newly created namespace which is based on one of my github orgs. The data:

github repo: GitHub - eclipse-slm/slm-ansible-role-docker · GitHub
github org: eclipse-slm

ansible-galaxy role namespace: eclipse_slm

so github-org and role-namespace differ by “-” and “_”

what i’ve tried so far:

ansible-galaxy role import --token $AG_TOKEN ipa-big slm-ansible-role-docker
ansible-galaxy role import --token $AG_TOKEN eclipse_slm slm-ansible-role-docker

ansible-galaxy role import --token $AG_TOKEN ipa-big eclipse_slm.slm-ansible-role-docker
ansible-galaxy role import --token $AG_TOKEN ipa-big eclipse-slm.slm-ansible-role-docker
ansible-galaxy role import --token $AG_TOKEN eclipse_slm eclipse-slm.slm-ansible-role-docker

It always fails when trying to clone the roles repo:

===== CLONING REPO =====
cloning https://github.com/eclipse_slm/eclipse-slm.slm-ansible-role-docker ...
cloning failed: Cloning into '/tmp/tmpdetmt7fh/eclipse-slm.slm-ansible-role-docker'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled

I also tried accessing the API directly:

curl -X 'POST' \
  "https://galaxy.ansible.com/api/v1/imports/" \
  -H 'accept: application/json' \
  -H "Authorization: Token ${AG_TOKEN}" \
  --data-raw '{"github_repo":"slm-ansible-role-docker","github_user":"ipa-big", "alternate_clone_url": "https://github.com/eclipse-slm/slm-ansible-role-docker"}'

and

curl -X 'POST' \
  "https://galaxy.ansible.com/api/v1/imports/" \
  -H 'accept: application/json' \
  -H "Authorization: Token ${AG_TOKEN}" \
  --data-raw '{"github_repo":"slm-ansible-role-docker","github_user":"eclipse_slm", "alternate_clone_url": "https://github.com/eclipse-slm/slm-ansible-role-docker"}'

both requests fail with status code 500. Same applies for using the import site of the UI. Looks like my issue is similar to ##3344

Have you tried ansible-galaxy role import --token $AG_TOKEN eclipse-slm slm-ansible-role-docker?

Yes. Using “eclipse-slm” as github user does not work at all. It returns 500:

[ERROR]: None (HTTP Code: 500, Message: Internal Server Error)

Does it progress any further if the repo username and repo are correct? You said it was failing when attempting to clone the repo (which makes sense since the user was wrong).

Since you have the role_name and namespace defined in the meta/main.yml, I’d expect the real Github user/repo to be passed to ansible-galaxy. There’s a related post here on those features Ansible Galaxy’s role import enhancements and fixes for the new year.

Edit: by the way, I looked at the recent role import failures and I see a bunch of variations you’ve tried, but I don’t see any using eclipse-slm as the Github user, so it might be worth trying again.

by the way, I looked at the recent role import failures and I see a bunch of variations you’ve tried, but I don’t see any using eclipse-slm as the Github user, so it might be worth trying again.

With trying:

ansible-galaxy role import --token $AG_TOKEN eclipse-slm slm-ansible-role-docker

and this failing with Status Code 500, I tried using “eclipse-slm” as github user right? Or do i misunderstand something at this point? The tries with “eclipse-slm” do not show up in the galaxy task list because they do not even initiate the import process and consequently they do not show up at all.

Does it progress any further if the repo username and repo are correct? You said it was failing when attempting to clone the repo (which makes sense since the user was wrong).

If i use “ipa-big” (my github username) or “eclipse_slm” (the galaxy namespace - as “eclipse-slm” the real github org name is not possible) the import process starts but fails when cloning. When using “eclipse-slm” the import process doesnt even start in first place.

Since you have the role_name and namespace defined in the meta/main.yml , I’d expect the real Github user/repo to be passed to ansible-galaxy .

As you mentioned the meta/main.yml i now remove namespace and role_name from meta and retried:

ansible-galaxy role import --token $AG_TOKEN ipa-big slm-ansible-role-docker
# and:
ansible-galaxy role import --token $AG_TOKEN eclipse_slm slm-ansible-role-docker
tippe oder füge den Code hier ein

… but still get the same result:

Starting import: task_id=2148100314115555454674309565326574450, pulp_id=019db585-bb97-74d1-81cb-886b81284372

==== PARAMETERS ====
importer username: ipa-big
matched user: ipa-big id:3120
github_user: eclipse_slm
github_repo: slm-ansible-role-docker
github_reference: None
alternate_clone_url: None
alternate_namespace_name: None
alternate_role_name: None

==== CHECK FOR MATCHING ROLE(S) ====
user:eclipse_slm repo:slm-ansible-role-docker did not match any existing roles

===== CLONING REPO =====
cloning https://github.com/eclipse_slm/slm-ansible-role-docker ...
cloning failed: Cloning into '/tmp/tmpkcvbq6ib/slm-ansible-role-docker'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled

I should have been clearer, but if you need to upload a role to a different namespace, you MUST provide the namespace in the meta/main.yml. You can provide a different role name on the CLI, but there’s no corresponding toggle for the namespace.

With trying:

ansible-galaxy role import --token $AG_TOKEN eclipse-slm slm-ansible-role-docker

and this failing with Status Code 500, I tried using “eclipse-slm” as github user right? Or do i misunderstand something at this point? The tries with “eclipse-slm” do not show up in the galaxy task list because they do not even initiate the import process and consequently they do not show up at all.

Yes, that’s the command I was asking you to reattempt. The positional arguments are used to compose the Github repo to clone. I have no idea what you mean that it doesn’t show up at all, since you’ve only shared an error with no context. Can you run it with more verbosity -vvvv and share the full output instead of the snippet?

Hey! I’ve seen similar issues when the GitHub organization’s third-party application restrictions are turned on. Even if you’re an owner, you sometimes have to explicitly ‘Grant’ access to the Ansible Galaxy app within the organization settings on GitHub for it to actually see the repos.
Another thing to double-check is that your meta/main.yml has the correct namespace and role name matching the new org exactly. Sometimes Galaxy gets hung up on the old cache if there’s even a tiny mismatch in the naming convention.

Can you run it with more verbosity -vvvv and share the full output instead of the snippet?

Running this (adding -vvvv):

ansible-galaxy role import -vvvv --token $AG_TOKEN eclipse-slm slm-ansible-role-docker

return this:

ansible-galaxy [core 2.20.4]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-galaxy
  python version = 3.12.13 (main, Apr  7 2026, 04:52:21) [GCC 14.2.0] (/usr/local/bin/python3.12)
  jinja version = 3.1.6
  pyyaml version = 6.0.3 (with libyaml v0.2.5)
No config file found; using defaults
Initial connection to galaxy_server: https://galaxy.ansible.com
Opened /root/.ansible/galaxy_token
Calling Galaxy at https://galaxy.ansible.com/api/
Found API version 'v3, pulp-v3, v1' with Galaxy server default (https://galaxy.ansible.com/api/)
Calling Galaxy at https://galaxy.ansible.com/api/v1/imports/
[ERROR]: None (HTTP Code: 500, Message: Internal Server Error)

… and regarding this:

I have no idea what you mean that it doesn’t show up at all, since you’ve only shared an error with no context.

… i mean that when i run the ansible-galaxy import command mentioned before, which gives me status code 500, this import try does not show up in the ansible ui at Ansible Galaxy

Even if you’re an owner, you sometimes have to explicitly ‘Grant’ access to the Ansible Galaxy app within the organization settings on GitHub for it to actually see the repos.

According to this: Create a namespace for organization · Issue #1315 · ansible/galaxy · GitHub I now found out that Ansible Galaxy has no full access to the github organisation. As the organization “eclipse-slm” is an eclipse-owned org and i’m just a contributer to this org i have to send a request for full access to the org - what i did now. This will take a while i guess.

Another thing to double-check is that your meta/main.yml has the correct namespace and role name matching the new org exactly.

My galaxy meta infos are:

galaxy_info:
  namespace: eclipse_slm
  role_name: docker

i also tried this to match github repo with role name:

galaxy_info:
  namespace: eclipse_slm
  role_name: slm-ansible-role-docker

Hi @ipa-big1

I can see the task Ansible Galaxy where you attempted to import this role into Galaxy likely using:

ansible-galaxy role import --token $AG_TOKEN eclipse_slm slm-ansible-role-docker

I saw in the initial post you tried:

curl -X 'POST' \
  "https://galaxy.ansible.com/api/v1/imports/" \
  -H 'accept: application/json' \
  -H "Authorization: Token ${AG_TOKEN}" \
  --data-raw '{"github_repo":"slm-ansible-role-docker","github_user":"eclipse_slm", "alternate_clone_url": "https://github.com/eclipse-slm/slm-ansible-role-docker"}'

And this also returned HTTP 500? I was about to suggest using alternate_clone_url: galaxy_ng/galaxy_ng/app/api/v1/tasks.py at main · ansible/galaxy_ng · GitHub as it overrides the clone_url.

When you tried this did you have the following in your meta/main.yml?

galaxy_info:
  namespace: eclipse_slm
  role_name: docker

And this also returned HTTP 500?

Yes. I retried it with meta/main.yml

galaxy_info:
  namespace: eclipse-slm # also tried eclipse_slm
  role_name: docker

and

galaxy_info:
  namespace: eclipse-slm # also tried eclipse_slm
  role_name: slm-ansible-role-docker

both tries return

<!doctype html>
<html lang="en">
<head>
  <title>Server Error (500)</title>
</head>
<body>
  <h1>Server Error (500)</h1><p></p>
</body>
</html>