Git is not working in Currently build on heroku app

Thanks for Reply, but i connecting problem of github, not heroku. github’s OAuth / Heroku’s SSH is fine.

1 Like

Sorry, I skimmed through the article (clearly too quickly) and thought I saw a testing connection to GitHub :-\

Not sure I can help, because I don’t know how Mozilla’s instance is actually set up. I assume you both already followed the instructions here (heroku-buildpack-ssh in particular)?
https://mozilla-pontoon.readthedocs.io/en/latest/admin/deployment.html

1 Like

thanks for reply, i always using https://github.com/mozilla/pontoon/ 's button. so i’m not touch other build pack etc. and my ssh config(still) is

Host github.com
	User git
	HostName github.com
	IdentityFile ~/.ssh/id_rsa
	StrictHostKeyChecking no

and only touch heroku’s var keys.


(still and until now build packs)

Thanks for Reply, yeah SSH is not asked.

and in my case from part is not error, but project part is error (sorry, i’m a script kid :wink:, so debug is not my concern)

>>> project = Project.objects.syncable()[1]
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/app/.heroku/python/lib/python3.7/site-packages/django/db/models/query.py", line 309, in getitem
    return qs._result_cache[0]
IndexError: list index out of range
>>> sync_log = SyncLog.objects.create(start_time=timezone.now())
>>> sync_project(project.pk, sync_log.pk, locale=None, no_pull=False, no_commit=True, force=True)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'project' is not defined

Thanks for your reply @flod – yep, those instructions you linked are the ones I used. Went through them all. Some seemed unnecessary though, ie, the addons were already attached with the right names, and the database migration script reported nothing needed to be done.

I just re-ran the buildpack commands. It looks like I was missing the SSH one, my bad. But still getting the same error. Do I need to rebuild the app?

I’m a newbie with Heroku, so I’m not sure how to trigger a rebuild. The pontoon deployment guide says to use the Heroku Repo plugin, which I’ve installed but it doesn’t have a rebuild command:

set the bare repo for immediate consumption

USAGE
  $ heroku repo:COMMAND

COMMANDS
  repo:clone        set the bare repo for immediate consumption
  repo:download     download the repo
  repo:gc           run a git gc --aggressive on an application's repository
  repo:purge_cache  delete the contents of the build cache in the repository
  repo:reset        reset the repo

using for this - https://www.darraghoriordan.com/2019/03/02/heroku-push-failed-force-rebuild/

Thanks @readingsnail, that’s helpful. Sadly I’m still getting the same error after running releases:retry. I will deploy a fresh app and see if it works when I add the SSH helper in the right order.

Looks like you only have one project defined in Pontoon.

You could try changing

project = Project.objects.syncable()[1]

to

project = Project.objects.syncable()[0]
1 Like

thanks, it’s same. in my assist program(SSH Config generator), StrictHostKeyChecking no is printed, it’s not question of password.

and my result is here.

Running ./manage.py shell on ⬢ translates... up, run.6494 (Free)
Python 3.7.6 (default, Dec 23 2019, 04:25:22)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from pontoon.base.models import Project
>>> from pontoon.sync.tasks import sync_project
>>> from pontoon.sync.models import SyncLog
>>> from django.utils import timezone
>>> project = Project.objects.syncable()[0]
>>> sync_log = SyncLog.objects.create(start_time=timezone.now())
>>> sync_project(project.pk, sync_log.pk, locale=None, no_pull=False, no_commit=True, force=True)
Syncing project stellaris.
Git: [Errno 2] No such file or directory: '/app/media/projects/stellaris/git@github.com:readingsnail/stellaris.git': '/app/media/projects/stellaris/git@github.com:readingsnail/stellaris.git'

i setting to 1 project, because testing for pontoon (several project is waiting) and my try thing is fresh app is not helpful for this(i tried for 30+). hmm…

i filed bugzilla - https://bugzilla.mozilla.org/show_bug.cgi?id=1631084 - but i’m confused. lust translation sites is using git, and still working. maybe my setting is wrong. but i don’t find it…

well, my mistaked. sorry

  • Git: [Errno 2] No such file or directory: '/app/media/projects/A/git@github.com:B/C.git': '/app/media/projects/A/git@github.com:B/C.git' > check .gitignore. /media/ is included.
  • SSH Problem - used Batch Mode yes in your ssh config

yeah, so week ago, i testing pontoon, transfered zanata. for now, well working. and thanks for reply :slight_smile:

I am having exact same issue, what is the fix? I tried Batch Mode yes as well.
I find it strange that the heroku button does not add the ssh build pack but adds the other build packs. Is this a bug?

@crumplebow3 Git is working well(in heroku filesystem blah blah - thanks to mathjazz), in this error, problem is cerely. so need slowing upload to pontoon, i recommand to 500Kb in one time(Git is upload to file in Heroku, and Pontoon is write to DB). and i using batch mode is passwordless login(no passphrase).

also i recommand install heroku CLI (https://devcenter.heroku.com/articles/heroku-cli) and run heroku run -a yourawesomeapp ./manage.py sync_projects and watch to heroku’s log page in the upload sequences(in worker.1). ‘sync complete’ message > you can right now upload to other strings. :wink: it’s time up to your upload :slight_smile:

Yes this is my problem I try to run the sync_projects command and it says that

Load key “/app/.ssh/id_rsa”: invalid format

So I changed SSH CONFIG environment variable to use custom id_rsa:
IdentityFile /bad/path/to/file

And redeployed. I watched the logs and see that it is not using the new bad path because the log still references old path: " Load key “/app/.ssh/id_rsa”: invalid format"

SSH Config is need re-deploy app(even one character changed). and in this case is… hmmm, my setting is here - i using github

so MUST enter in -----END OPENSSH PRIVATE KEY-----. if not, Pontoon is print this error.

Can you create a new instance of pontoon as a test? What steps did you do

in SSH Setting, I just following Github’s mozilla/pontoon 's button - i not recommand readthedocs, and forked your git repo’s heroku button. it’s not working your pontoon instance’s SSH(already i trying, but it’s failed). but this button is well working in SSH Config. in Public key / Secret Key make, i recommand Github’s Help page.

The problem was your private key NEEDS A NEW LINE at the end after:

“-----END OPENSSH PRIVATE KEY-----” !

Crazy I don’t need newline on my other environments. Old ssh library or what?