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

default bucket cannot be created on port 11211, must specify a different port

    Details

      Description

      [root@ip-10-127-157-49 ~]# /opt/membase/bin/cli/membase bucket-create -c 127.0.0.1 -u Administrator -p password --bucket=default --bucket-type=membase --bucket-port=11211 --bucket-ramsize=200 --bucket-replica=1
      ERROR: unable to bucket-create (400) Bad Request
      ERROR: command: bucket-create: 127.0.0.1:8091, 2
      [root@ip-10-127-157-49 ~]# /opt/membase/bin/cli/membase bucket-create -c 127.0.0.1 -u Administrator -p password --bucket=default --bucket-type=membase --bucket-port=11212 --bucket-ramsize=200 --bucket-replica=1
      SUCCESS: bucket-create

      The default bucket however ends up on port 11211.

      This is how is should work:
      1. --bucket=default --bucket-type=membase --bucket-port=11211 --bucket-ramsize=200 --bucket-replica=1
      Success
      2. --bucket=default --bucket-type=membase --bucket-ramsize=200 --bucket-replica=1
      Success
      3. --bucket=default --bucket-type=membase --bucket-port=11212 --bucket-ramsize=200 --bucket-replica=1
      Error: default bucket must be on 11211
      4. -bucket=default --bucket-type=membase --bucket-port=11211 --bucket-password="password"-bucket-ramsize=200 --bucket-replica=1
      Error: default bucket cannot have a password

      # Subject Project Status CR V
      For Gerrit Dashboard: &For+MB-3300=message:MB-3300

        Activity

        Hide
        mikew Mike Wiederhold added a comment -

        This is an ns_server fix. At one point I was going to fix it and from reading the ns_server code verified that this was a bug in ns_server.

        Show
        mikew Mike Wiederhold added a comment - This is an ns_server fix. At one point I was going to fix it and from reading the ns_server code verified that this was a bug in ns_server.
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        Let me elaborate a bit on what ns_server does.

        There are two authentication types (mirrored by radio-buttons on UI). There's password auth type (where password may be empty) and there's auth type of "none", where you need to specify new port for per-port-moxi. So you either pass password and set auth_type to sasl or you pass port and set auth_type to none.

        When bucket name is "default" it forcibly makes it of type sasl_auth and empty password. Because any other option for default bucket makes no sense. We can change that, but I don't think it needs changing.

        Now on our CLI. When somebody passes --bucket-port (why not just --port, btw) it apparently sends auth_type = none and sends port. When somebody passes --bucket-password it apparently sends auth_type = sasl. That logic is fine, but "default" is essentially separate auth_type. When creating bucket named default it should not accept non-empty password and --bucket-port (or only accept and ignore --bucket-port=11211).

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - Let me elaborate a bit on what ns_server does. There are two authentication types (mirrored by radio-buttons on UI). There's password auth type (where password may be empty) and there's auth type of "none", where you need to specify new port for per-port-moxi. So you either pass password and set auth_type to sasl or you pass port and set auth_type to none. When bucket name is "default" it forcibly makes it of type sasl_auth and empty password. Because any other option for default bucket makes no sense. We can change that, but I don't think it needs changing. Now on our CLI. When somebody passes --bucket-port (why not just --port, btw) it apparently sends auth_type = none and sends port. When somebody passes --bucket-password it apparently sends auth_type = sasl. That logic is fine, but "default" is essentially separate auth_type. When creating bucket named default it should not accept non-empty password and --bucket-port (or only accept and ignore --bucket-port=11211).
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        Well we can make requested validations part of ns_server. I just thought it makes more sense in client-side, but maybe I was wrong.

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - Well we can make requested validations part of ns_server. I just thought it makes more sense in client-side, but maybe I was wrong.
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        no it makes sense to take care of this in the client side.
        the server side logic is very clear for buckets with the name default . we just need to make sure what you described is also documented in the REST doc page.

        Show
        farshid Farshid Ghods (Inactive) added a comment - no it makes sense to take care of this in the client side. the server side logic is very clear for buckets with the name default . we just need to make sure what you described is also documented in the REST doc page.
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        a7244de Bin Cui, MB-3300 default bucket cannot be created on port 11211

        Show
        farshid Farshid Ghods (Inactive) added a comment - a7244de Bin Cui, MB-3300 default bucket cannot be created on port 11211

          People

          • Assignee:
            bcui Bin Cui (Inactive)
            Reporter:
            mikew Mike Wiederhold
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes