Replicating with Cloudant shared databases

32 views
Skip to first unread message

Brendan Duddridge

unread,
Jun 15, 2016, 4:10:22 AM6/15/16
to Couchbase Mobile
In Cloudant you can grant another Cloudant user access to one of your databases. When you do this, the user being shared with sees the database under the shared tab with the database name in the following format:

username/databasename

Where username is the user who is sharing the database and databasename is the database being shared.

When I setup my replicator, I pass in a URL of the format:

https://myusername.cloudant.com/username/databasename


However, when I start trying to replicate, I get the following error:


CBLRemoteJSONRequest[POST https://myusername.cloudant.com/username/databasename/_revs_diff]: Got error CBLHTTP[405, "Only DELETE,GET,HEAD,PUT allowed", <https://myusername.cloudant.com/username/databasename/_revs_diff>]


I've confirmed with the user sharing the database with me that I have full admin/read/write/replication permissions to the database being shared.


The big difference here from replicating databases in my own account is the addition of the username parameter in the path.


I tried encoding the slash character in the database name (e.g. username%2Fdatabasename but that just gave me some not found errors.


So I'm just wondering if anyone has done this already and figured out how that works with Cloudant? Or maybe it's just not possible to replicate in this way.


Thanks,


Brendan




Jens Alfke

unread,
Jun 15, 2016, 1:36:01 PM6/15/16
to mobile-c...@googlegroups.com
😱 Oog. Slashes in database names are problematic. I mean, they’re perfectly legal, but they tend to expose implementation bugs where URL paths aren’t being handled 100% correctly. It’s not the first time we’ve had bugs involving them, and this definitely sounds like a bug in the replicator.

I tried encoding the slash character in the database name (e.g. username%2Fdatabasename but that just gave me some not found errors.

The correct URL is <https://myusername.cloudant.com/username%2Fdatabasename>. (If the “/“ weren't escaped, the URL would refer to a document ‘databasename' in a database named ‘username’.)

Could you file a bug report on Github, please?

—Jens

Brendan Duddridge

unread,
Jun 15, 2016, 3:58:38 PM6/15/16
to Couchbase Mobile
Thanks for your response Jens.

I tried it with the properly encoded URL, but it also failed to find the database.

I've filed a bug report:


Thanks,

Brendan
Reply all
Reply to author
Forward
0 new messages