[JIRA] (JENKINS-49581) Pipeline with syntax error hung forever

1 view
Skip to first unread message

witold.konior@formulate.se (JIRA)

unread,
Feb 15, 2018, 10:42:02 AM2/15/18
to jenkinsc...@googlegroups.com
Witold Konior created an issue
 
Jenkins / Bug JENKINS-49581
Pipeline with syntax error hung forever
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2018-02-15 15:41
Environment: Jenkins 2.101
Priority: Minor Minor
Reporter: Witold Konior

Hi,

Take this example:

podTemplate(
    label: 'postgres',
    containers: [
        containerTemplate(
            name: 'postgres',
            image: 'postgres/latest',
            privileged: false,
            alwaysPullImage: true,
        )
    ],
    node('validate'){
        container('datamodel') {
            stage("Pull") {
                checkout scm
            }
        }
    }
)

In my opinion there is syntax error here, didn't find any reference to `node` field in `podTemplate`. However this will wait forever for `pod` in k8s cluster while it's never created.

After changing this into proper syntax, it works ofc.
 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

witold.konior@formulate.se (JIRA)

unread,
Feb 15, 2018, 10:43:02 AM2/15/18
to jenkinsc...@googlegroups.com
Witold Konior updated an issue
Change By: Witold Konior
Hi,

Take this example:
{code:java}

podTemplate(
    label: 'postgres',
    containers: [
        containerTemplate(
            name: 'postgres',
            image: 'postgres/latest',
            privileged: false,
            alwaysPullImage: true,
        )
    ],
    node(' validate postgres '){
        container('
datamodel postgres ') {

            stage("Pull") {
                checkout scm
            }
        }
    }
)
{code}


In my opinion there is syntax error here, didn't find any reference to `node` field in `podTemplate`. However this will wait forever for `pod` in k8s cluster while it's never created.

After changing this into proper syntax, it works ofc.
 

witold.konior@formulate.se (JIRA)

unread,
Feb 15, 2018, 10:45:03 AM2/15/18
to jenkinsc...@googlegroups.com
Witold Konior updated an issue
Change By: Witold Konior
Attachment: image-2018-02-15-16-44-13-193.png

witold.konior@formulate.se (JIRA)

unread,
Feb 15, 2018, 10:46:02 AM2/15/18
to jenkinsc...@googlegroups.com
Witold Konior updated an issue
Hi,

Take this example:
{code:java}
podTemplate(
    label: 'postgres',
    containers: [
        containerTemplate(
            name: 'postgres',
            image: 'postgres/latest',
            privileged: false,
            alwaysPullImage: true,
        )
    ],
    node('postgres'){
        container('postgres') {

            stage("Pull") {
                checkout scm
            }
        }
    }
)
{code}

In my opinion there is syntax error here, didn't find any reference to `node` field in `podTemplate`. However this will wait forever for `pod` in k8s cluster while it's never created.

After changing this into proper syntax, it works ofc.

And this is what I see from console logs:

!image-2018-02-15-16-44-13-193.png!

Seems like vary common info, while it's waiting for `POD` creation.

 

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Feb 15, 2018, 11:28:02 AM2/15/18
to jenkinsc...@googlegroups.com

witold.konior@formulate.se (JIRA)

unread,
Feb 15, 2018, 1:42:02 PM2/15/18
to jenkinsc...@googlegroups.com
Witold Konior edited a comment on Bug JENKINS-49581
I'm afraid that there is no logs at all. Other piplines generate a lot of output to  this logger `org.csanchez.jenkins.plugins.kubernetes` however not UUT one. In "main" logger I get notification only after I abort job otherwise it's no mentioned , but I think it's not relevant, or ?

witold.konior@formulate.se (JIRA)

unread,
Feb 15, 2018, 1:42:03 PM2/15/18
to jenkinsc...@googlegroups.com

I'm afraid that there is no logs at all. Other piplines generate a lot of output to  this logger `org.csanchez.jenkins.plugins.kubernetes` however not UUT one. In "main" logger I get notification only after I abort job, but I think it's not relevant, or ?

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Feb 15, 2018, 2:50:03 PM2/15/18
to jenkinsc...@googlegroups.com
Carlos Sanchez updated an issue
 
Change By: Carlos Sanchez
Component/s: pipeline
Component/s: kubernetes-plugin

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Feb 15, 2018, 2:51:02 PM2/15/18
to jenkinsc...@googlegroups.com
Carlos Sanchez commented on Bug JENKINS-49581
 
Re: Pipeline with syntax error hung forever

ok, so it's a pipeline issue, not k8s plugin

andrew.bayer@gmail.com (JIRA)

unread,
Feb 20, 2018, 3:52:54 PM2/20/18
to jenkinsc...@googlegroups.com
Andrew Bayer updated an issue
 

Actually, this'd be in kubernetes-plugin - something about podTemplate must be executing that node block.

Change By: Andrew Bayer
Component/s: kubernetes-plugin
Component/s: pipeline

andrew.bayer@gmail.com (JIRA)

unread,
Feb 20, 2018, 3:53:02 PM2/20/18
to jenkinsc...@googlegroups.com

jesus.javier.arauz@ericsson.com (JIRA)

unread,
Sep 12, 2018, 11:28:02 AM9/12/18
to jenkinsc...@googlegroups.com
Javier Arauz commented on Bug JENKINS-49581
 
Re: Pipeline with syntax error hung forever

What I think is happening is the following. Given the lazy evaluation of actual arguments intrinsic to Groovy, the groovy interpreter first tries to obtain all the actual arguments before calling the function. As part of that process it runs the node() step. Since podTemplate(label: 'postgres', ...) hasn't been called yet, there is no node with that label, and the node() step blocks indefinitely trying to get hold of such a node.

Notice the interpreter can't detect the wrong argument type in the call to podTemplate() since it first needs to evaluate the node() step. This kind of issues are catched by the compiler in a type-safe language.

If the node() step gave up and returned, the interpreter would catch the wrong argument type and the call to podTemplate() would fail.

 

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

jglick@cloudbees.com (JIRA)

unread,
Jul 16, 2019, 3:43:32 PM7/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
 
Change By: Jesse Glick
Assignee: Carlos Sanchez
Reply all
Reply to author
Forward
0 new messages