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

Can't save job configuration: JSONObject["hudson-triggers-TimerTrigger"] is not a JSONObject

      After upgrading Jenkins to 2.264 or higher I am unable to save any job configuration that uses a "Build periodically" trigger. If I modify an existing job with such a trigger or create a new job and include such a trigger and try to save, the following exception shows up and the configuration is not saved:

      JSONObject["hudson-triggers-TimerTrigger"] is not a JSONObject.

      Stack trace and Jenkins log for "doConfigSubmit" attached.

      Steps to reproduce:

      • Create New Item -> Freestyle project
      • Select checkbox "Build periodically" in section Build Triggers
      • Enter any schedule, e. g. "@mignight" or "H 1 * * *"
      • Click save -> ERROR

      As far as I know both freestyle project and periodic trigger are part of core Jenkins and not of any plugin, but I am not completely sure about that. If I should provide a list of installed plugins or check for any specific one, please let me know.

      I reproduced this bug with Jenkins 2.264, 2.269 and the latest version 2.274. Downgrading to 2.263 resolves it.

          [JENKINS-64568] Can't save job configuration: JSONObject["hudson-triggers-TimerTrigger"] is not a JSONObject

          Tim Jacomb added a comment -

          Hi please provide a list of plugins, following the instructions in https://www.jenkins.io/doc/developer/views/table-to-div-migration/#some-plugins-are-known-to-be-broken

          JENKINS_HOST=username:password@myhost.com:port
          curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'| sed 's/ /:/' | cut -d ':' -f 1 | sort > plugins.txt
          

          Tim Jacomb added a comment - Hi please provide a list of plugins, following the instructions in https://www.jenkins.io/doc/developer/views/table-to-div-migration/#some-plugins-are-known-to-be-broken JENKINS_HOST=username:password@myhost.com:port curl -sSL "http: //$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath= /*/*/ shortName| /*/*/ version&wrapper=plugins" | perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g' | sed 's/ /:/' | cut -d ':' -f 1 | sort > plugins.txt

          Inga added a comment -

          Hi Tim, I attached the list of installed plugins. I also disabled the plugins in batches and re-enabled them and it looks like github and gitlab-plugin cause my issue.

          In detail:

          • Disabled github, github-branch-source, github-organization-folder and gitlab-plugin -> no error
          • Disabled github, github-branch-source, github-organization but not gitlab-plugin -> error
          • Disabled gitlab-plugin but not github, github-branch-source and github-organization -> error

          I don't think we use github currently, but we do use webhooks from gitlab to Jenkins, which I believe are provided by gitlab-plugin.

          Inga added a comment - Hi Tim, I attached the list of installed plugins. I also disabled the plugins in batches and re-enabled them and it looks like github and gitlab-plugin cause my issue. In detail: Disabled github, github-branch-source, github-organization-folder and gitlab-plugin -> no error Disabled github, github-branch-source, github-organization but not gitlab-plugin -> error Disabled gitlab-plugin but not github, github-branch-source and github-organization -> error I don't think we use github currently, but we do use webhooks from gitlab to Jenkins, which I believe are provided by gitlab-plugin.

          Tim Jacomb added a comment -

          I believe both those plugins are fixed on master but not released, you could try build them from source and upload your custom version?

          Tim Jacomb added a comment - I believe both those plugins are fixed on master but not released, you could try build them from source and upload your custom version?

          Maor added a comment -

          We also have the same issue (can't save 'Build periodically with parameters' configuration) when using Active choice parameter plugin.
          Jobs without a parameters from that type are ok.
           
          When adding an Active choice parameter to the job configuration as try to save, we got this:

          Current jenkins version:  2.274
          All of our plugin been updated to the latest version includes the active choice parameter plugin
           
           

          Maor added a comment - We also have the same issue (can't save 'Build periodically with parameters' configuration) when using Active choice parameter plugin. Jobs without a parameters from that type are ok.   When adding an Active choice parameter to the job configuration as try to save, we got this: Current jenkins version:  2.274 All of our plugin been updated to the latest version includes the active choice parameter plugin    

          Inga added a comment -

          you could try build them from source and upload your custom version?

          I've never build plugins myself before or added plugins to Jenkins without using "Manage plugins". As mentioned, we weren't actively using any functionality provided by github-plugin and luckily pulling from gitlab is still working without the gitlab-plugin and we just have to do without the web hooks.

          By the way, it looks like gitlab-plugin is having problems with getting their releases published to Jenkins. The latest version available in Jenkins is 1.5.13 from September 2019, while https://github.com/jenkinsci/gitlab-plugin/releases is already at 1.5.17. There are some open issues requesting the newer releases and one unresolved 'Release' project. So even if the tables-to-div issue is already resolved in their master branch and if that were to be released, it might not make it to Jenkins anytime soon.

          Inga added a comment - you could try build them from source and upload your custom version? I've never build plugins myself before or added plugins to Jenkins without using "Manage plugins". As mentioned, we weren't actively using any functionality provided by github-plugin and luckily pulling from gitlab is still working without the gitlab-plugin and we just have to do without the web hooks. By the way, it looks like gitlab-plugin is having problems with getting their releases published to Jenkins. The latest version available in Jenkins is 1.5.13 from September 2019, while https://github.com/jenkinsci/gitlab-plugin/releases is already at 1.5.17. There are some open issues requesting the newer releases and one unresolved 'Release' project . So even if the tables-to-div issue is already resolved in their master branch and if that were to be released, it might not make it to Jenkins anytime soon.

          Inga added a comment -

          Hi timja, are you sure you wanted to mark my issue as duplicate of JENKINS-62806 and not JENKINS-64588 - "Can't save job configuration when using Active choices parameter plugin"?

          Inga added a comment - Hi timja , are you sure you wanted to mark my issue as duplicate of JENKINS-62806 and not JENKINS-64588 - "Can't save job configuration when using Active choices parameter plugin"?

            Unassigned Unassigned
            iquatuor Inga
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: