1

I have created a webspace in PLESK. I have many websites connected with GitLab. For this, I added the SSH public key to my GitLab account.

If I create a new domain and add an old existing git repository, everything works.

However, if I create a new repository (under the same GitLab account) and try to add it do a new domain, then it does not work. I get this error:

Cloning into bare repository '/var/www/vhosts/***.de/git/***.git'...
Public key for the server at 'gitlab.com' is already known in '/var/www/vhosts/***.de/.ssh/git_known_hosts'.
remote:
remote: ========================================================================
remote:
remote: The project you were looking for could not be found or you don't have permission to view it.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

I don't understand the problem, because the SSH public key is the same (domain registered under same webspace). In the past, whenever I added a new repository, I could just link it to the new domain it always worked (because the public SSH key is provided in my GitLab account).

Even if I try to add the ssh public key to my GitLab account it fails, telling me that this key already exists.

enter image description here

What could be the problem? Is there a new policy in GitLab? Is it an issue with Plesk?

1 Answer 1

1

First, for troubleshoot, I logged into the server using ssh. I tried to clone git repository from the CLI but it still failed, giving me the same error message.

It looks like my credentials are invalid, although for old project setups, they work.

I fixed it this way:

  1. Create new webspace for the domain
  2. Create webspace user with ssh access
  3. Cloning the git repository was still not working. New webspaces use per default same ssh key.
  4. Logged in with webpsace user
  5. Generate new ssh pair (only for this webspace) using ssh-keygen -t rsa
  6. Added new public key.
  7. Now I can add the repository.

Its still black magic for me, that I cannot add a new repository using the old ssh-key pair, but that I can pull updated for old repositories using the old ssh-key pair.

1
  • That really should be designed more easy for PLESK customers. After all many want to pull directly from github to subdomains.
    – feder
    Oct 25, 2021 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.