Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13507

Post-receive hooks should support IPv6 environment since the bitbucket already supports IPv6

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Answered
    • Icon: Medium Medium
    • 8.0.0
    • 5.8.0
    • Git Hosting

      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.

            744c7388e89a Jemma Zhang
            5338c0aa34f9 Danny Samuel
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: