# Unable to import role into galaxy namespace based on github org

**URL:** <https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699>\
**Category:** Get Help\
**Tags:** galaxy-ng\
**Created:** [April 17, 2026, 10:34am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699 "2026-04-17T10:34:56Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ipa-big1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ipa-big1/32/10610_2.png) [@ipa-big1](https://forum.ansible.com/u/ipa-big1)\
**Post date:** [April 17, 2026, 10:34am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/1 "2026-04-17T10:34:56Z")

</div>

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](https://github.com/eclipse-slm/slm-ansible-role-docker)  
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:

```auto
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:

```auto
===== 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:

```auto
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

```auto
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](https://github.com/ansible/galaxy/issues/3344)

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [April 17, 2026, 6:04pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/2 "2026-04-17T18:04:24Z")

</div>

> [@ipa-big1](#):
>
> `ansible-galaxy role import --token $AG_TOKEN eclipse_slm slm-ansible-role-docker`

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

---

<div class="post-metadata">

**Author:** ![ipa-big1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ipa-big1/32/10610_2.png) [@ipa-big1](https://forum.ansible.com/u/ipa-big1)\
**Post date:** [April 18, 2026, 5:41pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/3 "2026-04-18T17:41:38Z")

</div>

> [@shertel](#):
>
> 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:

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

```

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [April 20, 2026, 12:19pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/4 "2026-04-20T12:19:05Z")

</div>

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](https://forum.ansible.com/t/ansible-galaxy-s-role-import-enhancements-and-fixes-for-the-new-year/3206).

Edit: by the way, I looked at the [recent role import failures](https://galaxy.ansible.com/ui/standalone/imports/?page=1&state=FAILED) 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.

---

<div class="post-metadata">

**Author:** ![ipa-big1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ipa-big1/32/10610_2.png) [@ipa-big1](https://forum.ansible.com/u/ipa-big1)\
**Post date:** [April 22, 2026, 2:15pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/5 "2026-04-22T14:15:26Z")

</div>

> by the way, I looked at the [recent role import failures](https://galaxy.ansible.com/ui/standalone/imports/?page=1&state=FAILED) 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:

```auto
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:

```auto
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:

```Successfully
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

```

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [April 23, 2026, 12:08pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/6 "2026-04-23T12:08:51Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Esme\_Hong](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@Esme\_Hong](https://forum.ansible.com/u/Esme_Hong)\
**Post date:** [May 1, 2026, 10:38am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/7 "2026-05-01T10:38:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ipa-big1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ipa-big1/32/10610_2.png) [@ipa-big1](https://forum.ansible.com/u/ipa-big1)\
**Post date:** [May 4, 2026, 12:22pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/8 "2026-05-04T12:22:43Z")

</div>

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

Running this (adding -vvvv):

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

```

return this:

```auto
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](https://galaxy.ansible.com/ui/tasks/)

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/c/c1954e1d56f434a617bda8d779154e6c6d047dec.png)

> 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](https://github.com/ansible/galaxy/issues/1315#issuecomment-438710367) 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:

```auto
galaxy_info:
  namespace: eclipse_slm
  role_name: docker

```

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

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

```

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [May 5, 2026, 10:35am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/9 "2026-05-05T10:35:17Z")

</div>

Hi @ipa-big1

I can see the task [Ansible Galaxy](https://galaxy.ansible.com/ui/task/019df2ee-8824-7e77-8838-b3ec1aebef71/) where you attempted to import this role into Galaxy likely using:

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

```

I saw in the initial post you tried:

```auto
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](https://github.com/ansible/galaxy_ng/blob/main/galaxy_ng/app/api/v1/tasks.py#L297-L299) as it [overrides](https://github.com/ansible/galaxy_ng/blob/main/galaxy_ng/app/api/v1/tasks.py#L366-L367) the `clone_url`.

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

```auto
galaxy_info:
  namespace: eclipse_slm
  role_name: docker

```

---

<div class="post-metadata">

**Author:** ![ipa-big1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ipa-big1/32/10610_2.png) [@ipa-big1](https://forum.ansible.com/u/ipa-big1)\
**Post date:** [May 5, 2026, 11:58am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/10 "2026-05-05T11:58:46Z")

</div>

> And this also returned HTTP 500?

Yes. I retried it with `meta/main.yml`

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

```

and

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

```

both tries return

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

```

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [June 15, 2026, 9:36am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/11 "2026-06-15T09:36:50Z")

</div>

Hey @ipa-big1

Last month after testing the `github_user` and `github_repo` query parameters with a simple `GET` request I was getting a HTTP 500 Internal Server Error from Galaxy too.

I reported this to the Galaxy team and a fix for `github_user` and `github_repo` query params was pushed in [Fix `github_repo` and `github_user` query params for legacy imports (… · ansible/galaxy\_ng@de73227 · GitHub](https://github.com/ansible/galaxy_ng/commit/de732272e63e14d2f60c621aa7adb4524964ad65)

Are you able to try importing your role again? You might need to use the REST API directly and use `alternate_clone_url` too.

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [June 16, 2026, 8:45am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/12 "2026-06-16T08:45:18Z")

</div>

Hey @ipa-big1

We had a similar issue in [Namespace: mmul-it - #13 by rascasoft](https://forum.ansible.com/t/namespace-mmul-it/45861/13) and @rascasoft noticed a typo in the HTTP request snippet I sent.

Can you re-try with the following payload:

```auto
curl -X 'POST' \
  "https://galaxy.ansible.com/api/v1/imports/" \
  -H 'Content-Type: 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"}'

```

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [June 17, 2026, 7:40am UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/13 "2026-06-17T07:40:33Z")

</div>

Hi again @ipa-big1

The following should work via the `ansible-galaxy role import` command:

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

```

The HTTP 500 error may have been related to [Fix `github_repo` and `github_user` query params for legacy imports (… · ansible/galaxy\_ng@de73227 · GitHub](https://github.com/ansible/galaxy_ng/commit/de732272e63e14d2f60c621aa7adb4524964ad65).

Ensure the following in your `meta/main.yml`:

```yaml
# meta/main.yml
galaxy_info:
  author: Benjamin Goetz
  namespace: eclipse_slm
  role_name: docker

```

Can you please try this first before trying via the REST API.

---

<div class="post-metadata">

**Author:** ![ipa-big1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ipa-big1/32/10610_2.png) [@ipa-big1](https://forum.ansible.com/u/ipa-big1)\
**Post date:** [June 17, 2026, 3:23pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/14 "2026-06-17T15:23:53Z")

</div>

with `meta/main.yml`:

```auto
galaxy_info:
  author: Benjamin Goetz
  namespace: eclipse_slm
  role_name: docker

```

… and running:

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

i get:

```auto
ansible-galaxy [core 2.20.6]
  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, May 20 2026, 02:59:11) [GCC 14.2.0] (/usr/local/bin/python3)
  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)

```

Running:

```auto
curl -X 'POST' \
  "https://galaxy.ansible.com/api/v1/imports/" \
  -H 'Content-Type: 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"}'

```

with the same `meta/main.yml` worked, and the role is now available in the galaxy. Great. Thanks for your support

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 17, 2026, 3:24pm UTC](https://forum.ansible.com/t/unable-to-import-role-into-galaxy-namespace-based-on-github-org/45699/15 "2026-07-17T15:24:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
