Heroku push rejected, Submodule install failed
Asked Answered
B

3

12

My repo uses a customized version of Recurly-js, and I have packaged it as a submodule using these instructions https://devcenter.heroku.com/articles/git-submodules . However, I get the following error now when I try to deploy:

----> Heroku receiving push 
-----> Git submodules detected, installing
       Submodule 'recurly-js' (/app/tmp/repo.git/recurly-js) registered for path 'recurly-js'
       Initialized empty Git repository in /tmp/build_3iacvn8h2rnha/recurly-js/.git/
       fatal: '/app/tmp/repo.git/recurly-js' does not appear to be a git repository
       fatal: The remote end hung up unexpectedly
       Clone of '/app/tmp/repo.git/recurly-js' into submodule path 'recurly-js' failed
 !     Heroku push rejected, Submodule install failed
Bebe answered 13/11, 2012 at 14:15 Comment(0)
B
17

I gave the answer as a comment to @jeffrey-k's answer, but now I'm even more sure of it, I'll write it here.

My repo suddenly stopped pushing, and these two things 'fixed' it:

  1. Change all public submodule URLs (if any) from using the ssh transport URLs to readonly git transport URLs (i.e., from [email protected]:yaniv-aknin/public-project to git://github.com/yaniv-aknin/public-project). To do this, you will need to edit the file called .gitmodules in the root of your repo.
  2. Remove all private submodules (if any) from my repo (remove them from .gitmodules and rm -fr their directories).
  3. Commit the changes.

This handles these two changes in behaviour:

  1. Heroku used to be able to clone submodules from github using the ssh transport (presumably they had some 'general heroku ssh key' and github account, but not sure).
  2. Heroku used to ignore failed submodules and just continue the push.

I've opened a ticket asking if my analysis is correct and why did the change happen (with no warning I managed to hear of) - I'll update this answer if I learn something new.

UPDATE: Noah from Heroku's support replied to my ticket and largely acknowledged what I said above. Public repo URLs should be changed, private repos should either be removed or have credentials embedded in them as per this document; the latter solution has obvious security ramifications.

Beshore answered 13/11, 2012 at 15:50 Comment(3)
Thanks for following up on this.Bebe
Heroku now appears to only accept submodules of the https:// variety. See devcenter.heroku.com/articles/git-submodules for details.Cleocleobulus
in my case, it was because .gitmodules wasn't added into my git filesTerms
M
5

The other answers are old.

As of 2019, you can now simply log in to Heroku and go here:

  • https://dashboard.heroku.com/apps/<YOUR-WEBSITE-NAME>/deploy/github

And link your GitHub account or organization with Heroku. It'll then be able to clone private submodules your account has access to when selecting to deploy on a push to the master of your main GitHub repo.

Magalimagallanes answered 20/10, 2019 at 0:21 Comment(0)
B
1

Looks like this answer - https://stackoverflow.com/a/8768240 - tells the story. Heroku will not accept git submodules that are private repos. My version of recurly-js is a forked, non-private repo.

Bebe answered 13/11, 2012 at 14:41 Comment(1)
I believe there was a recent change in Heroku's behaviour. We have a repo with some private and some public submodules. Until today, Heroku fetched the public submodules, failed on the privates, and continued the push. As of today (perhaps yesterday), it seems Heroku stops the deployment if a submodule fails. Also, we think heroku started treating repos with private URLs (starts with git@) as private, even if they are public. Consider git-read-only URLs (starts with git://).Beshore

© 2022 - 2024 — McMap. All rights reserved.