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

CLI tools authentication error messages should note that password with special chars need to be in quotes

    XMLWordPrintable

Details

    Description

      In cli tools – like cbimport –  the authentication error message should note that a password with special characters need to be enclosed in quotes.

      In the below examples, the password is ab!!cdefgh – and !! in sh is an alias for the previous sh command run.

      Example from 6.6.2:

      $ cbimport json -c couchbase://127.0.0.1 --bucket test-bucket1 --format lines -g key::#UUID# -u testusr -p ab!!cdefgh -d file://./test.json
      cbimport json -c couchbase://127.0.0.1 --bucket test-bucket1 --format lines -g key::#UUID# -u testusr -p ablscdefgh -d file://./test.json
      2021-06-04T05:12:05.317+00:00 WARN: Fail to create Couchbase sink, could not get Couchbase Server version -- couchbase.CreateSink() at sink.go:46
      JSON import failed: Authentication error executing "GET http://127.0.0.1:8091/pools/default" check username and password
      

       
      Example from 7.0.0-5256:

      % cbimport json -c couchbase://127.0.0.1 --bucket test-bucket1 --format lines -g key::#UUID# -u testusr -p ab!!cdefgh -d file://./test2.json 
      cbimport json -c couchbase://127.0.0.1 --bucket test-bucket1 --format lines -g key::#UUID# -u testusr -p ablscdefgh -d file://./test2.json
      JSON import failed: failed to connect to any host(s) from the connection string, check username and password
      

       

      In both 6.6.2 and 7.0.0-5256, the cbimport command succeeds if the password is enclosed in single quotes:

      % cbimport json -c couchbase://127.0.0.1 --bucket test-bucket1 --format lines -g key::#UUID# -u testusr -p 'ab!!cdefgh' -d file://./test2.json 
      JSON `file://./test2.json` imported to `couchbase://127.0.0.1` successfully
      Documents imported: 4 Documents failed: 0
      

       

      Also, since the type and location of the special characters in the password can interact with the sh in different ways such that the cbimport command never gets to the point of returning an error message to check username and password, it should be documented that a password with special characters need to be enclosed in quotes (if not documented already).

      Attachments

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

        Activity

          People

            hyun-ju.vega Hyun-Ju Vega
            hyun-ju.vega Hyun-Ju Vega
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty