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

SiteMonitor jobs fail if not re-saved after latest update

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • sitemonitor-plugin
    • None
    • Jenkins LTS 2.164.2 on Linux

      After installing the most recent SiteMonitor plugin, all of our jobs that use SiteMonitor began failing with a null pointer exception. I didn't see any meaningful output in jenkins.log. Here's all I see in the console output for a job build:

      java.lang.NullPointerException - null
      URL: http://google.com, response code: null, status: EXCEPTION

      I assume this is because any existing jobs do not have the setting for the new cert-related checkbox, and under the hood the code doesn't handle this condition.

      Consequently, all jobs using SiteMonitor must be resaved. This isn't ideal if you have a lot of SiteMonitor jobs across a lot of servers.

      Any chance you could add a null check in the code and release a new version? Or, if you're willing to accept a n00b contribution, I'm happy to take a crack at it myself.

      Thanks! We've been using the SiteMonitor plugin for years and it's served extremely well. I really appreciate all the (free) work you put in to maintaining a plugin.

          [JENKINS-57736] SiteMonitor jobs fail if not re-saved after latest update

          We also upgrade this plugging from ver. 05 -> 0.6 and start to get

          java.lang.NullPointerException - nullURL: http://x.x.x.x, response code: null, status: EXCEPTION
          

          from all our jobs using this plugging.

          Our Jenkins version is 2.121.3

          Tapio Reijonen added a comment - We also upgrade this plugging from ver. 05 -> 0.6 and start to get java.lang.NullPointerException - nullURL: http: //x.x.x.x, response code: null , status: EXCEPTION from all our jobs using this plugging. Our Jenkins version is 2.121.3

          Any update.

          Tapio Reijonen added a comment - Any update.

          Any update?

          Tapio Reijonen added a comment - Any update?

          I migrated old config.xml files to a new system and got the same error.

          I compared this config to a working job and found the <admitInsecureSslCerts> xml tag missing. Must be a newer feature.

          Make sure your job config.xml looks like this for all monitor entries. Alternatively, you might be able to toggle the ssl boolean and save the job config, but I did not try that.

              <hudson.plugins.sitemonitor.SiteMonitorRecorder plugin="sitemonitor@0.6">
                <mSites>
                  <hudson.plugins.sitemonitor.model.Site>
                    <mUrl>https://your.url.net</mUrl>
                    <timeout>600</timeout>
                    <successResponseCodes/>
                    <admitInsecureSslCerts>false</admitInsecureSslCerts>
                  </hudson.plugins.sitemonitor.model.Site>
                  <hudson.plugins.sitemonitor.model.Site>
                    <mUrl>https://another.url.net</mUrl>
                    <timeout>100</timeout>
                    <successResponseCodes/>
                    <admitInsecureSslCerts>false</admitInsecureSslCerts>
                  </hudson.plugins.sitemonitor.model.Site>
                </mSites>
              </hudson.plugins.sitemonitor.SiteMonitorRecorder>
           

          David Uselmann added a comment - I migrated old config.xml files to a new system and got the same error. I compared this config to a working job and found the <admitInsecureSslCerts> xml tag missing. Must be a newer feature. Make sure your job config.xml looks like this for all monitor entries. Alternatively, you might be able to toggle the ssl boolean and save the job config, but I did not try that. <hudson.plugins.sitemonitor.SiteMonitorRecorder plugin="sitemonitor@0.6"> <mSites> <hudson.plugins.sitemonitor.model.Site> <mUrl>https://your.url.net</mUrl> <timeout>600</timeout> <successResponseCodes/> <admitInsecureSslCerts>false</admitInsecureSslCerts> </hudson.plugins.sitemonitor.model.Site> <hudson.plugins.sitemonitor.model.Site> <mUrl>https://another.url.net</mUrl> <timeout>100</timeout> <successResponseCodes/> <admitInsecureSslCerts>false</admitInsecureSslCerts> </hudson.plugins.sitemonitor.model.Site> </mSites> </hudson.plugins.sitemonitor.SiteMonitorRecorder>

            onuba Francisco Hernandez Suarez
            marcesher Marc Esher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: