Unable to start HAProxy Load Balancer after an upgrade to higher version with Bitbucket Server.

Still need help?

The Atlassian Community is here for you.

Ask the community

Datacenter

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

After an upgrade of HAProxy load balancer from 2.0.13 to 2.6.1 version, HAProxy Load Balancer does not come up while trying to start due to the sticky session-specific error "unknown fetch method 'set-cookie'.

Environment

Bitbucket - 7.21.0
HAProxy Version Before Upgrade - 2.0.13
HAProxy Version After Upgrade - 2.6.1

Diagnosis


root@host:/etc/haproxy# haproxy -f /etc/haproxy/haproxy.cfg -db
[NOTICE] (3442430) : haproxy version is 2.6.1
[NOTICE] (3442430) : path to executable is /usr/sbin/haproxy
[WARNING] (3442430) : config : parsing [/etc/haproxy/haproxy.cfg:52] : backend 'bitbucket_http_backend' : 'option httplog' directive is ignored in backends.
[ALERT] (3442430) : config : parsing [/etc/haproxy/haproxy.cfg:60] : 'stick': unknown fetch method 'set-cookie'
[ALERT] (3442430) : config : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] (3442430) : config : Fatal errors found in configuration.

Cause

The error "unknown fetch method 'set-cookie'" occurs due to the 'set-cookie' function defined in HAproxy.conf file. 'set-cookie' function is specific to the sticky session process, recommended for Bitbucket Data Center but not supported in the higher version of HAProxy server.

In the lower version of HAProxy server, below configuration is required to established sticky session for Bitbucket Data Center.

stick-table type string len 52 size 5M expire 30m
stick store-response set-cookie(BITBUCKETSESSIONID)
stick on cookie(BITBUCKETSESSIONID)

Solution

In the higher version of HAProxy server, above lines need to be replaced with the below mentioned lines (advised from HAProxy Support) which should resolve this issue.

stick-table type string len 52 size 5M expire 30m
stick store-response res.cook(BITBUCKETSESSIONID)
stick on req.cook(BITBUCKETSESSIONID)


Note: In case, issue doesn't resolve after above steps - we must involve the HAProxy vendor as Bitbucket Support doesn't have expertise on HAProxy and inputs need to be availed from HAProxy Support or Vendor Team.

Last modified on Aug 18, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.