Details
-
Bug
-
Resolution: Answered
-
Medium
-
5.8.0
-
2
-
Severity 3 - Minor
-
2
-
Description
Issue Summary
$BITBUCKET_HOME/bin/git-hooks/hook-callback.pl script opens a socket connection for hook callbacks, currently, even if the bitbucket is running on IPv6 environment this script tries to open the socket on IPv4.
Steps to Reproduce
Run Bitbucket on an IPv6 environment and try to clone you will see the $BITBUCKET_HOME/bin/git-hooks/hook-callback.pl listening on the IPv4 address.
Expected Results
$BITBUCKET_HOME/bin/git-hooks/hook-callback.pl should start listening on IPv6 address
Actual Results
$BITBUCKET_HOME/bin/git-hooks/hook-callback.pl still uses Ipv4
atlbitb+ 9750 9749 1 11:23 ? 00:00:07 perl /var/atlassian/application-data/bitbucket/bin/git-hooks/hook-callback.pl git-pack-objects git pack-objects --revs --thin --stdout --progress --delta-base-offset
lsof -p 9750
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
perl 9750 atlbitbucket cwd DIR 0,38 4096 1048653 /var/atlassian/application-data/bitbucket/shared/data/repositories/22 (10.9.30.120:/mnt/home)
perl 9750 atlbitbucket rtd DIR 202,1 4096 96 /
perl 9750 atlbitbucket txt REG 202,1 11312 4235117 /usr/bin/perl
perl 9750 atlbitbucket 3u IPv4 104222 0t0 TCP localhost:45206->localhost:41219 (ESTABLISHED)
Workaround
Modify the $BITBUCKET_HOME/bin/git-hooks/hook-callback.pl to use IPv6
Change the below line on $BITBUCKET_HOME/bin/git-hooks/hook-callback.pl
my $socket = new IO::Socket::INET
It should be replaced to:
my $socket = new IO::Socket::INET6
(also added use IO::Socket::INET6; at top of hook-callback.pl)
Please Note this isn't a permanent setting everytime the Bitbucket service is restarted the hook-callback.pl is regenerated by the Bitbucket so it must be modified every time after the restart.