# env.BUILD\_URL is null

**URL:** <https://community.jenkins.io/t/env-build-url-is-null/4805>\
**Category:** Using Jenkins\
**Created:** [December 1, 2022, 10:54pm UTC](https://community.jenkins.io/t/env-build-url-is-null/4805 "2022-12-01T22:54:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinfang](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/vinfang/32/2855_2.png) [@vinfang](https://community.jenkins.io/u/vinfang)\
**Post date:** [December 1, 2022, 10:54pm UTC](https://community.jenkins.io/t/env-build-url-is-null/4805/1 "2022-12-01T22:54:35Z")

</div>

The Jenkins version we are using is 2.361.4. It is running in a Kubernetes cluster version 1.23, and is installed via Helm. The Kubernetes plugin we are running right now is 3734.v562b\_b\_a\_627ea\_c

The issue is we have a slack setup where anytime a build job succeeded or failed, a message would be displayed along with using env.BUILD\_URL, which use to output something like

```auto
https://my-jenkins.com/job/prod/thisjob/11/ succeeded

```

However, now the message looks like

`null succeeded`

and this seems to have occurred after installing the pipeline utility steps plugin, which in turn updated some other plugins, but I don’t have a list of what updates occurred and I don’t quite believe installing that plugin would cause this issue but mentioning it for completeness.

I’ve examined the JENKINS\_URL setting in the Configure System section and it’s still the same registered domain as before.

Printing out all environment variables in the job, I’m noticing some lines like

```auto
JOB_DISPLAY_URL=http://unconfigured-jenkins-location/job/test/job/test-pipeline-vince/display/redirect
JENKINS_URL=http://jenkins.jenkins.svc.cluster.local:443/
BUILD_NUMBER=95
JOB_NAME=test/test-pipeline

```

I’ve looked at the Kubernetes Plugin documentation and any stackoverflow posts, but can’t seem to find the right question that explains this problem.

Has anyone encountered this issue or know what to look for on why env.BUILD\_URL would suddenly be null?

---

<div class="post-metadata">

**Author:** ![vinfang](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/vinfang/32/2855_2.png) [@vinfang](https://community.jenkins.io/u/vinfang)\
**Post date:** [December 2, 2022, 1:14am UTC](https://community.jenkins.io/t/env-build-url-is-null/4805/2 "2022-12-02T01:14:14Z")

</div>

SOLVED:

I found this github post and basically just going into the Configure System and choosing Save even without changing anything fixed the issue.

```auto
https://github.com/opendevstack/ods-jenkins-shared-library/issues/40

```

The environment URL JENKINS\_URL shows the correct domain as before and the BUILD\_URL shows up properly now.

The cause is unknown, maybe something during the update of plugins, but this fix did it.

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [December 5, 2022, 10:28am UTC](https://community.jenkins.io/t/env-build-url-is-null/4805/3 "2022-12-05T10:28:42Z")

</div>

Thanks a lot for your feedback @vinfang 👍

---

<div class="post-metadata">

**Author:** ![vinfang](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/vinfang/32/2855_2.png) [@vinfang](https://community.jenkins.io/u/vinfang)\
**Post date:** [September 18, 2023, 5:17pm UTC](https://community.jenkins.io/t/env-build-url-is-null/4805/4 "2023-09-18T17:17:17Z")

</div>

Just a follow up on this, we’re on Jenkins 2.401.1 on Kubernetes 1.24, Kubernetes plugin Version 4029.v5712230ccb\_f8, and we occasionally see this happen even when the plugins haven’t been updated recently.

Same fix still works, but was hoping if someone could provide insight or point to where in the Jenkins logs I could get more info on why this happens randomly. There doesn’t seem to be any pattern on why this happens and it’s rare, maybe like 1 once in 2 or 3 months the build URL becomes NULL even though the system configuration settings have not changed at all.
