# Galaxy NG token not working for organization namespace/role import

**URL:** <https://forum.ansible.com/t/galaxy-ng-token-not-working-for-organization-namespace-role-import/2843>\
**Category:** Get Help\
**Tags:** galaxy-ng\
**Created:** [December 11, 2023, 10:26am UTC](https://forum.ansible.com/t/galaxy-ng-token-not-working-for-organization-namespace-role-import/2843 "2023-12-11T10:26:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benno](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@benno](https://forum.ansible.com/u/benno)\
**Post date:** [December 11, 2023, 10:26am UTC](https://forum.ansible.com/t/galaxy-ng-token-not-working-for-organization-namespace-role-import/2843/1 "2023-12-11T10:26:26Z")

</div>

Hi everybody,

this is a reframed problem statement that originated from this post: [Galaxy NG: Role Import into organizational namespace fails with "ERROR! None (HTTP Code: 403, Message: Forbidden)"](http://forum.ansible.com/t/galaxy-ng-role-import-into-organizational-namespace-fails-with-error-none-http-code-403-message-forbidden/2733)

What I have:

- A personal galaxy namespace `stevenengland`/github user `stevenengland`
- A organizational galaxy namespace `paperless_ngx`/github organization `paperless-ngx`
- A new Galaxy NG token

For `stevenengland` I am an owner:

```auto
$ curl -s https://galaxy.ansible.com/api/v1/namespaces/6647/ | jq .summary_fields.owners
[
  {
    "id": 5224,
    "username": "stevenengland"
  }
]

```

For `paperless_ngx` I am also an owner:

```auto
$ curl -s https://galaxy.ansible.com/api/v1/namespaces/9590/ | jq .summary_fields.owners
[
  {
    "id": 5226,
    "username": "paperlessngx-bot"
  },
  {
    "id": 5225,
    "username": "shamoon"
  },
  {
    "id": 5224,
    "username": "stevenengland"
  }
]

```

Imports on my old users repo (that I had before it was migrated to an organization long time ago) work pretty fine:

```auto
ansible-galaxy role import -vvvvv --role-name stevenengland.paperless_ngx --api-key <NEW NG TOKEN FOR STEVENENGLAND> stevenengland paperless_ngx_ansible_role

```

Imports on the organization repo fail:

```auto
ansible-galaxy role import -vvvvv --role-name paperless_ngx.paperless_ngx --api-key <NEW NG TOKEN FOR STEVENENGLAND> paperless-ngx ansible

ansible-galaxy [core 2.15.2]
  config file = None
  configured module search path = ['/home/wsldev/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/wsldev/paperless-ngx_ansible/.venv/lib/python3.10/site-packages/ansible
  ansible collection location = /home/wsldev/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/wsldev/paperless-ngx_ansible/.venv/bin/ansible-galaxy
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/home/wsldev/paperless-ngx_ansible/.venv/bin/python3)
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
Initial connection to galaxy_server: https://galaxy.ansible.com
Opened /home/wsldev/.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: 403, Message: Forbidden)

```

So what I would summarize so far: New NG tokens do provide permission to import roles in a general manner. But there seems to be confusion when it comes to organizational accounts…

@tannerjc Sorry for pulling you in but I saw you helping a few people struggeling with imports and namespace confusions and access control. I am really running out of ideas of what I can check from my side anymore ☹

---

<div class="post-metadata">

**Author:** ![benno](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@benno](https://forum.ansible.com/u/benno)\
**Post date:** [December 12, 2023, 8:40am UTC](https://forum.ansible.com/t/galaxy-ng-token-not-working-for-organization-namespace-role-import/2843/2 "2023-12-12T08:40:07Z")

</div>

Uhhhhh!!! Some Wonders happened this night!

For the third and new namespace `paperless-ngx` (ID 5391 in contrast to the original namespace `paperless_ngx` with ID 9590) there are now owners that yesterday were not and a testimport today was successful. I’ll check where this import went to and if this is the desired goal but so far: Thanks to the anonymous helper in the background!
