# Import collection fails with "Invalid dependency format"

**URL:** <https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673>\
**Category:** Get Help\
**Tags:** galaxy-ng\
**Created:** [May 15, 2025, 11:27am UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673 "2025-05-15T11:27:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![eace](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eace](https://forum.ansible.com/u/eace)\
**Post date:** [May 15, 2025, 11:27am UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/1 "2025-05-15T11:27:04Z")

</div>

All - I’m learning about Galaxy NG and evaluating for an air-gapped environment. I attempted to upload an internally-authored collection which contains dependencies in this form: `git+https://github.com/ansible-collections/community.general.git`. The reason is that we’ve already set up mirroring from the upstream (GitHub-hosted) collections. In other words - path of least resistance for starters… Anyway on attempting to import the collection, the UI errors with: `Invalid collection metadata. Invalid dependency format: 'git+https://github.com/ansible-collections/community.general.git'`. This is a valid dependency URL and in fact from the command line: `ansible-galaxy collection install git+git@our.gitserver.org:our-project/our_collection_that_refs_ansible_community.git` works, so it just appears that the `galaxy_importer` has not yet been made to accept this format. (Unless I’m mis-interpreting the error.) Is this in the radar? Thank you.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [May 15, 2025, 2:13pm UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/2 "2025-05-15T14:13:17Z")

</div>

It might be more helpful if you paste your actual galaxy file, or at least the part thats relevant.

This seems to be working for me:

```auto
namespace: test
name: col
version: 1.0.0
readme: README.md
authors: []
description: Collection
license_file: LICENSE
tags: []
repository: ''
dependencies:
  'git+https://github.com/ansible-collections/community.general.git': main

```

---

<div class="post-metadata">

**Author:** ![eace](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eace](https://forum.ansible.com/u/eace)\
**Post date:** [May 15, 2025, 2:15pm UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/3 "2025-05-15T14:15:00Z")

</div>

Sure - here is the contents of `dependencies`:

```auto
dependencies:
  'git+https://github.com/ansible-collections/community.general.git': '8.5.0'
  'git+https://github.com/ansible-collections/community.crypto.git': '2.18.0'
  'git+https://github.com/ansible-collections/ansible.posix.git': '1.5.4'
  'git+https://github.com/ansible-collections/kubernetes.core.git': '3.0.1'

```

---

<div class="post-metadata">

**Author:** ![eace](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eace](https://forum.ansible.com/u/eace)\
**Post date:** [May 15, 2025, 3:27pm UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/4 "2025-05-15T15:27:30Z")

</div>

btw if relevant:

```auto
Server version
4.11.0dev
master:878b436e 

```

---

<div class="post-metadata">

**Author:** ![eace](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eace](https://forum.ansible.com/u/eace)\
**Post date:** [May 15, 2025, 3:30pm UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/5 "2025-05-15T15:30:28Z")

</div>

Tried replacing explicit version numbers with main - same result

---

<div class="post-metadata">

**Author:** ![eace](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eace](https://forum.ansible.com/u/eace)\
**Post date:** [May 15, 2025, 3:31pm UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/6 "2025-05-15T15:31:42Z")

</div>

tried removing all but one dependency - same result

---

<div class="post-metadata">

**Author:** ![eace](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eace](https://forum.ansible.com/u/eace)\
**Post date:** [May 15, 2025, 3:37pm UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/7 "2025-05-15T15:37:01Z")

</div>

Replaced dependencies with:

```auto
dependencies: {}

```

And it succeeded in loading but then failed with:

```auto
roles/<redacted>/tasks/main.yaml:34:11: syntax-check[unknown-module]: couldn't resolve module/action 'kubernetes.core.k8s'. This often indicates a misspelling, missing collection, or incorrect module path. 

```

(repeats for many roles in the collection)  
interesting…

---

<div class="post-metadata">

**Author:** ![eace](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eace](https://forum.ansible.com/u/eace)\
**Post date:** [May 15, 2025, 4:07pm UTC](https://forum.ansible.com/t/import-collection-fails-with-invalid-dependency-format/42673/8 "2025-05-15T16:07:33Z")

</div>

Just to add some info, I’m deploying Galaxy via the operator following the quick start here:

> **[Quickstart - Galaxy-Operator](https://ansible.readthedocs.io/projects/galaxy-operator/en/latest/quickstart/)**
>
> Galaxy-Operator

I’m deploying into an actual k8s cluster, not Minikube. I tried following the process from tag `2024.5.8` in case it was a regression in the `main` branch but same. So I think at this time, the capability is not implemented. Fairly easy to reproduce based on the quick start:

```auto
git clone https://github.com/ansible/galaxy-operator
kubectl apply -k galaxy-operator
kubectl create -f galaxy-operator/galaxy-cr.yaml

```

(except in my case, to use the ingress in an actual cluster, create the CR this way):

```auto
sed 's/hostname: localhost/hostname: hostname.myco.org/'\
  galaxy-cr.yaml | kubectl -n galaxy apply -f -

```

Then access Galaxy via the ingress:

[https://hostname.myco.org/](https://hostname.myco.org/)
