[JIRA] (JENKINS-54166) Date parameter is lost upon restart

5 views
Skip to first unread message

pibeitz@gmail.com (JIRA)

unread,
Oct 19, 2018, 10:32:02 AM10/19/18
to jenkinsc...@googlegroups.com
Pierre Beitz created an issue
 
Jenkins / Bug JENKINS-54166
Date parameter is lost upon restart
Issue Type: Bug Bug
Assignee: Pierre Beitz
Components: date-parameter-plugin
Created: 2018-10-19 14:31
Priority: Major Major
Reporter: Pierre Beitz

Upon restart, the date parameter plugin is losing the date value.

 

Reproduction Scenario

1. Create a job with a date parameter and use it (for instance in a shell script).

2. Put Jenkins in quiet mode

3. Trigger a build of the job

4. Restart

5. After restart, the job will fail with:

 

ERROR: Build step failed with exception java.lang.IllegalArgumentException: Null value not allowed as an environment variable: DATE at hudson.EnvVars.put(EnvVars.java:356) at hudson.model.StringParameterValue.buildEnvironment(StringParameterValue.java:56) at me.leejay.jenkins.dateparameter.DateParameterValue.buildEnvironment(DateParameterValue.java:81) at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:89) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:947) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:90) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1744) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374)

Explanation

The class DateParameterValue inherits from StringParameterValue but its value field shadows a field of StringParameterValue. Upon restart, only the DateParameterValue field is populated, resulting in this error. Removing the shadow field fixes the issue. I made a PR with this fix.

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

pibeitz@gmail.com (JIRA)

unread,
Oct 19, 2018, 10:33:01 AM10/19/18
to jenkinsc...@googlegroups.com
Pierre Beitz started work on Bug JENKINS-54166
 
Change By: Pierre Beitz
Status: Open In Progress

pibeitz@gmail.com (JIRA)

unread,
Oct 19, 2018, 10:43:02 AM10/19/18
to jenkinsc...@googlegroups.com

pibeitz@gmail.com (JIRA)

unread,
Oct 22, 2018, 12:06:01 PM10/22/18
to jenkinsc...@googlegroups.com
Change By: Pierre Beitz
Status: In Progress Fixed but Unreleased
Resolution: Fixed

pibeitz@gmail.com (JIRA)

unread,
Oct 22, 2018, 12:06:02 PM10/22/18
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages