Closed hedphuqz closed 3 years ago
Auth plugins are not supported for replication, db.replicate
requires using api key/password to compose a correct source and target urls. ref.
In general we recommend to use our new node sdk, which does support IAM in replication.
As a work-around, as you've found out, it is possible to use request
and pass in replication job document directly.
Thank you for pointing on dead documentation links in README.
Please read these guidelines before opening an issue.
Bug Description
If i try to run a replication between one DB to another, the replication will fail by default if i am using the IAM plugin, saying that
Error: unauthorized to access or create database <SOURCE_DB>
1. Steps to reproduce and the simplest code sample possible to demonstrate the issue
Load cloudant and use the IAM plugin for authentication with IBM Cloud. Run
.replicate()
on any DB2. What you expected to happen
I expected the replication work successfully (OR find some documentation around this issue specifically, https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-authorization returns an empty document)
3. What actually happened
The replication failed saying the client was not authorized.
Instead to solve it i had to do a
cloudant.request()
and pass in the IAM key this way.Environment details