2

When deploying to Heroku, I get the following error:

remote: Git submodules detected, installing:
remote: Submodule 'surveyScriptContents' (git@github.com:PurplePineapple123/Post-Purchase-Survey-Script-Tag.git) registered for path 'surveyScriptContents'
remote: Cloning into 'surveyScriptContents'...
remote: Warning: Permanently added the ECDSA host key for IP address '140.82.112.3' to the list of known hosts.
remote: ERROR: Repository not found.
remote: fatal: Could not read from remote repository.
remote: 
remote: Please make sure you have the correct access rights
remote: and the repository exists.
remote: fatal: clone of 'git@github.com:PurplePineapple123/Post-Purchase-Survey-Script-Tag.git' into submodule path 'surveyScriptContents' failed
remote: 
remote: !       Push rejected, submodule install failed
remote: 
To https://git.heroku.com/morning-peak-19860.git
 ! [remote rejected] HEAD -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/morning-peak-19860.git'

This issue is occurring because I had to change my workflow due to issues with Heroku's GitHub integration. My normal workflow would be: push changes from local branch to GitHub, create pull request and merge, this then auto pushes changes from GitHub to Heroku.

However, I now have to use the Heroku CLI and have been running into issues with submodules when trying to push to git push heroku HEAD:master or git push heroku HEAD from my local machine.

After reading the docs Heroku has on submodules, I'm still confused on exactly what the issue is.

I'm not sure why specifically submodules have issues when using the Heroku CLI but work fine when using the GitHub integration.

Any insights on how to get this working?

Edit:

So I followed this guideand changed from SSH to HTTPS for the submodule in .git/config. This resulted in a different error (auth?) which is a step in the right direction.

remote: Git submodules detected, installing:
remote: Submodule 'surveyScriptContents' (https://github.com/PurplePineapple123/Post-Purchase-Survey-Script-Tag.git) registered for path 'surveyScriptContents'
remote: Cloning into 'surveyScriptContents'...
remote: fatal: could not read Username for 'https://github.com': No such device or address
remote: fatal: clone of 'https://github.com/PurplePineapple123/Post-Purchase-Survey-Script-Tag.git' into submodule path 'surveyScriptContents' failed
remote: 
remote: !       Push rejected, submodule install failed
remote: 
To https://git.heroku.com/morning-peak-19860.git
 ! [remote rejected] HEAD -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/morning-peak-19860.git'
InquisitiveTom
  • 423
  • 3
  • 13
  • [That repository](https://github.com/PurplePineapple123/Post-Purchase-Survey-Script-Tag) appears to be private. How have you attempted to authenticate? Are you using a deploy token of some kind? – ChrisGPT was on strike Apr 27 '22 at 17:21
  • @Chris I think I'm running into an auth issue like you said. I switched from SSH to HTTPS and now see this error `could not read Username for 'https://github.com': No such device or address` (more info in my post edit above). I think I just need to format the URL to provide proper authentication? – InquisitiveTom Apr 28 '22 at 20:54
  • I'm almost 100% certain it's an auth issue (https://devcenter.heroku.com/articles/git-submodules#protected-git-submodules). Will try and use an env variable for my credentials – InquisitiveTom Apr 28 '22 at 21:03

0 Answers0