Namespace: mmul-it

Namespace Request

Namespace: mmul-it

Description

Roles published by MiaMammaUsaLinux.org

GitHub Org Link

Admins

rascasoft

I would like to ask you for rename the role namespace mmul to mmul-it only. If it’s not possible, just create the mmul-it namespace so I can upload roles there.

Hi @rascasoft

Thank you for submitting this namespace request.

Two things:

  1. Due to Galaxy namespace naming limitations, the name of the namespace cannot have a - in it, please confirm if you’re happy with mmul_it for the namespace name?
  2. We cannot rename an existing role namespace.

Hi @dbrennand, many thanks for your answer.

I’m unable to import new versions of the role because my GitHub projects are under https://github.com/mmul-it/ and if I try to import, by a GitHub action or by hand I get a 500:

$ ansible-galaxy role import --token $GTOKEN --branch main mmul-it kpa_generator
ERROR! None (HTTP Code: 500, Message: Internal Server Error)

If I instead try to use the actual role namespace which is mmul I get:

$ ansible-galaxy role import --token $GTOKEN --branch main mmul kpa_generator
Successfully submitted import request 2152258394498257967616849651627835768
Starting import: task_id=2152258394498257967616849651627835768, pulp_id=019e8288-15ed-7704-9e46-27e3f875c178

==== PARAMETERS ====
importer username: rascasoft
matched user: rascasoft id:4599
github_user: mmul
github_repo: kpa_generator
github_reference: main
alternate_clone_url: None
alternate_namespace_name: None
alternate_role_name: None

==== CHECK FOR MATCHING ROLE(S) ====
user:mmul repo:kpa_generator did not match any existing roles

===== CLONING REPO =====
cloning https://github.com/mmul/kpa_generator ...
cloning failed: Cloning into '/tmp/tmp_hug85ut/kpa_generator'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled

Because I don’t own GitHub mmul and my sources are under mmul-it.

So creating mmul_it with the underscore would not solve the problem. In the past I always used just mmul, but then I deleted the role namespace mmul-it and everything broke. The id was 4753 and I deleted it via:

$ curl -H "Authorization: token $GTOKEN" -X DELETE https://galaxy.ansible.com/api/v1/namespaces/4735/

My need is just to import sources from https://github.com/mmul-it/kpa_generator into mmul.

Is there a way to solve this? In the past, at some point, we solved it (see Unable to import roles anymore: namespace different from github organization - #19 by rascasoft), but in the end I feel like it was because of the existence of the mmul-it namespace role.

Can you help me fix this?

Many thanks!

Raoul

Any news @dbrennand ?

I feel like me deleting the mmul-it namespace somehow broke the relation that was created here by @tannerjc: Unable to import roles anymore: namespace different from github organization - #8 by tannerjc because he set mmul as the provider of mmul-it, and maybe now that mmul-it doesn’t exists anymore this setting got lost.
Can we recreate it?

@dbrennand @tannerjc can you please have a look at this since I am blocked in pushing new versions? Many thanks!

Hey @rascasoft

I’ve looked into this and will try to summarise:

When you deleted the mmul-it legacy namespace via the API, it removed the namespace that Galaxy uses during the initial step of role imports that resolves your github_user (mmul-it) to a LegacyNamespace. That resolution happens before any of the override mechanisms from galaxy_ng#2011 (the namespace field in meta/main.yml or the alternate_namespace_name API parameter) get a chance to run. That’s why you’re seeing a 500 error. The import task fails during that initial lookup.

Unfortunately there isn’t a user-side workaround for this. The override logic that @tannerjc added can remap you to a different namespace, but it needs the initial namespace resolution to succeed first, which requires mmul-it to exist as a LegacyNamespace.

The fix is to recreate the mmul-it legacy namespace in the database and re-establish mmul as its provider. That legacy namespace predates the current hyphen restriction so it cannot be recreated through the normal means.

Thanks for taking the time to explain this @oranod , but it’s not clear to me what should I do to fix the problem.

No problem, @rascasoft I’m aware that you’re blocked on pushing new versions but since the issue is that the mmul-it namespace no longer exists there isn’t a fix on your side. I’ll get back to you about this.

1 Like

@oranod any news on this?

Hey @rascasoft

Could you please try using the alternate_clone_url via the Galaxy REST API.

I think the below command is correct, you want the role in GitHub repository: GitHub - mmul-it/kpa_generator: KPA slides generator Ansible role · GitHub to exist in the mmul role namespace on Galaxy with the role name kpa_generator:

curl -X 'POST' \
  "https://galaxy.ansible.com/api/v1/imports/" \
  -H 'accept: application/json' \
  -H "Authorization: Token ${GTOKEN}" \
  --data-raw '{"github_repo": "kpa_generator", "github_user": "mmul", "alternate_clone_url": "https://github.com/mmul-it/kpa_generator"}'

Can you try this please?

Hi @dbrennand , still no success:

$ curl -X 'POST'   "https://galaxy.ansible.com/api/v1/imports/"   \
  -H 'accept: application/json'   \
  -H "Authorization: Token ${GTOKEN}"   \
  --data-raw '{"github_repo": "kpa_generator", "github_user": "mmul", "alternate_clone_url": "https://github.com/mmul-it/kpa_generator"}'

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

Wait @dbrennand , changing the curl in this way fixed the problem:

$ curl -X 'POST'   "https://galaxy.ansible.com/api/v1/imports/"   \
  -H 'Content-Type: application/json'   \
  -H "Authorization: Token ${GTOKEN}"   \
  --data-raw '{"github_repo": "kpa_generator", "github_user": "mmul", "alternate_clone_url": "https://github.com/mmul-it/kpa_generator"}'
{"results":[{"id":2153821008210868407066805016595163860,"pulp_id":"019ecf93-0b25-721e-864e-c5838bda6ad4","github_user":"mmul","github_repo":"kpa_generator","github_reference":null,"alternate_namespace_name":null,"alternate_role_name":null,"alternate_clone_url":"https://github.com/mmul-it/kpa_generator","summary_fields":{"role":{"name":null}}}]}

So with -H 'Content-Type: application/json' it seems to work. Thanks for showing me this magic secret option :slight_smile:

2 Likes

Excellent news!

Ah yes sorry about that, an oversight on my part. The Content-Type: application/json header just tells Galaxy that our payload is in JSON format.

Glad it is working! And thanks for spotting that because it may help with another thread!

2 Likes