Deploy of the test app (Dokploy/next-todo-app) fails, git clone fails: Host key verification failed.

I followed the guide (https://youtu.be/mznYKPvhcfw?t=372) exactly, but the deploy step fails with:
Initializing deployment
Cloning Repo Custom [email protected]:Dokploy/next-todo-app.git to /etc/dokploy/applications/test-todo-app-frontend-639a2f/code: ✅
Cloning into '/etc/dokploy/applications/test-todo-app-frontend-639a2f/code'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ERROR Cloning Custom Git: Error: Cloning into '/etc/dokploy/applications/test-todo-app-frontend-639a2f/code'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
: ❌
Initializing deployment
Cloning Repo Custom [email protected]:Dokploy/next-todo-app.git to /etc/dokploy/applications/test-todo-app-frontend-639a2f/code: ✅
Cloning into '/etc/dokploy/applications/test-todo-app-frontend-639a2f/code'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ERROR Cloning Custom Git: Error: Cloning into '/etc/dokploy/applications/test-todo-app-frontend-639a2f/code'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
: ❌
Any idea why?
15 Replies
localλorse ♓
localλorse ♓OP8mo ago
Then I did this https://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository/29380765#29380765:
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
And tried to deploy again, but same error 😔 I added an SSH key (Github deploy key) to Dokploy and retried deployment, now I get this error:
Initializing deployment
Cloning Repo Custom [email protected]:Dokploy/next-todo-app.git to /etc/dokploy/applications/test-todo-app-frontend-639a2f/code: ✅
Cloning into '/etc/dokploy/applications/test-todo-app-frontend-639a2f/code'...
Load key "/etc/dokploy/ssh/H6eIbZK8frkfF6IstsNdc_rsa": error in libcrypto
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Initializing deployment
Cloning Repo Custom [email protected]:Dokploy/next-todo-app.git to /etc/dokploy/applications/test-todo-app-frontend-639a2f/code: ✅
Cloning into '/etc/dokploy/applications/test-todo-app-frontend-639a2f/code'...
Load key "/etc/dokploy/ssh/H6eIbZK8frkfF6IstsNdc_rsa": error in libcrypto
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
ah, it turns out that after I added a newline at the end of that file (manually in the terminal), it works now! @Siumauricio It took me forever to figure this out.. It would be nice if Dokploy would append that newline (if there's none already) when the user adds a ssh key via the UI...
Siumauricio
Siumauricio8mo ago
Can you pass the url of GitHub are you using? If the url is public you can use https
localλorse ♓
localλorse ♓OP8mo ago
I was following your tutorial https://youtu.be/mznYKPvhcfw?t=372, so I entered the URL [email protected]:Dokploy/next-todo-app.git. But it didn't even work without a SSH key, I was surprised! (Why?) So I added a GH deploy key that I had that has read-only access to one of my private repos. But then I had the above problem that there was no trailing newline in that file after I entered the key in Dokploy's UI. But then after I added a newline to the file /etc/dokploy/ssh/H6eIbZK8frkfF6IstsNdc_rsa manually, it worked with this deploy key (weird).
Siumauricio
Siumauricio8mo ago
the repo is public or private?
localλorse ♓
localλorse ♓OP8mo ago
public it's your test app: Dokploy/next-todo-app.git
Siumauricio
Siumauricio8mo ago
yes but you are using ssh git clone
localλorse ♓
localλorse ♓OP8mo ago
yeah because that's what the vid showed :)
Siumauricio
Siumauricio8mo ago
check again
Siumauricio
Siumauricio8mo ago
No description
localλorse ♓
localλorse ♓OP8mo ago
ah sorry I was watching at faster speed so I thought you had copied the SSH url 😅
localλorse ♓
localλorse ♓OP8mo ago
Now I'm watching the docker compose tutorial: https://www.youtube.com/watch?v=3qr_celxISA The host domain has to be written in the docker-compose.yml file, is there no way to avoid this?
Siumauricio
Siumauricio8mo ago
the video is quite old, in the current version you can add the domains trought the UI
localλorse ♓
localλorse ♓OP8mo ago
To keep the docker-compose.yml file domain-independent ah nice Does it mean I can use the same docker-compose.yml file for different environments? (staging/production) Or is there something else that prevents this? What changed since this tutorial, do I need any of the traefik labels at all anymore?
localλorse ♓
localλorse ♓OP8mo ago
Ah, I think I also subconsciously chose the git URL because of the placeholder text here
No description

Did you find this page helpful?