Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-15520

5.7.2 REST regression: /queue at plan concurrency limit

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 5.15.0.1
    • 5.7.2
    • None
    • None

      We just upgraded to 5.7.2. Didn't want to since we were stable, but were forced by your Security Advisory about Struts breakage. Now we're unstable

      In particular, the /queue REST call no longer handles concurrency limits gracefully. Formerly it returned a 3xx code and a nice message, now it throws a stack trace in the logs with status=500. Excerpt from atlassian-bamboo.log:

      2015-02-04 12:24:35,777 INFO [http-bio-8085-exec-37] [AccessLogFilter] 10.140.142.252 GET http://re-bamboo.sv.splunk.com/rest/api/latest/plan/MISC-TST?expand=stages.stage.plans 30969kb
      2015-02-04 12:24:35,868 INFO [http-bio-8085-exec-45] [AccessLogFilter] bamboo POST http://re-bamboo.sv.splunk.com/rest/api/latest/queue/MISC-TST 27375kb
      Feb 04, 2015 12:24:35 PM com.sun.jersey.spi.container.ContainerResponse write
      SEVERE: A message body writer for Java class com.atlassian.plugins.rest.common.Status, and Java type class com.atlassian.plugins.rest.common.Status, and MIME media type application/x-www-form-urlencoded was not found
      2015-02-04 12:24:35,871 ERROR [http-bio-8085-exec-45] [ContainerResponse] A message body writer for Java class com.atlassian.plugins.rest.common.Status, and Java type class com.atlassian.plugins.rest.common.Status, and MIME media type application/x-www-form-urlencoded was not found
      Feb 04, 2015 12:24:35 PM com.sun.jersey.spi.container.ContainerResponse write
      SEVERE: The registered message body writers compatible with the MIME media type are:
      application/x-www-form-urlencoded ->
        com.sun.jersey.core.impl.provider.entity.FormProvider
        com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider
      */* ->
        com.sun.jersey.core.impl.provider.entity.FormProvider
        com.sun.jersey.core.impl.provider.entity.StringProvider
        com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
        com.sun.jersey.core.impl.provider.entity.FileProvider
        com.sun.jersey.core.impl.provider.entity.InputStreamProvider
        com.sun.jersey.core.impl.provider.entity.DataSourceProvider
        com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
        com.sun.jersey.core.impl.provider.entity.ReaderProvider
        com.sun.jersey.core.impl.provider.entity.DocumentProvider
        com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
        com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
        com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
        com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
        com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
        com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
      
      2015-02-04 12:24:35,871 ERROR [http-bio-8085-exec-45] [ContainerResponse] The registered message body writers compatible with the MIME media type are:
      application/x-www-form-urlencoded ->
        com.sun.jersey.core.impl.provider.entity.FormProvider
        com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider
      */* ->
        com.sun.jersey.core.impl.provider.entity.FormProvider
        com.sun.jersey.core.impl.provider.entity.StringProvider
        com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
        com.sun.jersey.core.impl.provider.entity.FileProvider
        com.sun.jersey.core.impl.provider.entity.InputStreamProvider
        com.sun.jersey.core.impl.provider.entity.DataSourceProvider
        com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
        com.sun.jersey.core.impl.provider.entity.ReaderProvider
        com.sun.jersey.core.impl.provider.entity.DocumentProvider
        com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
        com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
        com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
        com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
        com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
        com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
        com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
      
      2015-02-04 12:24:35,873 ERROR [http-bio-8085-exec-45] [FiveOhOh] 500 Exception was thrown.
      

      Please provide a fix ETA ASAP. This whole Struts issue is a mess for us: first we're made vulnerable, then we have to upgrade, now the upgrade introduces more bugs ... aaagh! This new bug is delaying an internal product release and is hard to code around since little is returned to the caller to distinguish this from another 5xx return.

            [BAM-15520] 5.7.2 REST regression: /queue at plan concurrency limit

            Hi eng-release,

            I'm sorry to see you running into this issue. Could you please let me know which version of Bamboo you were using before? That will help to identify when the regression was introduced.

            Thanks,

            Sten Pittet
            Bamboo Product Manager

            Sten Pittet (Inactive) added a comment - Hi eng-release , I'm sorry to see you running into this issue. Could you please let me know which version of Bamboo you were using before? That will help to identify when the regression was introduced. Thanks, Sten Pittet Bamboo Product Manager

            I've reproduced the problem kbrazulewicz

            Przemek Bruski added a comment - I've reproduced the problem kbrazulewicz

            I cannot reproduce the problem on 5.7.2. I created a plan that runs for 30s and poked queue REST endpoint twice:

            $ curl -X POST --user admin:admin -H "Accept: application/json" http://localhost:8085/rest/api/latest/queue/FOO-BAR
            {"planKey":"FOO-BAR","buildNumber":2,"buildResultKey":"FOO-BAR-2","triggerReason":"Manual build","link":{"href":"http://localhost:8085/rest/api/latest/result/FOO-BAR-2","rel":"self"}}
            $ curl -X POST --user admin:admin -H "Accept: application/json" http://localhost:8085/rest/api/latest/queue/FOO-BAR
            {"message":"Build requested but not started, you have reached the maximum number of concurrent builds allowed.","status-code":400}
            

            There were no error in the logs and return code was 400
            Can we see how do you construct your POST call? Can you prepare a curl call that would trigger the problem? What version of Bamboo did you use before upgrading?

            Krystian Brazulewicz added a comment - I cannot reproduce the problem on 5.7.2. I created a plan that runs for 30s and poked queue REST endpoint twice: $ curl -X POST --user admin:admin -H "Accept: application/json" http://localhost:8085/rest/api/latest/queue/FOO-BAR {"planKey":"FOO-BAR","buildNumber":2,"buildResultKey":"FOO-BAR-2","triggerReason":"Manual build","link":{"href":"http://localhost:8085/rest/api/latest/result/FOO-BAR-2","rel":"self"}} $ curl -X POST --user admin:admin -H "Accept: application/json" http://localhost:8085/rest/api/latest/queue/FOO-BAR {"message":"Build requested but not started, you have reached the maximum number of concurrent builds allowed.","status-code":400} There were no error in the logs and return code was 400 Can we see how do you construct your POST call? Can you prepare a curl call that would trigger the problem? What version of Bamboo did you use before upgrading?

            BTW. we are gradually removing handling of application/x-www-form-urlencoded , so it is a good idea to switch anyway.

            Przemek Bruski added a comment - BTW. we are gradually removing handling of application/x-www-form-urlencoded , so it is a good idea to switch anyway.

            What is the source of that request? If it's a script/web page, can you switch to using application/json for passing the parameters?

            Przemek Bruski added a comment - What is the source of that request? If it's a script/web page, can you switch to using application/json for passing the parameters?

              moles Marcin Oles
              d39cea85dcfe Splunk Release Engineering
              Affected customers:
              1 This affects my team
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: