Git@github.com: Permission denied (publickey) fatal: Could not read from remote repository

Bench Update error

when Im doing bench update it gives this error

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

$ git pull  upstream master
From https://github.com/thispl/teampro
 * branch            master     -> FETCH_HEAD
Already up to date.
$ find . -name "*.pyc" -delete
$ git pull  origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: 
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/cli.py", line 127, in cli
    bench_command()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/commands/update.py", line 59, in update
    update(
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/utils/bench.py", line 421, in update
    pull_apps(apps=apps, bench_path=bench_path, reset=reset)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/app.py", line 664, in pull_apps
    bench.run(f"git pull {rebase} {remote} {branch}", cwd=app_dir)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 155, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError

This is because of a permission issue. check you have proper ssh access to the repo GitHub - thispl/teampro: ERPNext Customizations

eval $(ssh-agent)
ssh-add ~/.ssh/key
ssh -T git@github.com

If you get the following message you have access.

Hi user! You’ve successfully authenticated, but GitHub does not provide shell access.

1 Like

Ok but now that i have uninstalled successfully teampro and other github.com apps from /frappe-bench/apps in list i have erpnext and frappe and other 3 my local apps
applist

but still same error after bench update

sagar_p@pvipl-ThinkPad-E450:~/frappe-bench$ bench update
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From https://github.com/frappe/frappe
 * branch                  version-14 -> FETCH_HEAD
WARN: shallow_clone is set in your bench config.
However without passing the --reset flag, your repositories will be unshallowed.
To avoid this, cancel this operation and run `bench update --reset`.

Consider the consequences of `git reset --hard` on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json
		
Backing up sites...                     
Backup Summary for test.site4 at 2022-11-12 12:16:03.359509
Config  : ./test.site4/private/backups/20221112_121558-test_site4-site_config_backup.json 235.0B
Database: ./test.site4/private/backups/20221112_121558-test_site4-database.sql.gz         7.0MiB
Backup for Site test.site4 has been successfully completed
Backup Summary for library.test at 2022-11-12 12:16:04.686043
Config  : ./library.test/private/backups/20221112_121604-library_test-site_config_backup.json 94.0B
Database: ./library.test/private/backups/20221112_121604-library_test-database.sql.gz         228.8KiB
Backup for Site library.test has been successfully completed
Updating apps source...
Skipping reset for app demoapp
Unshallowing frappe to safely pull remote changes.
$ git fetch upstream --unshallow
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (45/45), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 14 (delta 10), reused 6 (delta 4), pack-reused 0
Unpacking objects: 100% (14/14), 2.89 KiB | 28.00 KiB/s, done.
From https://github.com/frappe/frappe
   ba27434d81..ef758130d6  develop           -> upstream/develop
   8807035998..9eaec5cf1c  version-14-hotfix -> upstream/version-14-hotfix
$ git pull  upstream version-14
From https://github.com/frappe/frappe
 * branch                  version-14 -> FETCH_HEAD
Already up to date.
$ find . -name "*.pyc" -delete
Unshallowing erpnext to safely pull remote changes.
$ git fetch upstream --unshallow
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 21 (delta 16), reused 10 (delta 6), pack-reused 0
Unpacking objects: 100% (21/21), 3.58 KiB | 47.00 KiB/s, done.
From https://github.com/frappe/erpnext
   d03979eef9..4e9a63423f  develop                               -> upstream/develop
 * [new branch]            mergify/bp/version-13-hotfix/pr-32913 -> upstream/mergify/bp/version-13-hotfix/pr-32913
   3dde050c15..9e47371801  version-14-hotfix                     -> upstream/version-14-hotfix
$ git pull  upstream version-14
From https://github.com/frappe/erpnext
 * branch                  version-14 -> FETCH_HEAD
Already up to date.
$ find . -name "*.pyc" -delete
Skipping pull for app demoapp
$ git pull  origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: 
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/cli.py", line 127, in cli
    bench_command()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/commands/update.py", line 59, in update
    update(
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/utils/bench.py", line 421, in update
    pull_apps(apps=apps, bench_path=bench_path, reset=reset)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/app.py", line 664, in pull_apps
    bench.run(f"git pull {rebase} {remote} {branch}", cwd=app_dir)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 155, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError

Check out these likes,

Skipping pull for app demoapp
$ git pull  origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

problem is with demoapp. for that repo, you didn’t have access

1 Like

may i uninstall it then… ?

Take a backup and uninstall, make sure that the app doesn’t have any dependencies.

1 Like

yes I did uninstalled successfully with backup but same error :pleading_face:

sagar_p@pvipl-ThinkPad-E450:~/frappe-bench$ bench update --no-backup --reset
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From https://github.com/frappe/frappe
 * branch                  version-14 -> FETCH_HEAD
Updating apps source...
$ git fetch --depth=1 --no-tags upstream version-14
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From https://github.com/frappe/frappe
 * branch                  version-14 -> FETCH_HEAD
$ git reset --hard upstream/version-14
HEAD is now at 5e96e92a55 chore(release): Bumped to Version 14.14.3
$ git reflog expire --all
$ git gc --prune=all
Enumerating objects: 365784, done.
Counting objects: 100% (365784/365784), done.
Delta compression using up to 4 threads
Compressing objects: 100% (80412/80412), done.
Writing objects: 100% (365784/365784), done.
Total 365784 (delta 283726), reused 365784 (delta 283726)
Checking connectivity: 365784, done.
$ find . -name "*.pyc" -delete
$ git fetch --depth=1 --no-tags upstream version-14
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From https://github.com/frappe/erpnext
 * branch                  version-14 -> FETCH_HEAD
$ git reset --hard upstream/version-14
HEAD is now at e917212849 chore(release): Bumped to Version 14.6.0
$ git reflog expire --all
$ git gc --prune=all
Enumerating objects: 484910, done.
Counting objects: 100% (484910/484910), done.
Delta compression using up to 4 threads
Compressing objects: 100% (130790/130790), done.
Writing objects: 100% (484910/484910), done.
Total 484910 (delta 350546), reused 484910 (delta 350546)
Checking connectivity: 484910, done.
$ find . -name "*.pyc" -delete
$ git fetch --depth=1 --no-tags origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: 
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/cli.py", line 127, in cli
    bench_command()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/commands/update.py", line 59, in update
    update(
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/utils/bench.py", line 421, in update
    pull_apps(apps=apps, bench_path=bench_path, reset=reset)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/app.py", line 656, in pull_apps
    bench.run(f"git fetch --depth=1 --no-tags {remote} {branch}", cwd=app_dir)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
  File "/home/sagar_p/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 155, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError