Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68705

How to avoid "Error: HOME is not set" when starting Jenkins server

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • gradle-plugin
    • None
    • gradle-plugin from v1.39 (PR#150), Jenkins v2.332.3
    • v1.39.2

      The following warning is raised several times on each restart of the Jenkins server since the update of the gradle-plugin in v1.39 :

      WARNING h.p.g.i.GradleBuildScanInjection#inject: Error: HOME is not set

      On my Jenkins server, I don't need Gradle, but this gradle-plugin is required by Artifactory plugin.

      I tried to set the HOME environment variable, then the JENKINSGRADLEPLUGIN_BUILD_SCAN_OVERRIDE_HOME environment variable, but the warning is still reported in the system logs when the Jenkins server starts.

      Is there a solution to fix this warning?

      Thanks in advance

          [JENKINS-68705] How to avoid "Error: HOME is not set" when starting Jenkins server

          Dietmar Scheidl added a comment - - edited

          We are using kubernetes-plugin and this spams the log as soon as we try to start any pod.

          Jun 14, 2022 7:28:55 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject
          Error: HOME is not set
          Jun 14, 2022 7:28:55 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject
          Error: HOME is not set
          Jun 14, 2022 7:28:55 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject
          Error: HOME is not set
          Jun 14, 2022 7:28:55 AM INFO hudson.slaves.NodeProvisioner update
          test-pod-template-12-hjcc3-5crw0-bjzwk provisioning successfully completed. We have now 4 computer(s)
          Jun 14, 2022 7:28:55 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch
          Created Pod: kubernetes default/test-pod-template-12-hjcc3-5crw0-bjzwk
          Jun 14, 2022 7:28:58 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch
          Pod is running: kubernetes default/test-pod-template-12-hjcc3-5crw0-bjzwk
          Jun 14, 2022 7:28:58 AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler run
          Accepted JNLP4-connect connection #3 from *.*.*.*/*.*.*.*:*
          Jun 14, 2022 7:29:04 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
          Terminating Kubernetes instance for agent test-pod-template-12-hjcc3-5crw0-bjzwk
          Jun 14, 2022 7:29:04 AM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish
          test-pod-template #12 completed: FAILURE
          Jun 14, 2022 7:29:04 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave deleteSlavePod
          Terminated Kubernetes instance for agent default/test-pod-template-12-hjcc3-5crw0-bjzwk
          Jun 14, 2022 7:29:04 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
          Disconnected computer test-pod-template-12-hjcc3-5crw0-bjzwk
          Jun 14, 2022 7:29:04 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject
          Error: HOME is not set
          Jun 14, 2022 7:29:04 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject
          Error: HOME is not set
          Jun 14, 2022 7:29:04 AM INFO jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed
          Computer.threadPoolForRemoting [#21] for test-pod-template-12-hjcc3-5crw0-bjzwk terminated: java.nio.channels.ClosedChannelException
          

          It also seems to have a big performance impact as we had to downgrade to 1.38 otherwise pods did not start up in time anymore. There is no way of preventing copying/removing of the init script. Environment variables are read from offline nodes. What also comes into my mind is how this behaves on nodes with more than one executor (yes we also have that) and having one config enabling init script and the other one disabling it.

          Sporadically I also see:

          Jun 14, 2022 7:44:57 AM WARNING jenkins.util.Listeners lambda$notify$0
          null
          java.lang.NullPointerException
          	at hudson.plugins.gradle.injection.GradleBuildScanInjection.inject(GradleBuildScanInjection.java:37)
          	at hudson.plugins.gradle.injection.BuildScanInjectionListener.lambda$inject$0(BuildScanInjectionListener.java:57)
          	at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4390)
          	at hudson.plugins.gradle.injection.BuildScanInjectionListener.inject(BuildScanInjectionListener.java:57)
          	at hudson.plugins.gradle.injection.BuildScanInjectionListener.onConfigurationChange(BuildScanInjectionListener.java:49)
          	at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59)
          	at jenkins.util.Listeners.notify(Listeners.java:70)
          	at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:277)
          	at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1670)
          	at jenkins.model.Nodes$5.run(Nodes.java:279)
          	at hudson.model.Queue._withLock(Queue.java:1395)
          	at hudson.model.Queue.withLock(Queue.java:1269)
          	at jenkins.model.Nodes.removeNode(Nodes.java:270)
          	at jenkins.model.Jenkins.removeNode(Jenkins.java:2215)
          	at hudson.slaves.AbstractCloudSlave.terminate(AbstractCloudSlave.java:91)
          	at org.jenkinsci.plugins.durabletask.executors.OnceRetentionStrategy$1$1.run(OnceRetentionStrategy.java:128)
          	at hudson.model.Queue._withLock(Queue.java:1395)
          	at hudson.model.Queue.withLock(Queue.java:1269)
          	at org.jenkinsci.plugins.durabletask.executors.OnceRetentionStrategy$1.run(OnceRetentionStrategy.java:123)
          	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
          	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          	at java.base/java.lang.Thread.run(Thread.java:829)
          

          Currently there is no opt-out of this handling in any form, we do not use the gradle-plugin but we use gradle. We use artifactory-plugin and we do not want the init script handling at all as modification to HOME would affect many builds on the same nodes.

          Dietmar Scheidl added a comment - - edited We are using kubernetes-plugin and this spams the log as soon as we try to start any pod. Jun 14, 2022 7:28:55 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject Error: HOME is not set Jun 14, 2022 7:28:55 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject Error: HOME is not set Jun 14, 2022 7:28:55 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject Error: HOME is not set Jun 14, 2022 7:28:55 AM INFO hudson.slaves.NodeProvisioner update test-pod-template-12-hjcc3-5crw0-bjzwk provisioning successfully completed. We have now 4 computer(s) Jun 14, 2022 7:28:55 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch Created Pod: kubernetes default/test-pod-template-12-hjcc3-5crw0-bjzwk Jun 14, 2022 7:28:58 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch Pod is running: kubernetes default/test-pod-template-12-hjcc3-5crw0-bjzwk Jun 14, 2022 7:28:58 AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted JNLP4-connect connection #3 from *.*.*.*/*.*.*.*:* Jun 14, 2022 7:29:04 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate Terminating Kubernetes instance for agent test-pod-template-12-hjcc3-5crw0-bjzwk Jun 14, 2022 7:29:04 AM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish test-pod-template #12 completed: FAILURE Jun 14, 2022 7:29:04 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave deleteSlavePod Terminated Kubernetes instance for agent default/test-pod-template-12-hjcc3-5crw0-bjzwk Jun 14, 2022 7:29:04 AM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate Disconnected computer test-pod-template-12-hjcc3-5crw0-bjzwk Jun 14, 2022 7:29:04 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject Error: HOME is not set Jun 14, 2022 7:29:04 AM WARNING hudson.plugins.gradle.injection.GradleBuildScanInjection inject Error: HOME is not set Jun 14, 2022 7:29:04 AM INFO jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed Computer.threadPoolForRemoting [#21] for test-pod-template-12-hjcc3-5crw0-bjzwk terminated: java.nio.channels.ClosedChannelException It also seems to have a big performance impact as we had to downgrade to 1.38 otherwise pods did not start up in time anymore. There is no way of preventing copying/removing of the init script. Environment variables are read from offline nodes. What also comes into my mind is how this behaves on nodes with more than one executor (yes we also have that) and having one config enabling init script and the other one disabling it. Sporadically I also see: Jun 14, 2022 7:44:57 AM WARNING jenkins.util.Listeners lambda$notify$0 null java.lang.NullPointerException at hudson.plugins.gradle.injection.GradleBuildScanInjection.inject(GradleBuildScanInjection.java:37) at hudson.plugins.gradle.injection.BuildScanInjectionListener.lambda$inject$0(BuildScanInjectionListener.java:57) at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4390) at hudson.plugins.gradle.injection.BuildScanInjectionListener.inject(BuildScanInjectionListener.java:57) at hudson.plugins.gradle.injection.BuildScanInjectionListener.onConfigurationChange(BuildScanInjectionListener.java:49) at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59) at jenkins.util.Listeners.notify(Listeners.java:70) at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:277) at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1670) at jenkins.model.Nodes$5.run(Nodes.java:279) at hudson.model.Queue._withLock(Queue.java:1395) at hudson.model.Queue.withLock(Queue.java:1269) at jenkins.model.Nodes.removeNode(Nodes.java:270) at jenkins.model.Jenkins.removeNode(Jenkins.java:2215) at hudson.slaves.AbstractCloudSlave.terminate(AbstractCloudSlave.java:91) at org.jenkinsci.plugins.durabletask.executors.OnceRetentionStrategy$1$1.run(OnceRetentionStrategy.java:128) at hudson.model.Queue._withLock(Queue.java:1395) at hudson.model.Queue.withLock(Queue.java:1269) at org.jenkinsci.plugins.durabletask.executors.OnceRetentionStrategy$1.run(OnceRetentionStrategy.java:123) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Currently there is no opt-out of this handling in any form, we do not use the gradle-plugin but we use gradle. We use artifactory-plugin and we do not want the init script handling at all as modification to HOME would affect many builds on the same nodes.

          Eric RAIMBAULT added a comment - https://github.com/jenkinsci/gradle-plugin/pull/157  

          Stefan Wolf added a comment -

          scddev : Does the plugin 1.39.3 fix the performance issues or are those still present? The logging should be gone for sure.

          Stefan Wolf added a comment - scddev : Does the plugin 1.39.3 fix the performance issues or are those still present? The logging should be gone for sure.

          Jerome Prinet added a comment -

          1.39.4 was just released

          The new behavior is to not execute any injection related action if there was no explicit feature opt-in.

          Could you confirm scddev that it solves your performance issues?

           

           

           

          Jerome Prinet added a comment - 1.39.4 was just released The new behavior is to not execute any injection related action if there was no explicit feature opt-in. Could you confirm scddev that it solves your performance issues?      

          We can try with next maintenance window, but I can not test in the near future.

          Dietmar Scheidl added a comment - We can try with next maintenance window, but I can not test in the near future.

          Jerome Prinet added a comment -

          Great, just let us know 👍

          Jerome Prinet added a comment - Great, just let us know 👍

            wolfs Stefan Wolf
            eraimbau Eric RAIMBAULT
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: