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

couchbase-cli reset-admin-password cannot communicate with clusters running on IPv6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.6.2
    • 7.6.0
    • tools
    • Security Level: Public
    • Darwin Kernel Version 23.4.0
      root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64
    • Untriaged
    • MacOSX 64-bit
    • n/a
    • 0
    • Unknown

    Description

       

      Steps to Reproduce

      1. Start an instance of Couchbase on host machine and go to web UI via http://[::1]:8091.
      2. Create a new Couchbase Cluster. During configuration, set IP Family Preference to IPv6-only.
      3. After deploying, use couchbase-cli to try and change the admin password

      $ couchbase-cli reset-admin-password --new-password test

      1. The following error pops up:

      ERROR: Unable to connect to host at http://127.0.0.1:8091: HTTPConnectionPool(host='127.0.0.1', port=8091): Max retries exceeded with url: /pools (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x102dd2510>: Failed to establish a new connection: [Errno 61] Connection refused')) 

      Second Scenario:

      1. Couchbase Server 7.6.0 build 2149 running on bare-metal MacOS. Another instance of Couchbase Server 7.6.0 build 2176 running via Docker. The command used to spin up this container is:

      docker run -d --name db -p 127.0.0.1:8091-8096:8091-8096 -p 127.0.0.1:11210-11211:11210-11211 couchbase:7.6.0
      

      Through this, we now have two instances of Couchbase Server. One running on bare-metal (attached to IPv6 loopback), and the other on Docker (attached to IPv4 loopback).

      1. Set up clusters for both instances of Couchbase Server. For host machine, go to http://[::1]:8091 and set cluster to work on either ipv6 or ipv6-only address family. For the docker instance, go to http://127.0.0.1:8091, then make the instance use ipv4 or ipv4-only.
      2. Now, try running couchbase-cli reset-admin-password to change the password again:

      couchbase-cli reset-admin-password --new-password test

      1. The following error is observed:

      ERROR: unable to access the REST API - please check your username (-u) and password (-p)

      This shouldn't appear as reset-admin-password doesn't require username and password

      Possible Cause

      Looking at the code for class ResetAdminPassword, it appears as if the IP address that the request is sent to, is hardcoded to be 127.0.0.1, which is the loopback address for IPv4 addresses.

       

      class ResetAdminPassword(LocalSubcommand):
          """The reset admin password command"""
      ...
      ...
          def execute(self, opts):
              token = _exit_on_file_read_failure(os.path.join(opts.config_path, "localtoken")).rstrip()
              rest = ClusterManager("http://127.0.0.1:" + opts.port, "@localtoken", token)
      ...
      ... 

       

      This prevents it from communicating with a Couchbase Server instance running on the IPv6 loopback address.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              gilad.kalchheim Gilad Kalchheim (Inactive)
              aditya.rao Aditya Rao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty