Hello,
We recently moved our JIRA instance to a new server on a different domain and network subnet. Everything appears to be working well with the exception of the Gerrit plug-in.
The error mentioned in the subject title now appears in the "Gerrit Reviews" panel for any issues.
I have done the following checks to confirm the configuration should be correct (in theory):
1. Added a new public ssh-key to the gerrit user account that is used for all ssh queries for the new JIRA instance.
2. Checked the ssh configuration is working by running the following command as user "jira" which is used by our JIRA instance:
ssh -p 29418 gerrituser@gerrit_server gerrit query --format TEXT message:TG-173
The above command works correctly and returns the open gerrit ticket TG-173 from our gerrit server.
3. Checked that I can download the URL for the above ticket from the gerrit server using 'wget'.
I've tried to run a grep through the atlassian log files, but couldn't see any relevant error messages for the ssh error to understand more deeply what might be failing in our configuration.
Since the original JIRA installation worked and we imported the database from the original JIRA installation, the problem could quite possibly be caused by this import process.
I have tried uninstalling Gerrit and re-installing it without success. I should note that when I did this, the Gerrit configuration dialog appeared to remember all previous settings, so I don't think the plug-in uninstall is comprehensively deleting associated data from the database.
Any pointers into how to solve this problem gratefully received.
Liam.
I managed to eventually find catalina.out and the following trace:
Caused by: com.jcraft.jsch.JSchException: invalid privatekey: /var/atlassian/application-data/jira/data/com/meetme/plugins/jira/gerrit/wcdma-git.picochip.com1299857170919082294.key at com.jcraft.jsch.IdentityFile.<init>(IdentityFile.java:224) at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:135) at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:130) at com.jcraft.jsch.JSch.addIdentity(JSch.java:206) at com.jcraft.jsch.JSch.addIdentity(JSch.java:200) at com.sonyericsson.hudson.plugins.gerrit.gerritevents.ssh.SshConnectionImpl.<init>(SshConnectionImpl.java:78)
I checked the key file we had on record and discovered that it was in fact an RSA public key rather than the paired private key. Upon addressing this problem I am pleased to report that the Gerrit plugin is now working.
Hi Liam,
to enable some logging, you will have to set the following level :
i suggest that you re-upload the Private key ( a private key with no password ) .. but you should have some more verbose output wiith the above mentioned level .
best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the suggestion, Trey. I've done as suggested and enabled DEBUG for the above modules under the ViewLogging.jspa page.
However, I did not see any additional debug trace reported either under the 'Gerrit' tab in the GUI or in the atlassian-jira.log file.
Do I need to look somewhere else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
did you check catalin.out , websphere.log. atlassian-jira.log .. ?
you should see one of :
Connected:true
Connected:false
a stacktrace (when something is wrong)
here is the fulle name of the package : com.sonyericsson.hudson.plugins.gerrit.gerritevents.ssh
here is the code :
logger.debug("connecting..."); try { client = new JSch(); client.addIdentity(authentication.getPrivateKeyFile().getAbsolutePath(), authentication.getPrivateKeyFilePassword()); client.setHostKeyRepository(new BlindHostKeyRepository()); connectSession = client.getSession(authentication.getUsername(), host, port); connectSession.connect(); logger.debug("Connected: {}", connectSession.isConnected()); connectSession.setServerAliveInterval(ALIVE_INTERVAL); } catch (JSchException ex) { throw new SshException(ex); }
best regards;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One further and important point to add. I have also checked the Gerrit sshd "site/log/sshd_log" file and can see that there are no access attempts being made from our JIRA instance which suggests that the Gerrit plugin is, for some unknown reason, not running or unable to connect outwardly on ssh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.