Open iivvoo opened 3 years ago
I learned that there is a basic setup required on new nodes,
https://docs.couchdb.org/en/stable/setup/single-node.html
Again, not sure if kivik should provide this in any way but especially if you don't use fauxton the steps are essential (e.g. in a dockerized Ci/CD setup)
Thanks for raising this issue. There are a couple possible approaches here:
As a side project, I've also been working on a command-line couchdb control tool (working name kouchctl
) to facilitate bootstrapping and maintenence of CouchDB instances, as part of this repo: https://github.com/go-kivik/xkivik
This will have a cluster-setup
command to do this sort of thing. That might be a better approach than putting it in the kivik library directly. IDK.
I welcome your thoughts, based on your usage.
My current use case is to test an automatic replication setup which, in CI, happens against a clean, empty, uninitialzed couchdb where locally it runs against a local, reusable instance.
The actual error isn't that obvious:
replication_test.go:126:
Error Trace: replication_test.go:126
test_helpers.go:67
Error: Received unexpected error:
Not Found: Database does not exist.:
REQUEST: GET http://localhost:5984/_scheduler/docs (0 bytes)
RESPONSE: 404 / Not Found (58 bytes)
Test: TestReplication/Test_Repeated_Replication#01
since the solution is to create _replicator and not _scheduler.
Mentioning it in the docs might help (not sure if this is common knowledge, it definitely caught me by surprise) Or alternatively catch and handle the 404 explicitly and return an "Couch not properly initialized" error?
With kivik/v4 and couchdb/v4
It seems the _replicator database has to be created explicitly (fauxton does this as well). Without it, GetReplications() will fail
will print
I'm not sure if this is something Kivik should deal with, but at least it might be worth mentioning