[Bug]: Failed to clone Git submodule
Description
Hi,
I've just created an application on Coolify that pulls from a private GitHub repository. Said repository has a submodule, and Coolify doesn't seem to clone it correctly. I've made sure that Submodules are turned on under Advanced settings for the application. Is there something permission wise that needs to be addressed on the GitHub App itself, or is this a bug?
There are 2 other issues that report the same problem, which have been closed, but with no resolution: #795 #1050
Happy to provide more information if needed 🙂
Minimal Reproduction (if possible, example repository)
- Create an application
- Choose Dockerfile as Build Pack (I've also tried Nixpacks)
- Deploy
- An error occurs and is displayed in the deployment log
Exception or Error
Cloning into '/artifacts/q88kow8'...
Submodule 'prisma' (https://github.com/???/prisma.git) registered for path 'prisma'
Cloning into '/artifacts/q88kow8/prisma'...
fatal: could not read Username for '[https://github.com':](https://github.com'/) No such device or address
fatal: clone of 'https://github.com/???/prisma.git' into submodule path '/artifacts/q88kow8/prisma' failed
Failed to clone 'prisma'. Retry scheduled
Organization name has been redacted from the logs.
Version
v4.0.0-beta.306
Right, I've figured it out. For those who are having the same problem, you need to make sure that the URL for your submodules are relative, and not absolute. For some reason (something to do with authentication I suppose), the submodules will only clone when using the SSH protocol.
These are the changes I made to my .gitmodules file.
[submodule "prisma"]
path = prisma
- url = https://github.com/???/prisma.git
[submodule "prisma"]
path = prisma
+ url = ../prisma.git
This might be worth mentioning in the Coolify knowledge base under the Applications page.
Live saving! great job finding it @marinofranz
@marinofranz you saved my day, Thanks 😊🙏
For coolify :
- Add new git source and authenticate to github
- In project deployment configuration page, go to Advanced tab. Below of Git section, Submodules should be unchecked.
For coolify :
- Add new git source and authenticate to github
- In project deployment configuration page, go to Advanced tab. Below of Git section, Submodules should be unchecked.
I haven't tested this yet as my posted solution works fine but disabling submodules to make them work seems a bit counter-intuitive..
I agree with @marinofranz, this is super unintuitive to turn off git submodules (although I tested this and it does get past the same error which I was having.
Edit
Follow up, this failed on ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn vercel-install" did not complete successfully: exit code: 128 now.
Got the same issue here - the submodule that fails to pull is added to my coolify source github app with the same access rights as the root repository
The solution with changing the git module url didnt work for me, however turning submodules OFF in the Advanced tab did work but as others have already pointed out this is super unintuinitive and seems wrong.
Would be great to get a reaction from the coolify team on this
Same issue
I had a similar to issue as closed issue 1050: cant clone a private repo with a private submodule when using the Git integration. After trying everything else, the relative path also worked in this case. I did not need to uncheck the "submodules" checkbox.
@jonas-klesen did you setup a seperate ssh or did you get it working with Git App Coolify integration? I've tried everything and nothing seems to work.
Can't check right now, but I think I added the server ssh key(s) to the github accounts ssh keys. That was it iirc.
On Thu, Jun 26, 2025, 15:25 Charles @.***> wrote:
CharlesFr left a comment (coollabsio/coolify#2731) https://github.com/coollabsio/coolify/issues/2731#issuecomment-3008492416
@jonas-klesen https://github.com/jonas-klesen did you setup a seperate ssh or did you get it working with Git App Coolify integration? I've tried everything and nothing seems to work.
— Reply to this email directly, view it on GitHub https://github.com/coollabsio/coolify/issues/2731#issuecomment-3008492416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVHLMZL5MOSGCQTIKN3E3D3FPYE5AVCNFSM6AAAAABKEX2CDKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBYGQ4TENBRGY . You are receiving this because you were mentioned.Message ID: @.***>
got it working with relative paths, I think the main limitation there is that all submodules must come from the same GitHub Org/User
Right, I've figured it out. For those who are having the same problem, you need to make sure that the URL for your submodules are relative, and not absolute. For some reason (something to do with authentication I suppose), the submodules will only clone when using the SSH protocol.
These are the changes I made to my
.gitmodulesfile.[submodule "prisma"] path = prisma
- url = https://github.com/???/prisma.git [submodule "prisma"] path = prisma
- url = ../prisma.git This might be worth mentioning in the Coolify knowledge base under the Applications page.
had same problem this morning, this worked for me too, thanks