Followup with resolution.
Couple of issues compounded the wonkiness but the big takeaway is that the
sync bucket config allows username and password to be specified in the url
or via `username` and `password` members in the dict. However, the shadow
db config will only work with the username/password keywords. I figured
this out when I realized the dbConfig stanza goes out of it's way to
initialize user/pass from the url if not set but doesn't do the same thing
for the shadowConfig. (see
https://github.com/couchbase/sync_gateway/blob/1da4ee46a91c4cad15074233fcdd7cfd4603ee63/src/github.com/couchbaselabs/sync_gateway/rest/config.go#L119
)
Also - and I had to dig to find this - the "Administrator" account is NOT
the correct one. The errors here are a bit esoteric and useless to me.
The correct thing to do is set the SASL password per the bucket via admin
console. Then, in your sync config, set username=NameOfBucket and
password=(the sasl password you set in the console). I spent a ton of
time thinking I wasn't connecting to the sync bucket, but instead my issue
was with the shadow bucket.
I'm sure this is all documented somewhere, but I couldn't find it. Maybe
my goof will help someone else.
-jeremy
On Tuesday, August 5, 2014 5:31:21 PM UTC-5, Jeremy Kelley wrote:
>
> I'm sure I'm missing something obvious but I'm trying to get syncgateway
> to connect to a bucket that is password protected.
>
> I have tried setting something like
>
> ...
> "databases":{ "mysyncdb": {
> "server":"http://mysyncdb:[email protected]",
> ...
> } } ...
>
>
> I've tried setting a separate "password" key in the database stanza.
>
> I found a pull request that mentioned how to do this for shadowed buckets
> (put the name of the bucket as the username).
>
> This is the error I'm seeing.
>
> 18:28:37.187523 FATAL: Error opening database: 502 Unable to connect to
> server: HTTP error 401 Unauthorized getting "
> http://db-00.lvlr.io:8091/pools": -- rest.RunServer() at config.go:358
>
> Am I missing something obvious?
>
>
> I'll admit I've not dug into the actual source of sync gateway yet, but
> that's next.
>
> Thanks.
>
> -jeremy
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/a0d50c3a-46ce-4e65-8a0b-88388e06bdee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.