Git is not working in Currently build on heroku app

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?

I was having the same issue and this solved it! A newline shouldn’t really affect this, probably a bug worth reporting

Hi, i have the same issue when use heroku run ./manage.py sync_projects -a appname

git@gitlab.com: Permission denied (publickey).
Could not read from remote repository.
ssh seems to work fine

ssh -v git@github.com

debug1: Authentication succeeded (publickey).
Authenticated to github.com ([140.82.121.3]:22).

update removing ssh passphrase solved problem, this is normal?

There’s a note in the docs about newlines:
https://mozilla-pontoon.readthedocs.io/en/latest/admin/deployment.html#environment-variables

(See SSH_KEY)

I’m having the same issue here. I’ve followed the instructions for connecting to SSH, copying keys to Heroku environmental vars directly (newlines are there), adding keys to Github and restarting the app.

I continue to receive the following errors:

2021-04-25T19:47:45.133528+00:00 app[web.1]: 10.30.93.74 - - [25/Apr/2021:19:47:45 +0000] "GET /admin/projects/intersectional-data-ca/sync/ HTTP/1.1" 200 2 "https://i12l-data-pontoon.herokuapp.com/admin/projects/intersectional-data-ca/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36"
2021-04-25T19:47:45.134804+00:00 app[worker.1]: [2021-04-25 19:47:45,134: INFO/MainProcess] Received task: pontoon.sync.tasks.sync_project[1acd2bd6-4d5a-4060-b5b6-2418c18edbf5]  
2021-04-25T19:47:45.226171+00:00 app[worker.1]: Syncing project intersectional-data-ca.
2021-04-25T19:47:45.226275+00:00 app[worker.1]: [2021-04-25 19:47:45,225: INFO/ForkPoolWorker-6] Syncing project intersectional-data-ca.
2021-04-25T19:47:45.226382+00:00 app[worker.1]: Pulling source changes for project intersectional-data-ca started.
2021-04-25T19:47:45.226463+00:00 app[worker.1]: [2021-04-25 19:47:45,226: INFO/ForkPoolWorker-6] Pulling source changes for project intersectional-data-ca started.
2021-04-25T19:47:45.255516+00:00 app[worker.1]: Git: [Errno 2] No such file or directory: '/app/media/projects/intersectional-data-ca/git@github.com:ToferC/intersections.git/templates'
2021-04-25T19:47:45.255677+00:00 app[worker.1]: [2021-04-25 19:47:45,255: INFO/ForkPoolWorker-6] Git: [Errno 2] No such file or directory: '/app/media/projects/intersectional-data-ca/git@github.com:ToferC/intersections.git/templates'
2021-04-25T19:47:45.935271+00:00 app[worker.1]: [2021-04-25 19:47:45,933: ERROR/ForkPoolWorker-6] Task pontoon.sync.tasks.sync_project[1acd2bd6-4d5a-4060-b5b6-2418c18edbf5] raised unexpected: PullFromRepositoryException("Cloning into '/app/media/projects/intersectional-data-ca/git@github.com:ToferC/intersections.git/templates'...\nHost key verification failed.\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n")
2021-04-25T19:47:45.935331+00:00 app[worker.1]: Traceback (most recent call last):
2021-04-25T19:47:45.935340+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/celery/app/trace.py", line 385, in trace_task
2021-04-25T19:47:45.935341+00:00 app[worker.1]:     R = retval = fun(*args, **kwargs)
2021-04-25T19:47:45.935342+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/hooks/application_celery.py", line 84, in wrapper
2021-04-25T19:47:45.935342+00:00 app[worker.1]:     return wrapped(*args, **kwargs)
2021-04-25T19:47:45.935343+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/celery/app/trace.py", line 648, in __protected_call__
2021-04-25T19:47:45.935343+00:00 app[worker.1]:     return self.run(*args, **kwargs)
2021-04-25T19:47:45.935344+00:00 app[worker.1]:   File "/app/pontoon/sync/core.py", line 68, in wrapped_func
2021-04-25T19:47:45.935344+00:00 app[worker.1]:     return func(self, *args, **kwargs)
2021-04-25T19:47:45.935345+00:00 app[worker.1]:   File "/app/pontoon/sync/tasks.py", line 93, in sync_project
2021-04-25T19:47:45.935346+00:00 app[worker.1]:     source_changes = sync_sources(db_project, now, force, no_pull)
2021-04-25T19:47:45.935346+00:00 app[worker.1]:   File "/app/pontoon/sync/tasks.py", line 122, in sync_sources
2021-04-25T19:47:45.935347+00:00 app[worker.1]:     has_source_repo_changed = pull_source_repo_changes(db_project)
2021-04-25T19:47:45.935347+00:00 app[worker.1]:   File "/app/pontoon/sync/core.py", line 308, in pull_source_repo_changes
2021-04-25T19:47:45.935348+00:00 app[worker.1]:     pulled_revisions = source_repo.pull()
2021-04-25T19:47:45.935348+00:00 app[worker.1]:   File "/app/pontoon/base/models.py", line 1919, in pull
2021-04-25T19:47:45.935348+00:00 app[worker.1]:     update_from_vcs(self.type, self.url, self.checkout_path, self.branch)
2021-04-25T19:47:45.935349+00:00 app[worker.1]:   File "/app/pontoon/sync/vcs/repositories.py", line 272, in update_from_vcs
2021-04-25T19:47:45.935350+00:00 app[worker.1]:     obj.pull()
2021-04-25T19:47:45.935350+00:00 app[worker.1]:   File "/app/pontoon/sync/vcs/repositories.py", line 53, in pull
2021-04-25T19:47:45.935351+00:00 app[worker.1]:     raise PullFromRepositoryException(str(error))
2021-04-25T19:47:45.935354+00:00 app[worker.1]: pontoon.sync.vcs.repositories.PullFromRepositoryException: Cloning into '/app/media/projects/intersectional-data-ca/git@github.com:ToferC/intersections.git/templates'...
2021-04-25T19:47:45.935355+00:00 app[worker.1]: Host key verification failed.
2021-04-25T19:47:45.935355+00:00 app[worker.1]: fatal: Could not read from remote repository.
2021-04-25T19:47:45.935355+00:00 app[worker.1]: 
2021-04-25T19:47:45.935356+00:00 app[worker.1]: Please make sure you have the correct access rights
2021-04-25T19:47:45.935356+00:00 app[worker.1]: and the repository exists.
2021-04-25T19:47:45.935356+00:00 app[worker.1]: 

