Remove excessive log noise for Bitbucket Jersey form parameter

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: API - REST
    • None
    • 1

      When upgrading to Bitbucket 9.4.x Bitbucket keeps logging a benign error:

      2026-02-13 15:22:54,295 WARN  [http-nio-7990-exec-3] <REDACTED> <REDACTED> "POST /rest/oauth2/latest/token HTTP/1.1" o.g.jersey.servlet.WebComponent A servlet request to the URI <REDACTED> contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
      2026-02-13 15:22:54,295 WARN  [http-nio-7990-exec-3] <REDACTED> <REDACTED> "POST /rest/oauth2/latest/token HTTP/1.1" o.g.jersey.servlet.WebComponent A servlet request to the URI <REDACTED> contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
      2026-02-13 15:22:54,295 WARN  [http-nio-7990-exec-3] <REDACTED> <REDACTED> "POST /rest/oauth2/latest/token HTTP/1.1" o.g.jersey.servlet.WebComponent A servlet request to the URI <REDACTED> contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
      2026-02-13 15:22:54,295 WARN  [http-nio-7990-exec-3] *<REDACTED> <REDACTED> "POST /rest/oauth2/latest/token HTTP/1.1" o.g.jersey.servlet.WebComponent A servlet request to the URI <REDACTED> contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
      2026-02-13 15:22:54,295 WARN  [http-nio-7990-exec-3] *<REDACTED> <REDACTED> "POST /rest/oauth2/latest/token HTTP/1.1" o.g.jersey.servlet.WebComponent A servlet request to the URI <REDACTED> contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
      2026-02-13 15:22:54,295 WARN  [http-nio-7990-exec-3] *<REDACTED> <REDACTED> "POST /rest/oauth2/latest/token HTTP/1.1" o.g.jersey.servlet.WebComponent A servlet request to the URI <REDACTED> contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
      2026-02-13 15:22:54,295 WARN  [http-nio-7990-exec-3] *<REDACTED> <REDACTED> "POST /rest/oauth2/latest/token HTTP/1.1" o.g.jersey.servlet.WebComponent A servlet request to the URI <REDACTED> contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
      

      Those are not actually Bitbucket-specific warnings. They are Jersey (REST framework) warning about the /rest/oauth2/latest/token request body is being read.

      The body is being read twice via two different mechanisms. Jersey is warning that only handlers using @FormParam (its own idiom for form parameters) will work reliably if it is the one that parses the body.

      Workaround:

      Endpoint to change logger (available only during runtime):

      curl -u <ADMIN_USERNAME> -X PUT -d "" -H "Content-Type: application/json" "<BITBUCKET_BASE_URL>/rest/api/latest/logs/logger/org.glassfish.jersey.servlet.WebComponent/ERROR" 

      Or:

      • Open bitbucket.properties file
      • Add the following property
        logging.logger.org.glassfish.jersey.servlet.WebComponent=ERROR
      • Save the file
      • Restart Bitbucket to get the changes to take effect.

              Assignee:
              Unassigned
              Reporter:
              Victor Menes
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: