couchbaselabs / cbft

*THIS PROJECT HAS MOVED* from couchbaselabs TO: https://github.com/couchbase/cbft -- no further development will be done here on couchbaselabs/cbft
Other
27 stars 5 forks source link

0.2.0 cbft-full failed to create index definition against beer-sample bucket through API #157

Closed weilliu closed 8 years ago

weilliu commented 9 years ago

I am getting "Http unauthorized error" when make a rest call to index beer-sample bucket

Wei-Lis-MacBook-Pro:sdkdclient-ng wei-li$ curl -X PUT 'http://10.3.3.203:8095/api/index/another-index?indexType=bleve&sourceType=couchbase&sourceName=http://beer-sample@172.23.107.174:8091/pools/default/buckets/beer-sample'
rest_create_index: error creating index: another-index, err: manager_api: failed to connect to or retrieve information from source, sourceType: couchbase, sourceName: http://beer-sample@172.23.107.174:8091/pools/default/buckets/beer-sample, sourceUUID: , err: feed_cb: DataSourcePartitions/couchbase connection failed, server: http://beer-sample@172.23.107.174:8091, poolName: default, bucketName: beer-sample, sourceType: couchbase, sourceParams: "", err: HTTP error 401 Unauthorized getting "http://172.23.107.174:8091/pools": , please check that your authUser and authPassword are correct and that your couchbase server ("http://beer-sample@172.23.107.174:8091") is available

The bucket does not have any password set, and we are sure it is there

Wei-Lis-MacBook-Pro:sdkdclient-ng wei-li$ curl http://beer-sample@172.23.107.174:8091/pools/default/buckets/beer-sample |python -m json.tool | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9970  100  9970    0     0   222k      0 --:--:-- --:--:-- --:--:--  226k
{
    "authType": "sasl",
    "autoCompactionSettings": false,
    "basicStats": {
        "dataUsed": 45021184,
        "diskFetches": 0,
        "diskUsed": 58066034,
        "itemCount": 7303,
        "memUsed": 88912528,
        "opsPerSec": 0,
        "quotaPercentUsed": 42.39679718017578
    },

Index against default bucket works for me

Wei-Lis-MacBook-Pro:sdkdclient-ng wei-li$ curl -X PUT 'http://10.3.3.203:8095/api/index/another-index?indexType=bleve&sourceType=couchbase&sourceName=http://default@172.23.107.174:8091/pools/default/buckets/default'
{"status":"ok"}
steveyen commented 8 years ago

Best guess is that that couchbase server node was visible from your macbook where you were running curl, but not visible/accessible from where you were running cbft (10.3.3.203).

Closing this issue based on that loose guess.