-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid or unknown remote ssh hostkey (Rugged?) #822
Comments
Update: it looks like this is related to the libgit2 library which is used by Rugged gem. libgit2 library was updated and that error message (with much more code) was added on 19 Jun, 2023. By checking that code found that one function is returning wrong data due to wrong return statement location. Reported issue there. |
Finally got it working. If somebody will get in to the same issue here is the way I have solved this at least for now. I added Rugged gem with limited version to the Redmine Gemfile Simply execute this command inside Redmine home folder echo "\ngem 'rugged', [\"~> 1.5.0\", \"< 1.5.1\"]" >> Gemfile This will prevent Rugged to install 1.5.1 and newer version. Later when problem will be solved this line can be removed. Finally execute |
Thanks - pinning rugged to a version before 1.5.1 fixed our problem too. We had updated our redmine last week to 5.x with git-hosting 6.0.1 (on Linux/Debian) and were seeing similar errors:
The error message was a bit different, therefore i mention it here for others to find. The error message can be found at this discussion for libssh2: https://pullanswer.com/questions/ssh-fails-to-fetch-if-not-all-key-types-are-supported |
I have exactly same problem as above
I have tried to fix it in many ways and nothing work.
@sseide Have you found a solution to this problem? |
As i said - the solution from @vytasmk above worked for me too. |
It looks like you are all wrong :) And just by adding: then restarting It worked for me, after hours of unsucessful fixes since I followed wrong leads... till it came to my mind to take a look at /var/log/auth.log |
I can confirm: changing the version of |
I tried to generate a new redmine_gitolite_admin_id_rsa keypair. I refreshed the gitolite setup for the new admin key by running as the gitolite user:
I still had the same error:
Turns out it came from rugged trying to create git-admin.git in /var/cache/redmine/tmp/redmine_git_hosting/git/
and asked me to confirm if I wanted to add the key to the know_hosts file. Then I tried to revert to Debian stable libgit2 and ruby-rugged 1.5.1+ds-1, and also libssh2 1.10.0-3+b1
add So the PubkeyAcceptedAlgorithms will probably not be fixed in a 1.5 patch release but is in 1.7.1. But even with this issue fixed, it could be that the new GHSA-8643-3wh5-rmjq "Beginning in libgit2 v1.4.5 and v1.5.1, libgit2 will now perform host key checking by default. Users can still override the default behavior using the certificate_check function.", will require a change in redmine_git_hosting to add the 127.0.0.1 localhost host key to the redmine user know_hosts file. |
I can confirm the actions described above are essential to get the plugin working. I had the following errors:
Locking rugged version, adding |
On the other install with 22.04 and Redmine 5.1 I had to add both PubkeyAcceptedAlgorithms +ssh-rsa PubkeyAcceptedKeyTypes +ssh-rsa then restarting systemctl restart sshd |
Had to do this in one Ubuntu 20 but Redmine 5.0.8 and Ruby 3 Instance... On Ubuntu 20, PubKey in sshd is not valid config option... |
I struggled for the last three days to make this work on a new Redmine install. The tips from @acosonic and @vytasmk combined resolved the communication issues between the plugin and gitolite/ssh. I just published an updated Docker container that may help other people get a working instance quickly: https://github.com/renanmarks/docker-redmine |
Ah, what I eventually had problem with, is having too weak password for git user... And, it was used to send spam via that server... Because user git user had email enabled, eventually I was able to figure this out... |
A week ago I have updated Redmine to the latest v5.0.4 and redmine_git_hosting v6.0.1. All setup is running on on modified official Docker image. Previously there was Redmine v4.2.x that was made same way and git was working just perfectly.
Today I have my colleague reported that when he tries to checkout repository git asks for password and I know that public keys are not working. Went to
Admin->Plugins->Redmine Git Hosting Plugin -> Rescue TAB
checked all check boxes and hit save. That was to fast from the last time I have ever used this function. Later checked log filegit_hosting.log
which showed errors:... next several hours was trying different methods: checked permissions, recreated all certificates several times, enabled debug mode on Redmine and also on SSHD process nothing helped. And it was unclear from where this error is coming from. I tried to search for that error using Google and I think I found that it is related to gem named
rugged
and in the latest version v1.5.1 this error message was added in the code. Rugged 1.5.0.1 -> 1.5.1 filedata/vendor/libgit2/src/libgit2/transports/ssh.c line: 743
When I check
gem list
inside Docker container I see that there isrugged (1.5.1)
I tried manually to remove this version and install 1.5.0.1 but if I restart Docker container it automatically installs all gems usingbundle install
as there are scripts on startup. I will change them later and try to eliminate them.Has may be anybody sported such problem? That rugged version was released January 21, 2023. So if this is related then all new installations will get in to this problem.
The text was updated successfully, but these errors were encountered: