coolify icon indicating copy to clipboard operation
coolify copied to clipboard

[Bug]: Failed to clone Git submodule

Open marinofranz opened this issue 1 year ago • 9 comments

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)

  1. Create an application
  2. Choose Dockerfile as Build Pack (I've also tried Nixpacks)
  3. Deploy
  4. 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

marinofranz avatar Jul 01 '24 04:07 marinofranz

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.

marinofranz avatar Jul 01 '24 04:07 marinofranz

Live saving! great job finding it @marinofranz

kyuumeitai avatar Jul 01 '24 13:07 kyuumeitai

@marinofranz you saved my day, Thanks 😊🙏

ansezz avatar Jul 25 '24 12:07 ansezz

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.

musticode avatar Sep 13 '24 16:09 musticode

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..

marinofranz avatar Sep 17 '24 13:09 marinofranz

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.

justincavery avatar Nov 26 '24 19:11 justincavery

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

marwie avatar May 21 '25 14:05 marwie

Same issue

sam-laister avatar May 25 '25 21:05 sam-laister

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 avatar Jun 14 '25 21:06 jonas-klesen

@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.

CharlesFr avatar Jun 26 '25 13:06 CharlesFr

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: @.***>

jonas-klesen avatar Jun 26 '25 18:06 jonas-klesen

got it working with relative paths, I think the main limitation there is that all submodules must come from the same GitHub Org/User

CharlesFr avatar Jun 27 '25 08:06 CharlesFr

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.

had same problem this morning, this worked for me too, thanks

sayedhfatimi avatar Oct 09 '25 12:10 sayedhfatimi