[CCBC-500] ConnSpec parser fails to understand a string with a non-existent scheme. Created: 20/Aug/14  Updated: 20/Aug/14

Status: Open
Project: Couchbase C client library libcouchbase
Component/s: library
Affects Version/s: 2.4.0
Fix Version/s: .future
Security Level: Public

Type: Task Priority: Major
Reporter: Brett Lawson Assignee: Mark Nunberg
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
When passing a string that is simply an IP address (ie: `192.168.7.26:8091`), libcouchbase fails with a 'Invalid arguments' error.

 Comments   
Comment by Mark Nunberg [ 20/Aug/14 ]
this is by design. to use a raw address, the v2 structure should be used instead
Comment by Brett Lawson [ 20/Aug/14 ]
A raw address/port combination is a valid URI and a valid connection string, http scheme should be used by default if one is not provided. This is necessary for backwards compatibility and does not have any known side effects.
Comment by Mark Nunberg [ 20/Aug/14 ]
The heuristics here are a bit more complex, and we shouldn't be using HTTP bootstrap by default unless there is good reason to do so, thus for example a traditional 'simple IP' address should end up being CCCP, but if a port is provided, would be HTTP, etc.

In my opinion, if dealing with a higher level SDK, the branching should be done at the SDK level rather than within the client library itself (this way, the SDK has a chance to print out a warning about how using a scheme-less syntax is deprecated, etc). This would work by having the SDK determine if the string starts with a valid scheme, and if it does, use the 'v3' options. If it does not, use the 'v1' options
Comment by Brett Lawson [ 20/Aug/14 ]
Whilst I agree with you, the spec specifically defines a host/port combination as being valid for other reasons (such as easily supporting user upgrades). Breaking spec for a single SDK, especially since it's such a simple change (literally code was added to make this specifically not work) does not make sense.

P.S. Using couchbase:// by default does not permit backwards compatibility with pre-2.5 servers (or it should not be at least, again, for reasons I won't list here; some are mentioned in the spec). Thus defaulting to this on a 'feature' thats sole purpose is supporting lazy initial upgrades also makes no sense.




[CCBC-499] cbc pillowfight now longer working Created: 18/Aug/14  Updated: 20/Aug/14  Resolved: 18/Aug/14

Status: Resolved
Project: Couchbase C client library libcouchbase
Component/s: library
Affects Version/s: 2.4.0
Fix Version/s: 2.4.1
Security Level: Public

Type: Bug Priority: Major
Reporter: Nakomis Assignee: Mark Nunberg
Resolution: Fixed Votes: 0
Labels: pillowfight
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-67-virtual i686) on Softlayer VM


 Description   
Have installed libcouchbase, following instructions here [1]. When I run `cbc pillowfight` I get the following error:

Unknown command pillowfight
Usage: cbc <command> [options]
command may be:
   help Show help
<......>

If I run `cbc pillowfight -h 127.0.0.1:8091 -b default -i 1000 -I 1000 -t 1 -Q 1 -s 0 -m 50 -M 5120` I get the error:
Unknown command pillowfight
Couldn't parse options: Unknown option
No such option: i
Usage:
  pillowfight [OPTIONS...]

   -P --password Bucket password [Default='']
   -u --username Username (currently unused) [Default='']
<....>

`cbc version` gives the following:
cbc:
  Runtime: Version=2.4.0, Changeset=3ad936575b1718a748e5dc6ff73dfe801a201b15
  Headers: Version=2.4.0, Changeset=3ad936575b1718a748e5dc6ff73dfe801a201b15
  IO: Default=libevent, Current=libevent
  Compression (snappy): .. NOT SUPPORTED
  SSL: .. SUPPORTED

This was previously working

Please let me know if you require any further information

Cheers

Martin


[1]: http://www.couchbase.com/communities/c-client-library

 Comments   
Comment by Mark Nunberg [ 18/Aug/14 ]
http://review.couchbase.org/#/c/40189/
Comment by Nakomis [ 20/Aug/14 ]
Thanks, I hadn't realized `cbc pillowfight` had been replaced by `cbc-pillowfight`. Using the new cbc-pillowfight, is it possible to run it against a remote machine? If I try `cbc-pillowfight -h <ip of remote server>:8091 -b default -i 1000 -I 1000 -t 1 -Q 1 -s 0 -m 50 -M 5120` I get the error "The -h/--host option is deprecated. Use connection string instead", however, I can't find a way to specify the connection string

Thanks
Comment by Mark Nunberg [ 20/Aug/14 ]
Use the -U option. More information on the connection string can be found here: http://docs.couchbase.com/sdk-api/couchbase-c-client-2.4.0/group___l_c_b___l_c_b_t.html#structlcb__create__st3




Generated at Thu Aug 21 01:27:05 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.