couchdb-bootstrap icon indicating copy to clipboard operation
couchdb-bootstrap copied to clipboard

Order of operation error

Open cboden opened this issue 8 years ago • 3 comments

In my bootstrap folder I'm creating a document in _replicator to replicate from one database setup via bootstrap to another database setup via bootstrap. It seems because _replicator comes first alphabetically it's parsed by couchdb-bootstrap first before the other databases are setup. This is causing the replication document created to fail.

The replicator document shows _replication_state is error and _replication_state_reason is

Couldn't open document _design/myddocname from source database models: {error,<<"not_found">>}

I either have to run setup twice or re-save the replicator document to fix the error.

cboden avatar Apr 21 '17 15:04 cboden

Hi @cboden, a possible workaround could also be to add create_target:true to the replication document. That way the database will be created if needed. The CouchDB Bootstrap suite only creates the database if it does not exist.

I will have a look at #40. I see your point that system databases should be handled differently.

jo avatar May 09 '17 07:05 jo

Unfortunately create_target: true did not work as my replication is filtered. The replicator is looking for the design doc in the source database that does not exist yet.

cboden avatar May 15 '17 15:05 cboden

I see.

jo avatar May 15 '17 20:05 jo