Building a job from Github error

FATAL: Git repository URL 2 is an empty string in job definition
Can anybody help me with this error?

Without more context, others can only make wild guesses about what might be wrong. Here are some of my wild guesses:

Assumptions:

  1. You are running a Pipeline job
  2. The Pipeline job attempts a checkout operation
  3. The checkout operation includes a reference to GitSCM
  4. The GitSCM reference somehow is providing an empty string as the second repository URL for checkout
  5. The git plugin reports that it does not know what to do with an empty second repository URL

I’ve seen that message in the past when I made a syntax error in the checkout step. Placing a comma in the wrong location or a set of brackets in the wrong location can cause the message because the Pipeline interprets missing values as empty strings.

The most common reason for that type of syntax error is a failure to use the Pipeline Syntax Generator to assist with Pipeline definition. Here’s the 90 second video that is included in the git plugin documentation.

Another possible reason is that you defined a Freestyle job, added a git repository, left the repository field blank, ignored the warning when saving the job definition, then ran the job. See [JENKINS-38608] Null value not allowed as an environment variable: GIT_URL_2 - Jenkins Jira and the related pull requests for cases where that happens

1 Like