WARN o.a.h.c.p.ResponseProcessCookies Invalid cookie header log

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Log message in Bitbucket logs showing Invalid cookie header in logs. This issue happens when a load balancer or other device adds the Expire to the cookie.

This article only shows how to suppress this log.

Environment

Bitbucket Data Center

Diagnosis

Here is an example log

1 2021-11-29 00:00:01,153 WARN [ssh-scm-request-handler] AAAAA *OUKIAGx0x3809195x4 1gos6hw 1.1.1.1 SSH - git-upload-pack '/test/test.git' o.a.h.c.p.ResponseProcessCookies Invalid cookie header: "Set-Cookie: AWSALBCORS=dq7DMIy//Z1uQVHS4vc/t59tqL5987uLsDDk3l3VNHQn3y7K3BSHSsCGAcnimpdLY+nvsfNoHBo72xzjG2ugm3xOZlGBhoiH3WGRgJjbpeXpQWIcVi9M/jJSfYpu; Expires=Mon, 06 JAN 2022 05:00:01 GMT; Path=/; SameSite=None; Secure". Invalid 'expires' attribute: Mon, 06 JAN 2022 05:00:01 GMT

Solution

This curl command can be used to immediately stop the logging. This does not survive restart.

1 curl -u <ADMIN_USERNAME> -v -X PUT -d "" -H "Content-Type: application/json" <BASE_URL>/rest/api/latest/logs/logger/org.apache.http.client.protocol.ResponseProcessCookies/ERROR

Please note, incase you have context path configured for your Bitbucket instance, you will need to append it to the base url or it may result in "HTTP Status 404 – Not Found"

1 <BASE_URL>/<context_path>/rest/api/latest/logs/logger/org.apache.http.client.protocol.ResponseProcessCookies/ERROR

For a simple test you can do a GET call from your browser to know the current log level

1 <BASE_URL>/rest/api/latest/logs/logger/org.apache.http.client.protocol.ResponseProcessCookies

To stop the logging permanently, Configure Bitbucket Server Logging with the following change. This can be added somewhere near the "Other libraries and frameworks" section:

1 2 <!-- Turn off o.a.h.c.p.ResponseProcessCookies Invalid cookie header logs https://confluence.atlassian.com/display/BitbucketServerKB/WARN+o.a.h.c.p.ResponseProcessCookies+Invalid+cookie+header+log --> <logger name="org.apache.http.client.protocol.ResponseProcessCookies" level="ERROR"/>

Restart Bitbucket after making this change. It is recommend to confirm this logging has been removed at each upgrade.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.