[JIRA] (JENKINS-38608) Null value not allowed as an environment variable: GIT_URL_2

327 views
Skip to first unread message

kathleen.lapinski@aquilent.com (JIRA)

unread,
Sep 29, 2016, 11:02:02 AM9/29/16
to jenkinsc...@googlegroups.com
Kathleen Lapinski created an issue
 
Jenkins / Bug JENKINS-38608
Null value not allowed as an environment variable: GIT_URL_2
Issue Type: Bug Bug
Assignee: Mark Waite
Components: bitbucket-plugin, git-plugin
Created: 2016/Sep/29 3:01 PM
Priority: Major Major
Reporter: Kathleen Lapinski

When creating a build in Jenkins using GIT and Bitbucket, I get the following error

FATAL: Null value not allowed as an environment variable: GIT_URL_2
java.lang.IllegalArgumentException: Null value not allowed as an environment variable: GIT_URL_2
at hudson.EnvVars.put(EnvVars.java:356)
at hudson.EnvVars.put(EnvVars.java:74)
at hudson.plugins.git.GitSCM.buildEnvVars(GitSCM.java:1265)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:927)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1075)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 29, 2016, 9:00:01 PM9/29/16
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 29, 2016, 9:07:02 PM9/29/16
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-38608
 
Re: Null value not allowed as an environment variable: GIT_URL_2

I think this likely indicates that your job has an unexpected definition of an environment variable (any environment variable) which is empty or otherwise somehow null (or possibly the empty string).

Unfortunately, I can't duplicate the problem as described. Steps I took included:

  1. Create a new freestyle job
  2. Parameterize the job with a single string parameter, "GIT_URL_2", with default value field empty
  3. Configure git as the SCM for the job
  4. Add an XShell build step which runs echo $GIT_URL_2
  5. Run the job and don't change the default parameter value
  6. Confirm the job runs to success without a stack trace or other error
  7. Confirm the value of GIT_URL_2 is not set in the output

Please provide a sequence of steps which show how to duplicate the problem.

steffen@earthlingsoft.net (JIRA)

unread,
Dec 6, 2016, 2:42:01 PM12/6/16
to jenkinsc...@googlegroups.com

I have just encountered the same issue and found that I had erroneously configured two Git repositories and left the URL of the second one empty (probably because I clicked the "Add Repository" button after entering the URL, assuming that I had to confirm the setting). Just go to the configuration page for the project and have a look at the source code management section. I suspect you have configured two "Repositories" where one of them does not have an URL. Remove this repository and initiate the build again using a git push (or by resending the commit hook from the Bitbucket site).

mark.earl.waite@gmail.com (JIRA)

unread,
Dec 10, 2016, 10:39:01 AM12/10/16
to jenkinsc...@googlegroups.com

Thanks Steffen Kamp, I can duplicate the issue now as well. When I add a second repository, then don't provide any values for the fields in the second repository, the freestyle build I was testing fails with the GIT_URL_2 cannot be empty message.

mark.earl.waite@gmail.com (JIRA)

unread,
Dec 10, 2016, 10:40:01 AM12/10/16
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-38608
Thanks [~styv], I can duplicate the issue now as well based on your discovery .   Much appreciated!

  When I add a second repository, then don't provide any values for the fields in the second repository, the freestyle build I was testing fails with the GIT_URL_2 cannot be empty message.

mark.earl.waite@gmail.com (JIRA)

unread,
Dec 10, 2016, 10:40:01 AM12/10/16
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-38608
Thanks [~styv], I can duplicate the issue now based on your discovery.  Much appreciated!


When I add a second repository, then don't provide any values for the fields in the second repository, the freestyle build I was testing fails with the GIT_URL_2 cannot be empty message.


There is a large red warning on the web page when the URL field is empty, but if I ignore that red warning, save the job definition, and run the job, it fails with exactly that message.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 9, 2017, 9:21:02 PM2/9/17
to jenkinsc...@googlegroups.com

ttmost@gmail.com (JIRA)

unread,
Feb 8, 2018, 3:05:02 PM2/8/18
to jenkinsc...@googlegroups.com
Tsvi Mostovicz commented on Bug JENKINS-38608
 
Re: Null value not allowed as an environment variable: GIT_URL_2

I just had the same issue due to the fact that I changed the parameters in my Jenkinsfile.

Deleting the parameters from the configuration, fixed the issue.

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

torsten.werner@assyst-intl.com (JIRA)

unread,
Jul 31, 2018, 3:42:02 AM7/31/18
to jenkinsc...@googlegroups.com

I've the same problem with a date parameter.

Name: BUILD_YEAR, Date format: yyyy, Default: LocalDate.now();

It is really strange, sometimes is it working, sometimes not.

When I try to access the environment in a pipeline script with getEnvironment method of hudson.model.FreeStyleBuild I get an exception

java.lang.IllegalArgumentException: Null value not allowed as an environment variable: BUILD_YEAR

When I look in the web page of exactly this build in the "Environment" section the environment variable is properly set. It is definitely not empty.

The build.xml of this build contains:

<me.leejay.jenkins.dateparameter.DateParameterValue plugin="date-pa...@0.0.3">
<name>BUILD_YEAR</name>
<description>Year to use in copyright string (1985-yyyy)</description>
<value>2018</value>
<value defined-in="me.leejay.jenkins.dateparameter.DateParameterValue">2018</value>
<dateFormat>yyyy</dateFormat>
</me.leejay.jenkins.dateparameter.DateParameterValue>

InjectedEnvVars.txt of this build contains:

BUILD_YEAR=2018

For me it is a blocker because I've no chance to check the build parameters of a former build in a pipeline script.

 

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

torsten.werner@assyst-intl.com (JIRA)

unread,
Jul 31, 2018, 3:42:02 AM7/31/18
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 14, 2020, 12:02:05 AM1/14/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
When creating a build in Jenkins using GIT and Bitbucket, I get the following error

FATAL: Null value not allowed as an environment variable: GIT_URL_2
java.lang.IllegalArgumentException: Null value not allowed as an environment variable: GIT_URL_2
at hudson.EnvVars.put(EnvVars.java:356)
at hudson.EnvVars.put(EnvVars.java:74)
at hudson.plugins.git.GitSCM.buildEnvVars(GitSCM.java:1265)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:927)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1075)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE


Problem requires that a repository is added to the Freestyle job definition which has *no repository URL*.  If the repository URL is non-empty, the problem does not occur.
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 14, 2020, 12:02:05 AM1/14/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 14, 2020, 12:09:04 AM1/14/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 14, 2020, 12:09:05 AM1/14/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
When creating a build in Jenkins using GIT and Bitbucket, I get the following error

FATAL: Null value not allowed as an environment variable: GIT_URL_2
java.lang.IllegalArgumentException: Null value not allowed as an environment variable: GIT_URL_2
at hudson.EnvVars.put(EnvVars.java:356)
at hudson.EnvVars.put(EnvVars.java:74)
at hudson.plugins.git.GitSCM.buildEnvVars(GitSCM.java:1265)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:927)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1075)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

Problem requires that a repository is added to the Freestyle job definition which has *no repository URL*.  If the repository URL is non-empty, the problem does not occur.

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 20, 2020, 4:42:03 PM1/20/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 22, 2020, 3:31:03 PM1/22/20
to jenkinsc...@googlegroups.com
Mark Waite started work on Bug JENKINS-38608
 
Change By: Mark Waite
Status: Open In Progress

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 22, 2020, 3:31:04 PM1/22/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 22, 2020, 4:00:07 PM1/22/20
to jenkinsc...@googlegroups.com
 

Will be fixed in first release after git plugin 4.1.1

Change By: Mark Waite
Status: In Review Resolved
Resolution: Fixed

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 22, 2020, 4:00:07 PM1/22/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 2, 2020, 2:03:05 PM3/2/20
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Fixed
Change By: Mark Waite
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 2, 2020, 2:03:05 PM3/2/20
to jenkinsc...@googlegroups.com
 

Released in git plugin 4.2.0 March 1, 2020

Change By: Mark Waite
Status: Fixed but Unreleased Resolved
Reply all
Reply to author
Forward
0 new messages