My SSH_CONFIG is:

StrictHostKeyChecking=no

Host github.com
User git

I’ve tried to follow the instructions on the repository - but there may be an issue as I’m using a Rust workspace and the i18n.toml isn’t in root, but in the web app workspace. Image attached.

I’d love to use Fluent and Pontoon for translation and would greatly appreciate any help folks can provide. Thanks, C.

Can you try simply removing the check from the “source repo” checkbox?

Subtle change to the error in that it’s no longer appending /templates to the cloned directory, but otherwise still not working.

2021-04-25T20:33:01.371840+00:00 heroku[router]: at=info method=GET path="/admin/projects/intersectional-data-ca/sync/" host=i12l-data-pontoon.herokuapp.com request_id=c9d81e68-519f-4cdf-af9c-3d9a3bf83dd1 fwd="142.114.53.82" dyno=web.1 connect=1ms service=67ms status=200 bytes=850 protocol=https
2021-04-25T20:33:02.161657+00:00 app[worker.1]: [2021-04-25 20:33:02,160: ERROR/ForkPoolWorker-2] Task pontoon.sync.tasks.sync_project[d3f9025e-63bb-41ef-9555-4b2dd3f9dcd7] raised unexpected: PullFromRepositoryException("Cloning into '/app/media/projects/intersectional-data-ca/git@github.com:ToferC/intersections.git'...\nHost key verification failed.\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n")
2021-04-25T20:33:02.161671+00:00 app[worker.1]: Traceback (most recent call last):
2021-04-25T20:33:02.161681+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/celery/app/trace.py", line 385, in trace_task
2021-04-25T20:33:02.161682+00:00 app[worker.1]:     R = retval = fun(*args, **kwargs)
2021-04-25T20:33:02.161689+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/hooks/application_celery.py", line 84, in wrapper
2021-04-25T20:33:02.161690+00:00 app[worker.1]:     return wrapped(*args, **kwargs)
2021-04-25T20:33:02.161690+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/celery/app/trace.py", line 648, in __protected_call__
2021-04-25T20:33:02.161690+00:00 app[worker.1]:     return self.run(*args, **kwargs)
2021-04-25T20:33:02.161691+00:00 app[worker.1]:   File "/app/pontoon/sync/core.py", line 68, in wrapped_func
2021-04-25T20:33:02.161691+00:00 app[worker.1]:     return func(self, *args, **kwargs)
2021-04-25T20:33:02.161691+00:00 app[worker.1]:   File "/app/pontoon/sync/tasks.py", line 93, in sync_project
2021-04-25T20:33:02.161693+00:00 app[worker.1]:     source_changes = sync_sources(db_project, now, force, no_pull)
2021-04-25T20:33:02.161693+00:00 app[worker.1]:   File "/app/pontoon/sync/tasks.py", line 122, in sync_sources
2021-04-25T20:33:02.161693+00:00 app[worker.1]:     has_source_repo_changed = pull_source_repo_changes(db_project)
2021-04-25T20:33:02.161694+00:00 app[worker.1]:   File "/app/pontoon/sync/core.py", line 308, in pull_source_repo_changes
2021-04-25T20:33:02.161694+00:00 app[worker.1]:     pulled_revisions = source_repo.pull()
2021-04-25T20:33:02.161695+00:00 app[worker.1]:   File "/app/pontoon/base/models.py", line 1919, in pull
2021-04-25T20:33:02.161695+00:00 app[worker.1]:     update_from_vcs(self.type, self.url, self.checkout_path, self.branch)
2021-04-25T20:33:02.161695+00:00 app[worker.1]:   File "/app/pontoon/sync/vcs/repositories.py", line 272, in update_from_vcs
2021-04-25T20:33:02.161696+00:00 app[worker.1]:     obj.pull()
2021-04-25T20:33:02.161696+00:00 app[worker.1]:   File "/app/pontoon/sync/vcs/repositories.py", line 53, in pull
2021-04-25T20:33:02.161697+00:00 app[worker.1]:     raise PullFromRepositoryException(str(error))
2021-04-25T20:33:02.161705+00:00 app[worker.1]: pontoon.sync.vcs.repositories.PullFromRepositoryException: Cloning into '/app/media/projects/intersectional-data-ca/git@github.com:ToferC/intersections.git'...
2021-04-25T20:33:02.161706+00:00 app[worker.1]: Host key verification failed.
2021-04-25T20:33:02.161706+00:00 app[worker.1]: fatal: Could not read from remote repository.
2021-04-25T20:33:02.161707+00:00 app[worker.1]: 
2021-04-25T20:33:02.161707+00:00 app[worker.1]: Please make sure you have the correct access rights
2021-04-25T20:33:02.161707+00:00 app[worker.1]: and the repository exists.
2021-04-25T20:33:02.161708+00:00 app[worker.1]:

Note that I scrapped and rebuilt the Heroku app and sync is now working. I suspect that I needed a full rebuild vs release-retry.

Now I just need the synced project to show up. :slight_smile:

Hey, i Found something. So I forget thing(yeah everyone forgot thing…), refer to this article, it’s Work!

also i’m setting for non-password. and Happy using Pontoon :slight_smile:

Short Point - Your Git’s SSH Key File(id_rsa) is starting RSA, not SSH.

so, i recommand for this setting.

ssh-keygen \
    -m PEM \
    -t rsa \
    -b 4096 \
    -C "pontoon@mozilla.org" or Your Mail \
    -f ~/.ssh/mykeys/pontoon or Your SSH Key Location \