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

godbc: For cases where we press up or down arrow when entering passwords, Error isn't fully displayed

    XMLWordPrintable

Details

    • Untriaged
    • Unknown
    • Query-Sprint-10-03-2016

    Description

      • When we press the up arrow key when entering passwords, godbc captures this.
        -in the even of an error we use fmt.Errorf with format as %v. This evaluates the control sequences and hence results in the following :

      Ishas-MacBook-Pro:cbq isha$ ./cbq -u=Administrator -e="127.0.0.1:8091"
       Enter Password: 
       ERROR 100 : N1QL: Connection failed Post http://Administrator:*@127.0.0.1:8091/. Error Get http://127.0.0.1:8091/pools: dial tcp 127.0.0.1:8091: getsockopt: connection refused 
       N1QL: Unable *connect to cluster endpoint http://Administrator:
       
       Path to history file for the shell : /Users/isha/.cbq_history 
      cbq> 
      
      

      This is because the up arrow control characters are evaluated and the resultant string we get is

      Ishas-MacBook-Pro:cbq isha$ ./cbq -u=Administrator -e="127.0.0.1:8091"
       Enter Password: 
       
      DEBUG MESSAGE :::
                                                                        @127.0.0.1:8091/. Error Get http://127.0.0.1:8091/pools: dial tcp 127.0.0.1:8091: getsockopt: connection refused 
       N1QL: Unable to connect to cluster endpoint http://Administrator:
       
      DEBUG MESSAGE END :: 
       
       ERROR 100 : N1QL: Connection failed Post http://Administrator:*@127.0.0.1:8091/. Error Get http://127.0.0.1:8091/pools: dial tcp 127.0.0.1:8091: getsockopt: connection refused 
       N1QL: Unable *connect to cluster endpoint http://Administrator:
       
       Path to history file for the shell : /Users/isha/.cbq_history 
      cbq> 
      

      In order to fix this, we need to escape the control characters by using %q to display string as is.

      Attachments

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

        Activity

          People

            Prerna.Manaktala Prerna Manaktala (Inactive)
            isha Isha Kandaswamy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty