Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Wakanda's avatar
Level 10

Error trying to make make a pull request on forge

Error message

Error Output
Thu Feb 11 08:23:52 UTC 2021
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.

NB I already have an app in production and have updated it a few times using the forge deploy button, recently when I updated my repository am now experiencing the above issue. Any ideas on how to solve this? I can ssh to the server without any problems only having challenges on deploying.

0 likes
17 replies
sr57's avatar

I can ssh to the server

Which server?

The pb is access from your prod server to your git server

To test, ssh in your prod server and 2nd ssh from this to your git server.

1 like
Wakanda's avatar
Level 10

@sr57 By Server, I mean Digital Ocean/Server or droplet via forge.

sr57's avatar

Digital Ocean/Server or droplet via forge

vps or not ? my proposed test is for a vps.

Anyway first double ckeck your credential to access your git server.

1 like
Wakanda's avatar
Level 10

@sr57 I have have successfully authenticated to git server from my local pc how can I test the connection from forge to git server

sr57's avatar
sr57
Best Answer
Level 39

yes vps and git server, github

So you have my answer in my first post (ssh in your prod server and 2nd ssh from this to your git server) , but you don't understand so I give you details

-1- Open a terminal localy

-2- ssh to your prod server ( vps )

-3- you should be in a terminal in your prod server

-4- ssh to your git server (github)

-5.1- if it works you should have no pb with your pull request

-5.2- if not, correct your credential or if ok (since you wrote it's ok from your local) it can be a temporary protection from github (rarely from your prod server)

-5.3- ideally test with another prod server

1 like
Wakanda's avatar
Level 10

@sr57 I managed to authenticate it maybe something related to your point 5.2

forge@myserver:~$ ssh -T [email protected]
Hi Loyd! You've successfully authenticated, but GitHub does not provide shell access.
forge@myserver:~$
sr57's avatar

Good, and your pull request, what's the error?

1 like
Wakanda's avatar
Level 10

@sr57 the pull request error is still the same

forge@myserver:~/example.com$ git pull
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
sr57's avatar

Strange, can you do the same test from another 'prod' server?

-1- easiest, use another directory on your local , clone and pull

-2- idem with a vpn

-3- with another vps supplier

1 like
sr57's avatar

Hope you'll find with these tests.

If stiil pb with github (to be explain anyway) it's easy to setup a git server on your local (git init --bare) and use it to pull your prod server.

I'll be out till end of the day.

1 like
Wakanda's avatar
Level 10

@sr57 thanks for your responses. I tried all solutions and seemed as if something was broken at server level. Had to create a new server and migrate the data from the old server and now i can git pull without any errors

sr57's avatar

Well done, after you succeed the 'double ssh' the pb was strange (abnormal) , it why it's useful to work with it's own server to debug.

1 like
Wakanda's avatar
Level 10

@sr57 Thanks for the server local server setup idea. I got me really hooked up. Still exploring it further

sr57's avatar

You are welcome, don't forget to close this subject.

1 like

Please or to participate in this conversation.