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

Jenkins doesn't exit the save configuration page after upgrade to 2.277.2 with Datadog plugin installed

      Hello,

      We are having issues with saving the system configuration after upgrading to 2.277.2 from 2.263.3. Once we click on saving the configuration, Jenkins doesn't return to the HOME page unlike it's usual behavior.

      As per the upgrade guide, we have updated the plugins after the upgrade but still the issue persists. Although, when I click on apply the config is getting saved but not when I click on save button. It neither throws an exception.

      FYI, attached the list of plugins that are installed in our Jenkins.

      Please do the needful and help us getting this resolved.

       

          [JENKINS-65494] Jenkins doesn't exit the save configuration page after upgrade to 2.277.2 with Datadog plugin installed

          Datadog HQ added a comment -

          Hello all, apologies for the delay here. First as a headsup please note that the official Datadog plugin for Jenkins is "Datadog plugin" and not the "Datadog Metrics plugin" which we have no control on.

          I'm only partly able to reproduce the issue though. I started a jenkins instance running `2.277.2` and your exact list of plugins (excluding jenkins-jira-plugin that cannot be found).

          When the configuration is saved, the Datadog plugin will check its configuration to see if it's able to submit metrics to Datadog with the API key etc. If the configuration is invalid, it refuses to save it and we see the scenario you mention when the configuration isn't saved and jenkins does not come back to the Home page. I can only reproduce what you experience by having an invalid Datadog configuration.

           

          I assume your Datadog config is valid (since it was working before) so I believe what you're experiencing is unrelated and might be caused by another plugin. I believe that in markewaite test case he had an invalid Datadog configuration, that's why the config refused to save.

          Side note, we'll try to improve that experience and make sure we show an exception or something easily identifiable in that case.

           

          Thanks,

          Florian

           

          Datadog HQ added a comment - Hello all, apologies for the delay here. First as a headsup please note that the official Datadog plugin for Jenkins is "Datadog plugin" and not the "Datadog Metrics plugin" which we have no control on. I'm only partly able to reproduce the issue though. I started a jenkins instance running `2.277.2` and your exact list of plugins (excluding jenkins-jira-plugin that cannot be found). When the configuration is saved, the Datadog plugin will check its configuration to see if it's able to submit metrics to Datadog with the API key etc. If the configuration is invalid, it refuses to save it and we see the scenario you mention when the configuration isn't saved and jenkins does not come back to the Home page. I can only reproduce what you experience by having an invalid Datadog configuration.   I assume your Datadog config is valid (since it was working before) so I believe what you're experiencing is unrelated and might be caused by another plugin. I believe that in markewaite  test case he had an invalid Datadog configuration, that's why the config refused to save. Side note, we'll try to improve that experience and make sure we show an exception or something easily identifiable in that case.   Thanks, Florian  

          Luis Ehlen added a comment - - edited

          I'm facing a similar issue with a fresh plugin installation and a valid token configuration. Jenkins 2.277.4 and plugin 2.11

          2021-06-02 00:41:55.153+0000 [id=371]	FINE	hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Datadog Counters Publisher
          2021-06-02 00:41:55.154+0000 [id=371]	FINE	o.d.j.p.d.p.DatadogCountersPublisher#execute: Execute called: Publishing counters
          2021-06-02 00:41:55.154+0000 [id=371]	FINE	hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Datadog Counters Publisher. 1 ms
          2021-06-02 00:41:55.610+0000 [id=10]	SEVERE	o.d.j.p.datadog.DatadogUtilities#severe: Failed to save configuration
          2021-06-02 00:41:55.611+0000 [id=10]	FINER	o.d.j.p.datadog.DatadogUtilities#severe: Failed to save configuration: net.sf.json.JSONException: JSONObject["reportWith"] not found.
          	at net.sf.json.JSONObject.getString(JSONObject.java:2040)
          	at org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration.configure(DatadogGlobalConfiguration.java:431)
          	at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:3859)
          	at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:3823)
          	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
          	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
          	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
          	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
          	at org.kohsuke.stapler.SelectionInterceptedFunction$Adapter.invoke(SelectionInterceptedFunction.java:36)
          	at org.kohsuke.stapler.verb.HttpVerbInterceptor.invoke(HttpVerbInterceptor.java:48)
          	at org.kohsuke.stapler.SelectionInterceptedFunction.bindAndInvoke(SelectionInterceptedFunction.java:26)
          	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)

           

          Luis Ehlen added a comment - - edited I'm facing a similar issue with a fresh plugin installation and a valid token configuration. Jenkins 2.277.4 and plugin 2.11 2021-06-02 00:41:55.153+0000 [id=371] FINE hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Datadog Counters Publisher 2021-06-02 00:41:55.154+0000 [id=371] FINE o.d.j.p.d.p.DatadogCountersPublisher#execute: Execute called: Publishing counters 2021-06-02 00:41:55.154+0000 [id=371] FINE hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Datadog Counters Publisher. 1 ms 2021-06-02 00:41:55.610+0000 [id=10] SEVERE o.d.j.p.datadog.DatadogUtilities#severe: Failed to save configuration 2021-06-02 00:41:55.611+0000 [id=10] FINER o.d.j.p.datadog.DatadogUtilities#severe: Failed to save configuration: net.sf.json.JSONException: JSONObject["reportWith"] not found. at net.sf.json.JSONObject.getString(JSONObject.java:2040) at org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration.configure(DatadogGlobalConfiguration.java:431) at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:3859) at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:3823) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212) at org.kohsuke.stapler.SelectionInterceptedFunction$Adapter.invoke(SelectionInterceptedFunction.java:36) at org.kohsuke.stapler.verb.HttpVerbInterceptor.invoke(HttpVerbInterceptor.java:48) at org.kohsuke.stapler.SelectionInterceptedFunction.bindAndInvoke(SelectionInterceptedFunction.java:26) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)  

          Datadog HQ added a comment - - edited

          Interesting, I've never seen something like that yet. What the log mean here is that the plugin can't save the configuration because neither of the two radio button is selected. The plugin works by sending data either to the Datadog API directly or via a Datadog agent with Dogstatsd.

          Is the image from you? It looks to be a copy from the one of the original message.

          The only way I can reproduce is by manually unselecting the two radio buttons by modifying the html code.

          Datadog HQ added a comment - - edited Interesting, I've never seen something like that yet. What the log mean here is that the plugin can't save the configuration because neither of the two radio button is selected. The plugin works by sending data either to the Datadog API directly or via a Datadog agent with Dogstatsd. Is the image from you? It looks to be a copy from the one of the original message. The only way I can reproduce is by manually unselecting the two radio buttons by modifying the html code.

          Luis Ehlen added a comment -

          Radio was selected, as you can see from the screenshot. Are you testing in Jenkins 2.277?  They did serious changes to the HTML forms.

          I tested with both options of the radio button with the same results.

          Luis Ehlen added a comment - Radio was selected, as you can see from the screenshot. Are you testing in Jenkins 2.277?  They did serious changes to the HTML forms. I tested with both options of the radio button with the same results.

          Datadog HQ added a comment - - edited

          I've tested with both 2.277.4 and 2.289.1, both fresh installs. I've installed no plugins to start with, then simply installed the latest version of the Datadog Plugin.

          I can't reproduce, I've looked at Chrome network requests and I can see one called `configSubmit` when I press the `Save` button:

           

           

          Looking at the content of this `configSubmit` request I see the payload sent by the Jenkins UI which contains the following data:

           

           

          "org-datadog-jenkins-plugins-datadog-DatadogGlobalConfiguration": {
              "targetHost": "localhost",
              "targetPort": "8125",
              "targetLogCollectionPort": "",
              "reportWith": "HTTP",
              "targetApiURL": "https://api.datadoghq.com/api/",
              "targetLogIntakeURL": "https://http-intake.logs.datadoghq.com/v1/input/",
              "targetApiKey": "[redacted]",
              "$redact": "targetApiKey",
              "hostname": "",
              "blacklist": "",
              "whitelist": "",
              "globalTagFile": "",
              "globalTags": "",
              "globalJobTags": "",
              "emitSecurityEvents": true,
              "emitSystemEvents": true,
              "emitConfigChangeEvents": false,
              "collectBuildLogs": false
            },
          

           

          As you can see, this payload contains the `reportWith` key and the save works just as expected. I'd be curious to see what you have in this payload.

          Datadog HQ added a comment - - edited I've tested with both 2.277.4 and 2.289.1, both fresh installs. I've installed no plugins to start with, then simply installed the latest version of the Datadog Plugin. I can't reproduce, I've looked at Chrome network requests and I can see one called `configSubmit` when I press the `Save` button:     Looking at the content of this `configSubmit` request I see the payload sent by the Jenkins UI which contains the following data:     "org-datadog-jenkins-plugins-datadog-DatadogGlobalConfiguration" : { "targetHost" : "localhost" , "targetPort" : "8125" , "targetLogCollectionPort" : "", "reportWith" : "HTTP" , "targetApiURL" : "https: //api.datadoghq.com/api/" , "targetLogIntakeURL" : "https: //http-intake.logs.datadoghq.com/v1/input/" , "targetApiKey" : "[redacted]" , "$redact" : "targetApiKey" , "hostname" : "", "blacklist" : "", "whitelist" : "", "globalTagFile" : "", "globalTags" : "", "globalJobTags" : "", "emitSecurityEvents" : true , "emitSystemEvents" : true , "emitConfigChangeEvents" : false , "collectBuildLogs" : false },   As you can see, this payload contains the `reportWith` key and the save works just as expected. I'd be curious to see what you have in this payload.

          Luis Ehlen added a comment -

          I can't tell why, but all the plugins using radio buttons are giving me problems.

          Luis Ehlen added a comment - I can't tell why, but all the plugins using radio buttons are giving me problems.

          Luis Ehlen added a comment - - edited

          After upgrading Jenkins core to the latest LTS 2.289.1 the problem has gone away for me.

          This is true for any other plugins I had using radio buttons on the Jenkins main configuration page.

          Thanks.

          Luis Ehlen added a comment - - edited After upgrading Jenkins core to the latest LTS 2.289.1 the problem has gone away for me. This is true for any other plugins I had using radio buttons on the Jenkins main configuration page. Thanks.

          Datadog HQ added a comment -

          Ok then, wrapping all of this up a bit.

          lehlen issue ended up being unrelated to the Datadog plugin

          markewaite's investigation made him think the issue was caused by the Datadog plugin but as far as I can tell this was due to a bad config on his side.

           

          From what I can see, the Datadog plugin doesn't seem to relate to the current card issue anymore but please let us know if we can be of any help.

          Datadog HQ added a comment - Ok then, wrapping all of this up a bit. lehlen  issue ended up being unrelated to the Datadog plugin markewaite 's investigation made him think the issue was caused by the Datadog plugin but as far as I can tell this was due to a bad config on his side.   From what I can see, the Datadog plugin doesn't seem to relate to the current card issue anymore but please let us know if we can be of any help.

          Luis Ehlen added a comment -

          I still think that an invalid configuration shouldn't prevent you from saving Jenkins' global configurations. It used to work.

          Luis Ehlen added a comment - I still think that an invalid configuration shouldn't prevent you from saving Jenkins' global configurations. It used to work.

          Julia Simon added a comment -

          Seems the issue is resolved in LTS 2.289.1, furthermore on v3.0.0 tracing configuration has  been exposed on UI which should help prevent configuration issues.

          Julia Simon added a comment - Seems the issue is resolved in LTS 2.289.1, furthermore on v3.0.0 tracing configuration has  been exposed on UI which should help prevent configuration issues.

            datadog Datadog HQ
            neeharikarani Neeharika Rani
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: