[JIRA] (JENKINS-60115) NullPointerException in Declarative Pipeline after upgrade from 1.3.9 to 1.4.0

2019-11-14 Thread pverhey...@broadleafcommerce.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Phillip Verheyden commented on  JENKINS-60115  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: NullPointerException in Declarative Pipeline after upgrade from 1.3.9 to 1.4.0   
 

  
 
 
 
 

 
 Thanks for the response, sorry for the cloak and dagger. My pipeline script is a bit unique in that this is what my Jenkinsfile looks like in all my projects: 

 

mavenBuild{ }  

 And then I have a shared library that has a `vars/mavenBuild.groovy` that has the declarative pipeline in it. Pasted below. 

 

import com.broadleafcommerce.jenkins.DependentProject
import com.broadleafcommerce.jenkins.DependentProjectDiscoverer
import com.broadleafcommerce.jenkins.ReleaseUtils
import com.broadleafcommerce.jenkins.SonarUtils
import com.broadleafcommerce.jenkins.Utils

def call(body) {
  // evaluate the body block, and collect configuration into the object
  def pipelineParams = [:]
  body.resolveStrategy = Closure.DELEGATE_FIRST
  body.delegate = pipelineParams
  body()

  println "Building with Jenkinsfile settings: $pipelineParams"
  Utils.abortPreviousUpstreamBuilds(currentBuild)

  def extraBuildProfiles = pipelineParams.extraBuildProfiles ?: ''
  def extraDeployProfiles = pipelineParams.extraDeployProfiles ?: ''
  def sonarAnalysis = pipelineParams.sonarAnalysis ?: ''
  def javadocsDirectories = pipelineParams.javadocsDirectories ?: []
  def referenceDocsDirectories = pipelineParams.referenceDocsDirectories ?: []
  def agentLabel = pipelineParams.agentLabel ?: 'maven-jdk8'
  def requiresNpmrc = pipelineParams.requiresNpmrc != null ? pipelineParams.requiresNpmrc : false
  def forceDeploy = pipelineParams.forceDeploy != null ? pipelineParams.forceDeploy : false

  def mainBranch = Utils.isMainBranch(this)
  def shouldDeploy = mainBranch || forceDeploy || params.FORCE_DEPLOY || params.IS_RELEASE_BUILD
  def mavenVersion = '3.6'

  pipeline {

parameters {
  string(
// Disabling the classpathURLCheck is for a bug in OpenJDK that prevents Surefire from running properly
// see https://stackoverflow.com/questions/53010200/maven-surefire-could-not-find-forkedbooter-class/53016532

defaultValue: '-Xmx2048m -Djdk.net.URLClassPath.disableClassPathURLCheck=true',
name: 'MAVEN_OPTS',
description: 'JVM parameters passed to Maven as MAVEN_OPTS'
  )
  string(
// Disabling the classpathURLCheck is for a bug in OpenJDK that prevents Surefire from running properly
// see https://stackoverflow.com/questions/53010200/maven-surefire-could-not-find-forkedbooter-class/53016532

defaultValue: '',
name: 'MAVEN_BUILD_ARGS',
description: 'Arguments passed directly to the Maven process (like -X, -e, any extra -D arguments etc). Only applies to the build phase on CI builds, applies to _both_ release:prepare and release:perform on release builds'
  )
  booleanParam(
defaultValue: false,
name: 'IS_RELEASE_BUILD',
description: 'Indicate whether or not this build should be treated as a release'
  +' (GA, milestone, etc) If you would like to validate the versions that are autogenerated,'
  +' use VALIDATE_RELEASE_VERSION_DEFAULTS. Otherwise, current release version (in conjunction'
  +' with 

[JIRA] (JENKINS-60115) NullPointerException in Declarative Pipeline after upgrade from 1.3.9 to 1.4.0

2019-11-08 Thread pverhey...@broadleafcommerce.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Phillip Verheyden created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-60115  
 
 
  NullPointerException in Declarative Pipeline after upgrade from 1.3.9 to 1.4.0   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Andrew Bayer  
 
 
Components: 
 pipeline-model-definition-plugin  
 
 
Created: 
 2019-11-09 00:26  
 
 
Environment: 
 Java 8, Jenkins kubernetes over JNLP  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Phillip Verheyden  
 

  
 
 
 
 

 
 After the upgrade to 1.4.0, my builds started to fail with a NullPointerException when parsing the model. Here's the full stack trace:   

 

java.lang.NullPointerExceptionava.lang.NullPointerException at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStep.withOrWithoutParens(ModelASTStep.java:111) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStep.toGroovy(ModelASTStep.java:100) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement.toGroovy(ModelASTElement.java:142) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBranch.toGroovy(ModelASTBranch.java:41) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStage.toGroovy(ModelASTStage.java:115) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement.toGroovy(ModelASTElement.java:142) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement.toGroovyBlock(ModelASTElement.java:213) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStages.toGroovy(ModelASTStages.java:44) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement.toGroovy(ModelASTElement.java:122) at org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPipelineDef.toGroovy(ModelASTPipelineDef.java:58) 

[JIRA] (JENKINS-49332) Jenkins unable to manage webhooks of Github organization

2018-11-15 Thread pverhey...@broadleafcommerce.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Phillip Verheyden commented on  JENKINS-49332  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Jenkins unable to manage webhooks of Github organization
 

  
 
 
 
 

 
 Neidhart Orlich your issue is that you do not have a 'Secret Text' credentials with a personal access token. Try my instructions above (https://issues.jenkins-ci.org/browse/JENKINS-49332?focusedCommentId=340820=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-340820) with a 'Secret Text' credential and see if that makes a difference.  
 

  
 
 
 
 

 
 
 

 
 
 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.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49332) Jenkins unable to manage webhooks of Github organization

2018-11-12 Thread pverhey...@broadleafcommerce.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Phillip Verheyden commented on  JENKINS-49332  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Jenkins unable to manage webhooks of Github organization
 

  
 
 
 
 

 
 

which doesn't seem to be what you have put in that field.
 No, I put my GitHub organization in that field. When you create an organization in Jenkins, you essentially have to fill out 2 fields: 
 
Credentials - this is the username/password of the owner user I was talking about earlier 
Owner - this is the actual GitHub organization name, e.g.  https://github.com/some_organization/, so some_organization is what you put in that field 
 Additionally, you have to go to Manage Jenkins -> Configure System (I had a typo in my original comment; this used to say 'Configure Security and now it says 'Configure System'), scroll down to the 'GitHub' section and add a new GitHub server. Then follow my instructions about the secret text with the access token, etc. So creating the organization to scan in Jenkins is not the only place you have to update. You also have to go and add a GitHub Server with the secret text in 'Manage Jenkins'. I agree with you that it seems wrong to manage this in both places and I don't know why this is the case. This is just the workaround as it worked for me, YMMV.  
 

  
 
 
 
 

 
 
 

 
 
 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.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49332) Jenkins unable to manage webhooks of Github organization

2018-11-12 Thread pverhey...@broadleafcommerce.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Phillip Verheyden edited a comment on  JENKINS-49332  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Jenkins unable to manage webhooks of Github organization
 

  
 
 
 
 

 
 I think this might have been in a relatively recent upgrade of the GitHub plugin or something. I started getting a lot of these, here's what I did to resolve it: # Add a 'Secret Text' global credential. The secret should be your access token from GitHub that probably has at least write access to repos (I didn't investigate which roles are required). ID and description doesn't matter. This *must* be 'Secret Text' for the next pieces to work right # Go to Manage Jenkins -> Configure  Security  System  and down to 'GitHub Servers' # Hit 'Add GitHub Server' ## Name - doesn't matter ## API URL - since I don't have a private GitHub Enterprise install (just private repos on github.com) I used the default of [https://api.github.com|https://api.github.com/] ## Credentials - the 'Secret Text' credential from earlier (this dropdown only pulls 'Secret Text' credentials) ## Manage Hooks - checked # Hit 'Test Connection' to make sure everything is kosher # Go to your organization and 'Scan Organization Now' on the left This should clean up all of the warnings about installing webhooks.  
 

  
 
 
 
 

 
 
 

 
 
 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.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49332) Jenkins unable to manage webhooks of Github organization

2018-11-12 Thread pverhey...@broadleafcommerce.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Phillip Verheyden commented on  JENKINS-49332  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Jenkins unable to manage webhooks of Github organization
 

  
 
 
 
 

 
 Brian J Murrell I did not need to specify anything about an account for the access token. I have a "Jenkins User" account that I created on GitHub and is specified as an owner for my organization. I went into that account and created an access token (from https://github.com/settings/tokens)  and used that for the value of the secret text in my workaround. As I mentioned, I did not investigate which scopes were required; the access token I use has access to all scopes. This definitely works for organization repos, that is my only use case. I have been warning-free in my Jenkins install since I posted my previous comment. Maybe the key is that the account for which the personal access token is generated is an organization owner account?  
 

  
 
 
 
 

 
 
 

 
 
 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.
For more options, visit https://groups.google.com/d/optout.