Jenkins can't save new project or can't update configuration of existing ones

985 Views Asked by At

I'm using Jenkins 2.286 version on Windows 10. I need to use the bitbucket hooks to trigger build when any pr merge made on the repository.

I've installed necessary plugins to communicate with bitbucket through jenkins.

When I try without "Build with BitBucket Push and Pull Request Plugin" section, the submit operation succeeds.

But if I click the checkbox of "Build with BitBucket Push and Pull Request Plugin" as i required and set "Build with BitBucket Push and Pull Request Plugin" triggers as documented, I can't submit the configuration form. The error message is

JSONObject["io-jenkins-plugins-bitbucketpushandpullrequest-BitBucketPPRTrigger"] is not a JSONObject.

All plugins are up-to-date with their latest versions.

I would be grateful if anyone could help with this issue.

Here is Auto-generated post data when clicked save/apply button at configuration page;

{
   "description":"Continuous integration for My.Simple.Project solution.",
   "properties":{
      "stapler-class-bag":"true",
      "hudson-model-ParametersDefinitionProperty":{
         "specified":false
      },
      "jenkins-model-BuildDiscarderProperty":{
         "specified":true,
         "":"0",
         "strategy":{
            "daysToKeepStr":"",
            "numToKeepStr":"100",
            "artifactDaysToKeepStr":"",
            "artifactNumToKeepStr":"",
            "stapler-class":"hudson.tasks.LogRotator",
            "$class":"hudson.tasks.LogRotator"
         }
      },
      "com-coravy-hudson-plugins-github-GithubProjectProperty":{
         
      },
      "jenkins-branch-RateLimitBranchProperty$JobPropertyImpl":{
         
      }
   },
   "disable":false,
   "concurrentBuild":false,
   "hasCustomQuietPeriod":false,
   "quiet_period":"5",
   "hasCustomScmCheckoutRetryCount":false,
   "scmCheckoutRetryCount":"0",
   "blockBuildWhenUpstreamBuilding":false,
   "blockBuildWhenDownstreamBuilding":false,
   "hasCustomWorkspace":false,
   "customWorkspace":"",
   "displayNameOrNull":"",
   "scm":{
      "value":"3",
      "stapler-class":"hudson.plugins.git.GitSCM",
      "$class":"hudson.plugins.git.GitSCM",
      "userRemoteConfigs":{
         "url":"https://bitbucket.org/sonerpyci/My.Simple.Project.git",
         "includeUser":"false",
         "credentialsId":"103814c9-b808-4a00-8d4f-4388f05b6774",
         "name":"",
         "refspec":""
      },
      "branches":{
         "name":"development"
      },
      "":"auto"
   },
   "hudson-plugins-tfs-TeamPRPushTrigger":false,
   "jobContext":"Jenkins PR build",
   "targetBranches":"*/master",
   "io-jenkins-plugins-bitbucketpushandpullrequest-BitBucketPPRTrigger":true,
   "triggers":{
      "":"5",
      "actionFilter":{
         "allowedBranches":"development",
         "isToApprove":false,
         "stapler-class":"io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter",
         "$class":"io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter"
      },
      "stapler-class":"io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestTriggerFilter",
      "$class":"io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestTriggerFilter"
   },
   "com-cloudbees-jenkins-GitHubPushTrigger":false,
   "hudson-triggers-SCMTrigger":false,
   "scmpoll_spec":"",
   "ignorePostCommitHooks":false,
   "hudson-plugins-ws_cleanup-PreBuildCleanup":false,
   "deleteDirs":false,
   "cleanupParameter":"",
   "externalDelete":"",
   "disableDeferredWipeout":false,
   "org-jenkinsci-plugins-credentialsbinding-impl-SecretBuildWrapper":false,
   "hudson-tasks-AntWrapper":false,
   "builder":[
      {
         "command":"\"C:\\Program Files\\dotnet\\dotnet\" restore --configfile \"%WORKSPACE%\\nuget.config\"",
         "unstableReturn":"",
         "stapler-class":"hudson.tasks.BatchFile",
         "$class":"hudson.tasks.BatchFile"
      },
      {
         "command":"\"C:\\Program Files\\dotnet\\dotnet\" build -c Release My.Simple.Project.sln\n",
         "unstableReturn":"",
         "stapler-class":"hudson.tasks.BatchFile",
         "$class":"hudson.tasks.BatchFile"
      },
      {
         "command":"REM Running unit tests...\n\nREM \"C:\\Program Files\\dotnet\\dotnet\" test -c Release My.Simple.Project.Engine.Tests\\My.Simple.Project.Engine.Tests.csproj && \"C:\\Program Files\\dotnet\\dotnet\" test -c Release My.Simple.Project.Public.Tests\\My.Simple.Project.Public.Tests.csproj && \"C:\\Program Files\\dotnet\\dotnet\" test -c Release My.Simple.Project.Services.Tests\\My.Simple.Project.Services.Tests.csproj",
         "unstableReturn":"",
         "stapler-class":"hudson.tasks.BatchFile",
         "$class":"hudson.tasks.BatchFile"
      },
      {
         "command":"\"C:\\Program Files\\dotnet\\dotnet\" publish -c Release My.Simple.Project.Web\\My.Simple.Project.Web.csproj",
         "unstableReturn":"",
         "stapler-class":"hudson.tasks.BatchFile",
         "$class":"hudson.tasks.BatchFile"
      },
      {
         "command":"SET APP_NAME=MySimpleProject\nSET PROJECT_NAME=My.Simple.Project.Web\nSET SERVER=top_secret_IP\nSET USERNAME=top_secret_username\nSET PASSWORD=top_secret_password\nSET ASPNETCORE_ENVIRONMENT=development\n\n\"C:\\Python27\\python.exe\" \"%WORKSPACE%\\%PROJECT_NAME%\\deploy2iis.py\" --source-root=\"%WORKSPACE%\\%PROJECT_NAME%\" --source-publish=\"bin\\Release\\netcoreapp2.1\\publish\" --app-name=%APP_NAME% --server=%SERVER% --username=%USERNAME% --password=%PASSWORD% --environment=%ASPNETCORE_ENVIRONMENT%",
         "unstableReturn":"",
         "stapler-class":"hudson.tasks.BatchFile",
         "$class":"hudson.tasks.BatchFile"
      },
      {
         "command":"REM Running smoke tests...\n\n\"C:\\Program Files\\dotnet\\dotnet\" test -c Release My.Simple.Project.Web.SmokeTests\\My.Simple.Project.Web.SmokeTests.csproj",
         "unstableReturn":"",
         "stapler-class":"hudson.tasks.BatchFile",
         "$class":"hudson.tasks.BatchFile"
      }
   ],
   "publisher":{
      "startNotification":false,
      "notifySuccess":true,
      "notifyAborted":false,
      "notifyNotBuilt":false,
      "notifyUnstable":false,
      "notifyRegression":false,
      "notifyEveryFailure":false,
      "notifyBackToNormal":true,
      "notifyFailure":true,
      "notifyRepeatedFailure":true,
      "includeTestSummary":false,
      "includeFailedTests":false,
      "includeCustomMessage":false,
      "customMessage":"",
      "customMessageSuccess":"",
      "customMessageAborted":"",
      "customMessageNotBuilt":"",
      "customMessageUnstable":"",
      "customMessageFailure":"",
      "commitInfoChoice":"AUTHORS_AND_TITLES",
      "uploadFiles":false,
      "artifactIncludes":"",
      "teamDomain":"",
      "baseUrl":"",
      "includeUser":"false",
      "tokenCredentialId":"",
      "authToken":"",
      "botUser":false,
      "iconEmoji":"",
      "username":"",
      "room":"#build",
      "stapler-class":"jenkins.plugins.slack.SlackNotifier",
      "$class":"jenkins.plugins.slack.SlackNotifier"
   },
   "core:apply":"true",
   "Jenkins-Crumb":"f6ef199fb949a3cc69b1c7a4044cecfef28a553599167163909a77f304bde0a5"
}

Here is the full error log;

net.sf.json.JSONException: JSONObject["io-jenkins-plugins-bitbucketpushandpullrequest-BitBucketPPRTrigger"] is not a JSONObject.
    at net.sf.json.JSONObject.getJSONObject(JSONObject.java:2006)
    at hudson.model.AbstractProject.buildDescribable(AbstractProject.java:1822)
    at hudson.model.AbstractProject.submit(AbstractProject.java:1800)
    at hudson.model.Project.submit(Project.java:225)
    at hudson.model.Job.doConfigSubmit(Job.java:1335)
    at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:771)
    at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)
    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)
    at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:536)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
    at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:281)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:694)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:791)
    at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
    at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:129)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
    at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
    at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
    at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:60)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:153)
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:92)
    at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:101)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:92)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:218)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:62)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:97)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:109)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:168)
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:51)
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
    at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36)
    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    at org.eclipse.jetty.server.Server.handle(Server.java:516)
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:279)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
    at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036)
    at java.lang.Thread.run(Unknown Source)

And Finally Here is my configuration screenshots;

Configuration_Step

If I Click Apply or Save button, I get the result below. Error_Short

0

There are 0 best solutions below