medic / cht-sync

Data synchronization between CouchDB and PostgreSQL for the purpose of analytics.
GNU General Public License v3.0
4 stars 5 forks source link

medic database not found when running locally with docker #148

Closed njuguna-n closed 2 months ago

njuguna-n commented 2 months ago

Describe the bug When trying to run CHT Sync locally with docker compose, the coucdb container created does not have the medic database so there is an error that is thrown.

To Reproduce

  1. clone the repo locally
  2. copy the env.template to .env
  3. run docker compose -f docker-compose.postgres.yml -f docker-compose.yml -f docker-compose.couchdb.yml up -d

Expected behavior CHT Sync should start and connect to the couchdb instance without any errors

Logs

2024-09-10 11:25:34 node:internal/process/promises:391
2024-09-10 11:25:34     triggerUncaughtException(err, true /* fromPromise */);
2024-09-10 11:25:34     ^
2024-09-10 11:25:34 {
2024-09-10 11:25:34   error: 'not_found',
2024-09-10 11:25:34   reason: 'Database does not exist.',
2024-09-10 11:25:34   status: 404,
2024-09-10 11:25:34   name: 'not_found',
2024-09-10 11:25:34   message: 'Database does not exist.',
2024-09-10 11:25:34   stack: 'Error\n' +
2024-09-10 11:25:34     '    at Object.generateErrorFromResponse (/node_modules/pouchdb-errors/lib/index.js:100:18)\n' +
2024-09-10 11:25:34     '    at fetchJSON (/node_modules/pouchdb-adapter-http/lib/index.js:251:31)\n' +
2024-09-10 11:25:34     '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
2024-09-10 11:25:34     '    at async fetchData (/node_modules/pouchdb-adapter-http/lib/index.js:1029:24)'
2024-09-10 11:25:34 }
2024-09-10 11:25:34 
2024-09-10 11:25:34 Node.js v20.17.0

Screenshots

mrjones-plip commented 2 months ago

Related forum post

njuguna-n commented 2 months ago

Updated documentation and responded the forum