Applicable to:
- Plesk for Linux
Symptoms
-
When trying to pull updates for a domain
example.com
from remote Git repository using SSH key authorization the following error is produced:PLESK_ERROR: Trying to pull the updates from git repository results in the error:
Server at 'github.com' is seen for the first time. Adding its public key to the list of known hosts in '/var/www/vhosts/example.com/sub.example.com/.ssh/git_known_hosts'.
# github.com:22 SSH-2.0-libssh_0.7.0
# github.com:22 SSH-2.0-libssh_0.7.0
# github.com:22 SSH-2.0-libssh_0.7.0
Warning: Permanently added the RSA host key for IP address '203.0.113.2' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. -
The main system user's name was recently changed.
Cause
This is a Plesk bug with ID PPPM-7291, which is planned to be fixed in one of the future product updates.
Resolution
As a workaround, perform the following steps:
-
Connect to the Plesk server via SSH.
-
Place the SSH keys for authentication in the home directory of an additional FTP user from the error (e.g. content of
/var/www/vhosts/example.com/.ssh/
directory to/var/www/vhosts/example.com/sub.example.com/.ssh/
):# mkdir -p /var/www/vhosts/example.com/sub.example.com/.ssh/
# cp -ap /var/www/vhosts/example.com/.ssh/* /var/www/vhosts/example.com/sub.example.com/.ssh/ -
In case file is present, make sure that correct permissions are set:
# chown jdoe:psacln /var/www/vhosts/example.com/sub.example.com/.ssh/id_rsa
# chmod 600 /var/www/vhosts/example.com/sub.example.com/.ssh/*Where
jdoe
is the system user of the subscription.
Comments
17 comments
I am experiencing an error when trying to set up a second (or multiple) Git repos on my server. I get the error:
Could these issues be related?
Hello,
we are experiencing this issue, and the temporary resolution helped, thank you.
Is there a possiblity to watch over the bug resolution case? I would like to stay updated on the issue, and know when (and if) this get fixed. Thank you.
@Jan, you can subscribe to the article to stay tuned. Additional information can be found here: https://support.plesk.com/hc/en-us/articles/115002200894-How-to-subscribe-to-Plesk-articles
@Zahid Mahmood,
Hello! Could you please provide us with exact error? What is under "Public key for the server at 'github.com' is already known in" ?
I did a copy of the .shh directory.
But it's using a .ssh/git_known_hosts file from another domain.
When i delete the git_known_hosts file there it will create a new one(also there)
Please, fix this bug!
Hello @Helen,
The issue from the provided screenshot seems to be different from the one in this article.
Additionally, I see no articles with a similar issue.
To find the solution I would suggest to submit a support request.
If anyone from reg.ru is trying to work the same problem as me, please, read support answer carefully, it helped me:
Здравствуйте! Насколько мы видим, вы указали в качестве удаленного Git репозитория команду git: git clone git@bitbucket.org:username/***.git Адрес репозитория имеет следующий вид: git@bitbucket.org:username/***.git Однако, указанный вами адрес репозитория на данный момент не существует. Для решения проблемы вам необходимо указать адрес существующего репозитория, после чего скопировать публичный ключ в ваш репозиторий bitbucket. Подробнее в официальной инструкции - https://docs.plesk.com/ru-RU/onyx/administrator-guide/website-management/git-support/using-remote-git-hosting.75848/ Как добавить публичные ключи на BitBucket - https://www.youtube.com/watch?v=-ElU6WhNLn4 Интерактивный курс по использованию Git - https://githowto.com/ru
Вы уже оценили ответ
@Helen, thanks for sharing.
Thank You Very Much, That took a big burden off of me. <3
Hi Ivan Postnikov, we have something that looks the same as Zahid's problem. I don't see any follow up on that.
To our knowledge we didn't change anything in Github settings, or the server. And this morning it worked fine. And has worked fine for the last couple of months.
We have 2 connected github projects, both on different subdomains of the same main domain. We use the SSH way to pull the updates. and a webhook for the automatic pull after pushed to master.
As said, it worked this morning until I noticed on one of the projects a minor change wasn't showing up on the site after I pushed it. At this point I manually pressed the button in the plesk panel to pull updates. This worked once or twice.
Then we got the following error: Public key for the server at 'github.com' is already known in '/var/www/vhosts/maindomain.nl/.ssh/git_known_hosts'. error: Ref refs/heads/master is at c034a*** but expected 9c105**** From github.com:****/*** ! 9c105d9..c034abf master -> master (unable to update local ref)
Hello @Martjin,
Our Support Department has met such issue once. However, the exact root cause wasn't found. In that case,the solution was to remove the git repository and to re-add the git repository. Probably, this was a misconfiguration on the git side.
If this won't resolve the issue, consider submitting a request for Plesk Support, as the deeper investigation will be required.
Hello Ivan Postnikov,
The issue was caused by a issue on the Github.com side.
https://www.githubstatus.com/incidents/42hkbtl63nmn
I still had to remove the repository in question and re-add it to get rid of the error. But prior to that, the other project was already functioning ok again, responding to the webhook etc.
It all seems to be working correctly again at the moment.
Thanks for your input.
Hello @Martjin,
Thank you for sharing this information, it may be useful for other Pleskians!
The temporary solution provided did not work in my case. I did:
Still getting this error when trying to add a repository via the Plesk interface:
UPDATE:
Figured it out myself: I realized I have configured a passphrase when generating my ssh keys. Maybe this prevented Plesk from cloning from GitHub. It works now! :)
Hello Gregor,
Thank you for the update, glad to hear it's sorted out
Moved a domain by Plesk Migrator and now this. The Git extension has been update as it has a new UI, but the same error was faced 1 week ago to another domain too. When will a fix be implemented?
Update: Updated the system username of the domain and worked
Please sign in to leave a comment.