[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-09-24 Thread kouman...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Panos Koumantos commented on  JENKINS-58711  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
 This issue seems to affect the kubernetes plugin version 1.12.4 as well.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201003.1564417291000.4286.1569337560218%40Atlassian.JIRA.


[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-09-24 Thread kouman...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Panos Koumantos updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-58711  
 
 
  "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
Change By: 
 Panos Koumantos  
 
 
Priority: 
 Minor Major  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201003.1564417291000.3996.1569318300586%40Atlassian.JIRA.


[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-07-29 Thread jack.whelp...@rakuten.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jack Whelpton edited a comment on  JENKINS-58711  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
 Last update for me today: I can also reproduce this by omitting the container {} block but adding defaultContainer 'golang' to the kubernetes{} block. Added Jenkins and k8s plugin versions to the Environment section.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201003.1564417291000.3652.156380118%40Atlassian.JIRA.


[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-07-29 Thread jack.whelp...@rakuten.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jack Whelpton updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-58711  
 
 
  "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
Change By: 
 Jack Whelpton  
 
 
Environment: 
 Jenkins 2.150.3Kubernetes Plugin 1.15.2  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201003.1564417291000.3650.156320164%40Atlassian.JIRA.


[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-07-29 Thread jack.whelp...@rakuten.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jack Whelpton commented on  JENKINS-58711  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
 Last update for me today: I can also reproduce this by omitting the container {} block but adding defaultContainer 'golang' to the kubernetes{} block.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201003.1564417291000.3646.1564442580233%40Atlassian.JIRA.


[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-07-29 Thread jack.whelp...@rakuten.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jack Whelpton commented on  JENKINS-58711  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
 I can also reproduce the same error by running the declarative example from the Kubernetes plugin documentation as-is: https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/test/resources/org/csanchez/jenkins/plugins/kubernetes/pipeline/declarative.groovy 

 
java.io.IOException: container [maven] does not exist in pod [default-jwg9h]
	at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.waitUntilPodContainersAreReady(ContainerExecDecorator.java:476)
	at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.doLaunch(ContainerExecDecorator.java:271)
	at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.launch(ContainerExecDecorator.java:252) 

  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201003.1564417291000.3634.1564438860111%40Atlassian.JIRA.


[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-07-29 Thread jack.whelp...@rakuten.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jack Whelpton edited a comment on  JENKINS-58711  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
 Added First edit: added  a sample implementation of "pull" to reproduce the problem, which I've narrowed down to an "sh" invocation in the shared library function. Second edit: actually, the shared library is not significant: the same error can be reproduced just using an "sh" command insider a "container" block in a declarative pipeline.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201003.1564417291000.3598.1564434360125%40Atlassian.JIRA.


[JIRA] (JENKINS-58711) "Container does not exist" error using "sh" in a declarative pipeline

2019-07-29 Thread jack.whelp...@rakuten.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jack Whelpton updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-58711  
 
 
  "Container does not exist" error using "sh" in a declarative pipeline   
 

  
 
 
 
 

 
Change By: 
 Jack Whelpton  
 
 
Summary: 
 " Container  does  not  found from shared library  exist" error  using  "sh" in a  declarative pipeline  
 

  
 
 
 
 

 
 Attempting to  call a shared library function  use the sh command  from inside a container block results in an error of the form java.io.IOException: container [name] does not exist in pod [id]. This same setup works OK when using the scripted pipeline.Example:{code:java}pipeline {  agent {kubernetes {  yaml """apiVersion: v1kind: Podspec:  containers:  - name: golangimage: busyboxcommand:- cattty: true"""}  }  options {skipDefaultCheckout true  }  stages {stage('Build') {  steps {container('golang') {   pull env   sh 'ls' }  }}  }}{code} pull is a function in a globally defined shared library, which takes the environment variables as an argument. The problem appears to be caused by an sh block inside that shared function. Here's a minimal implementation that demonstrates the issue:{code:java}Map call(config) {  final Map props = checkout scm  props.GIT_ARCHIVE = 'src.tar.gz'  sh "tar -zcf $props.GIT_ARCHIVE *"  return props}{code} Running this pipeline yields:{noformat}java.io.IOException: container [golang] does not exist in pod [default-vhhcf] at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.waitUntilPodContainersAreReady(ContainerExecDecorator.java:476) at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.doLaunch(ContainerExecDecorator.java:271) at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.launch(ContainerExecDecorator.java:252) at hudson.Launcher$ProcStarter.start(Launcher.java:455) at org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:206) at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:99) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:302) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:268) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:176) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1278) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1172) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at