Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-7417

IP address detection incorrectly chooses link local addresses (169.254.0.0/16)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: ns_server
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Windows 7 (but probably not OS specific)

      Description

      IP address is detection picks up "169.254.x.x" addresses when there are interfaces with actual addresses configured down the list. The detection code incorrectly stops scanning when it encounters a link local address. It should instead of continuing to scan other interfaces for a "better" address.

      It's quite normal to assign link local 169.254.x.x addresses to links that do not otherwise have a network address. Our code should skip addresses in this (169.254.0.0 - 169.254.255.255) range and move on to other interfaces. I ran into this on Windows but it probably can happen on any other platforms just as well.

      Couchbase server ultimately fails to startup with the detected 169.254.x.x address.

      1> inet:getifaddrs().
      {ok,[{"\\DEVICE
      TCPIP_

      {F180A16E-C150-4D89-BDC3-56BDD12D0292}

      ",
      [

      {flags,[up,broadcast,multicast]}

      ,
      {addr,{169,254,206,55}},
      {netmask,{255,255,255,255}},
      {broadaddr,{169,254,206,55}},

      {hwaddr,[0,255,144,59,145,135]}

      ]},
      {"\\DEVICE
      TCPIP_

      {5C2FAF9F-3B84-4120-8DDC-0DBC0F8D64D4}

      ",
      [

      {flags,[up,running]}

      ,
      {addr,{192,168,4,208}},
      {netmask,{255,255,255,0}},

      {hwaddr,[0,19,232,177,113,59]}

      ]},
      {"\\DEVICE
      TCPIP_

      {E29AC6C2-7037-11DE-816D-806E6F6E6963}

      ",
      [

      {flags,[up,loopback,running]}

      ,
      {addr,{0,0,0,0,0,0,0,1}},
      {netmask,{65535,65535,65535,65535,65535,65535,65535,65535}},
      {addr,{127,0,0,1}},
      {netmask,{255,0,0,0}}]}]}

      2> addr_util:get_my_address().
      "169.254.206.55"

      1. debug.log
        382 kB
        Sriram Melkote
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        siri Sriram Melkote added a comment - - edited

        Log showing Couchbase startup failing due to bad autodetected address attached

        Show
        siri Sriram Melkote added a comment - - edited Log showing Couchbase startup failing due to bad autodetected address attached
        Show
        siri Sriram Melkote added a comment - Workaround: http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-bestpractice-cloud-ip.html Also see: http://www.couchbase.com/forums/thread/who-169-254-175-226
        Show
        bcui Bin Cui added a comment - http://review.couchbase.org/#/c/23512/
        Hide
        bcui Bin Cui added a comment -

        Sri has a fix for it already.

        http://review.couchbase.org/#/c/23453/.

        Show
        bcui Bin Cui added a comment - Sri has a fix for it already. http://review.couchbase.org/#/c/23453/ .
        Hide
        siri Sriram Melkote added a comment -

        review.couchbase.org/#/c/23453/

        Show
        siri Sriram Melkote added a comment - review.couchbase.org/#/c/23453/

          People

          • Assignee:
            siri Sriram Melkote
            Reporter:
            siri Sriram Melkote
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes