[JIRA] (JENKINS-60331) Checkout over SSH not working anymore after restarting jenkins

9 views
Skip to first unread message

schmitt@semvox.de (JIRA)

unread,
Nov 29, 2019, 8:39:02 AM11/29/19
to jenkinsc...@googlegroups.com
Christian Schmitt created an issue
 
Jenkins / Bug JENKINS-60331
Checkout over SSH not working anymore after restarting jenkins
Issue Type: Bug Bug
Assignee: Unassigned
Components: gitea-plugin
Created: 2019-11-29 13:38
Environment: Jenkins 2.190.3
gitea-plugin 1.1.2
Priority: Major Major
Reporter: Christian Schmitt
  • Gitea organization configured with "Checkout over SSH"
  • Using a private key from the jenkins credential store or adding one (since "use build agents key" also not working :-/ )
  • Then it's Initially working
  • After a Jenkins restart git commands are falling back to https
  • When triggering "Scan Gitea Organization Now" it's working again till next restart

Similar to JENKINS-46094

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

fochler@ehealthexperts.de (JIRA)

unread,
Apr 3, 2020, 2:44:03 AM4/3/20
to jenkinsc...@googlegroups.com
Christian Fochler edited a comment on Bug JENKINS-60331
 
Re: Checkout over SSH not working anymore after restarting jenkins
Until there is a fix in the plugin, I setup a [init hook script| [https://jenkins.io/doc/book/managing/groovy-hook-scripts/ #post-initialization-script-init-hook]]. The script is doing a rescan of all organizations after Jenkins starts up:
{code:java}
import hudson.model.AbstractItem;
import jenkins.model.Jenkins;

for (item in Jenkins.instance.getAllItems(AbstractItem.class)) {
  if (item instanceof jenkins.branch.OrganizationFolder) {
    item.doBuild()
    println("Triggered on-boot organization folder scan for " + item.fullName)
  }
}
{code}
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

fochler@ehealthexperts.de (JIRA)

unread,
Apr 3, 2020, 2:44:03 AM4/3/20
to jenkinsc...@googlegroups.com

Until there is a fix in the plugin, I setup a init hook script. The script is doing a rescan of all organizations after Jenkins starts up:

import hudson.model.AbstractItem;
import jenkins.model.Jenkins;
for (item in Jenkins.instance.getAllItems(AbstractItem.class)) { 
  if (item instanceof jenkins.branch.OrganizationFolder) { 
    item.doBuild() 
    println("Triggered on-boot organization folder scan for " + item.fullName) 
  }
}

fochler@ehealthexperts.de (JIRA)

unread,
Apr 3, 2020, 2:45:02 AM4/3/20
to jenkinsc...@googlegroups.com
Christian Fochler edited a comment on Bug JENKINS-60331
Until there is a fix in the plugin, I setup a an  [init hook script|#post-initialization-script-init-hook] ] . The script is doing a rescan of all organizations after Jenkins starts up:
{code:java}

import hudson.model.AbstractItem;
import jenkins.model.Jenkins;

for (item in Jenkins.instance.getAllItems(AbstractItem.class)) {
  if (item instanceof jenkins.branch.OrganizationFolder) {
    item.doBuild()
    println("Triggered on-boot organization folder scan for " + item.fullName)
  }
}
{code}
Reply all
Reply to author
Forward
0 new messages