Skip to content
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

All ssh related settings disappeared after upgrade from v1.8.0 #1436

Open
esonhon opened this issue Nov 10, 2022 · 6 comments
Open

All ssh related settings disappeared after upgrade from v1.8.0 #1436

esonhon opened this issue Nov 10, 2022 · 6 comments

Comments

@esonhon
Copy link

esonhon commented Nov 10, 2022

I just upgrade my self hosted gitblit from v1.8.0 to v1.9.3, use the war package to deploy, then copy and overrite the WEB-INF/data projects.conf users.conf and git folder from the old version.
Everythings works except all SSH related functions gone. SSH can not be connected, SSH key settings menu not found.
Have checked the default.properties config, ssh port is 29418.

@flaix
Copy link
Member

flaix commented Nov 10, 2022

Did you check the log? It usually say something about SSH port being opened.

@esonhon
Copy link
Author

esonhon commented Nov 10, 2022

@flaix Thanks. BTW, Do you mean the gitblit log? I can not find any .log file in gitblit install folder.

@flaix
Copy link
Member

flaix commented Nov 10, 2022

Yes, I mean the Gitblit logging. I don't know where logging goes when run as a WAR in an application server, I don't run it that way. I would have to try it myself, as I cannot think of any cause. But I won't get to do that before the weekend. :(

@flaix
Copy link
Member

flaix commented Nov 10, 2022

What is your application server? And how did you update?

@esonhon
Copy link
Author

esonhon commented Nov 10, 2022

Tomcat 7 with JDK 7 and 8
I just have a brand new installation, SSH option still can not be find. But in version 1.8.0, it works.

@flaix
Copy link
Member

flaix commented Nov 11, 2022

I could not reproduce this. You may have to provide detailed steps how to reproduce this.
I have downloaded Tomcat 7.0.109 and have unpacked the tar.gz file on a Linux Mint 19.1. This is using OpenJDK 8.
I have started the Tomcat server and checked the open HTTP port:

$ ps ax | grep tomcat
11876 pts/0    Sl     0:16 /usr/lib/jvm/java-8-openjdk-amd64/bin/java  [...] org.apache.catalina.startup.Bootstrap start

$ sudo netstat -tlpn   
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      561/systemd-resolve 
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      647/cupsd           
tcp6       0      0 :::8080                 :::*                    LISTEN      11876/java          
tcp6       0      0 ::1:631                 :::*                    LISTEN      647/cupsd           
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      11876/java      

I have then downloaded the gitblit-1.9.3.war file and have copied it into the webapps folder as gitblit.tar.gz. A few seconds later I had a running instance under http://localhost:8080/gitblit. I could log in as admin and create a new repository with an initial commit.

The repository page did show the SSH URI (ssh://admin@localhost:29418/test.git) by default, which I did copy and I could run a clone command successfully over SSH.

Running netstatagain showed that the Tomcat app had the Git and SSH ports open:

$ sudo netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      561/systemd-resolve 
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      647/cupsd           
tcp6       0      0 :::29418                :::*                    LISTEN      11876/java          
tcp6       0      0 :::9418                 :::*                    LISTEN      11876/java          
tcp6       0      0 :::8080                 :::*                    LISTEN      11876/java          
tcp6       0      0 ::1:631                 :::*                    LISTEN      647/cupsd           
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      11876/java 

So I would say that in general it works and it'll need more detail and research why it doesn't work in your case.

The Gitblit logs are written to the container logs. I could find them in apache-tomcat-7.0.109/logs/catalina.out. This file contained for example:

2022-11-11 21:52:16 [INFO ] ----[com.gitblit.manager.IServicesManager]----
2022-11-11 21:52:16 [INFO ] Federation passphrase is blank! This server can not be PULLED from.
2022-11-11 21:52:16 [INFO ] Fanout PubSub service is disabled.
2022-11-11 21:52:16 [INFO ] Git Daemon is listening on 0.0.0.0:9418
2022-11-11 21:52:16 [INFO ] Generating RSA-2048 SSH host keypair...
2022-11-11 21:52:16 [INFO ] Generating DSA SSH host keypair...
2022-11-11 21:52:17 [INFO ] SSH: adding public key authentication method.
2022-11-11 21:52:17 [INFO ] SSH: adding password authentication method.
2022-11-11 21:52:17 [INFO ] SSH Daemon (NIO2) is listening on 0.0.0.0:29418
2022-11-11 21:52:17 [INFO ] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants