[JIRA] (JENKINS-39122) Certain Groovy expressions cause Global Library loading to Silently Fail
Title: Message Title Sam Barron commented on JENKINS-39122 Re: Certain Groovy expressions cause Global Library loading to Silently Fail Please disregard my comment. I discovered the issue was jenkins hanging for a failing assert https://issues.jenkins-ci.org/browse/JENKINS-34488 I was doing asserts as the first step in my Pipeline. Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- 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. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39122) Certain Groovy expressions cause Global Library loading to Silently Fail
Title: Message Title Sam Barron commented on JENKINS-39122 Re: Certain Groovy expressions cause Global Library loading to Silently Fail I am having a similar issue Jenkins ver 2.16 Pipeline: Shared Groovy Libraries 2.3 I can't confirm what line from my groovy class is causing any issue. When I start a pipeline that loads shared libraries, I get the same hanging issue right after checking out the library, the pipeline doesn't start, and I have to manually abort and forcibly terminate the job. Kenneth Baltrinic How did you troubleshoot this? I didn't have any issues with the shared groovy libraries until I tried using two different versions (one 'master', one 'dev') during some testing. I'm going to try to upgrade the plugin and see if it helps. Looks like there was some work done on how different libraries are checked out. Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- 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. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39122) Certain Groovy expressions cause Global Library loading to Silently Fail
Title: Message Title Kenneth Baltrinic updated an issue Jenkins / JENKINS-39122 Certain Groovy expressions cause Global Library loading to Silently Fail Change By: Kenneth Baltrinic h2. SummaryCertain legitimate groovy expressions, when present in a groovy global shared library will cause any pipeline job that attempts to load the library to hang at the point immediately after the library is loaded. This occurs with no errors in the job console nor any errors in the jenkins logs, effectively leaving the user to have to start guessing at possible causes.h2. Steps to ReproduceI don't know if there are other scenarios that will cause this but here is a reproducible one that I have come up with.h3. Step 1Create a repo in git and configure it to be loaded on demand. In our case we are loading under the name 'pipeline- libs utils '.h3. Step 2Create the following file in that library:{ { quote} /src/examples/Bug.groovy {quote } } with conntent: {code: groovy java }package examplesimport groovy.transform.Field// This is the line that seems to be the real cause of the problem. A final static field that invokes a function to get its value.@Field def static final API_BASE_URL = absolutizeUrl("api")def static absolutizeUrl(relativeUrl) { return "http://myserver/${relativeUrl}" }{code}h3. Step 3Now create a pipeline job with the following DSL:{code: groovy java }@Library('pipeline-utils')import examples.Bug//Though the bug seems to be triggered by the field declaration, it isn't activated if we don't invoke a function from the class in question.println Bug.absolutizeUrl('ui'){code}h3. Step 4Run this job and you will get output similar to the following:{code}Started by user Baltrinic, KennethLoading library pipeline-utils@master > git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > git config remote.origin.url ssh://git@stash:7999/jenkins/pipeline-utils.git # timeout=10Fetching upstream changes from ssh://git@stash:7999/jenkins/pipeline-utils.git > git --version # timeout=10 > git fetch --tags --progress ssh://git@stash:7999/jenkins/pipeline-utils.git +refs/heads/*:refs/remotes/origin/* > git rev-parse origin/master^{commit} # timeout=10Checking out Revision 164a989ac7555e33541894d966075819c3e66143 (origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 164a989ac7555e33541894d966075819c3e66143 > git rev-list 395d5408a41619030e2855f01bb55a7103ce6b10 # timeout=10{code}At this point the job there will be no further console output and the job is hung and must be forcibly aborted.h2. RecommendationsThis is admittedly an esoteric scenario. I am not so concerned that a fix be implemented to allow this code to load correctly. My main concern is that the failure must not be silent. It may be impossible to account for all the ways in which things might fail to load or be processed by the CPS system, etc. But better error reporting that clearly identifies the offending file and line number should be possible. This took me the
[JIRA] (JENKINS-39122) Certain Groovy expressions cause Global Library loading to Silently Fail
Title: Message Title Kenneth Baltrinic updated an issue Jenkins / JENKINS-39122 Certain Groovy expressions cause Global Library loading to Silently Fail Change By: Kenneth Baltrinic Issue Type: Improvement Bug Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- 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. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39122) Certain Groovy expressions cause Global Library loading to Silently Fail
Title: Message Title Kenneth Baltrinic created an issue Jenkins / JENKINS-39122 Certain Groovy expressions cause Global Library loading to Silently Fail Issue Type: Improvement Assignee: Unassigned Components: pipeline Created: 2016/Oct/20 1:17 AM Environment: Jenkins 2.7.1 with Pipeline 2.4 and Pipeline Shared Groovy Libraries 2.4 Priority: Major Reporter: Kenneth Baltrinic Summary Certain legitimate groovy expressions, when present in a groovy global shared library will cause any pipeline job that attempts to load the library to hang at the point immediately after the library is loaded. This occurs with no errors in the job console nor any errors in the jenkins logs, effectively leaving the user to have to start guessing at possible causes. Steps to Reproduce I don't know if there are other scenarios that will cause this but here is a reproducible one that I have come up with. Step 1 Create a repo in git and configure it to be loaded on demand. In our case we are loading under the name 'pipeline-libs'. Step 2 Create the following file in that library: {{ /src/examples/Bug.groovy}} with conntent: Unable to find source-code formatter for language: groovy. Available languages are: actionscript, html, java, _javascript_, none, sql, xhtml, xml package examples import groovy.transform.Field // This is the line that seems to be the real cause of the problem. A final static field that invokes