Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couch2pg errors with database "cht_sync" does not exist #171

Closed
andrablaj opened this issue Oct 18, 2024 · 1 comment
Closed

couch2pg errors with database "cht_sync" does not exist #171

andrablaj opened this issue Oct 18, 2024 · 1 comment
Labels
Type: Bug Fix something that isn't working as intended

Comments

@andrablaj
Copy link
Member

andrablaj commented Oct 18, 2024

Describe the bug

When running CHT Sync locally, couch2pg fails to start. It seems not to find/create the POSTGRES_DB (default value cht_sync).

To Reproduce

  1. Run Postgres locally.
  2. Run CouchDB locally.
  3. Copy the env.template to .env
  4. Run docker compose -f docker-compose.yml up -d

Expected behavior

CHT Sync should start and connect to the CouchDB instance without any errors.

Logs

Logs from the couch2pg container:

2024-10-18 17:11:10 /node_modules/pg-protocol/dist/parser.js:283
2024-10-18 17:11:10         const message = name === 'notice' ? new messages_1.NoticeMessage(length, messageValue) : new messages_1.DatabaseError(messageValue, length, name);
2024-10-18 17:11:10                                                                                                  ^
2024-10-18 17:11:10 
2024-10-18 17:11:10 error: database "cht_sync" does not exist
2024-10-18 17:11:10     at Parser.parseErrorMessage (/node_modules/pg-protocol/dist/parser.js:283:98)
2024-10-18 17:11:10     at Parser.handlePacket (/node_modules/pg-protocol/dist/parser.js:122:29)
2024-10-18 17:11:10     at Parser.parse (/node_modules/pg-protocol/dist/parser.js:35:38)
2024-10-18 17:11:10     at Socket.<anonymous> (/node_modules/pg-protocol/dist/index.js:11:42)
2024-10-18 17:11:10     at Socket.emit (node:events:519:28)
2024-10-18 17:11:10     at addChunk (node:internal/streams/readable:559:12)
2024-10-18 17:11:10     at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
2024-10-18 17:11:10     at Readable.push (node:internal/streams/readable:390:5)
2024-10-18 17:11:10     at TCP.onStreamRead (node:internal/stream_base_commons:191:23) {
2024-10-18 17:11:10   length: 93,
2024-10-18 17:11:10   severity: 'FATAL',
2024-10-18 17:11:10   code: '3D000',
2024-10-18 17:11:10   detail: undefined,
2024-10-18 17:11:10   hint: undefined,
2024-10-18 17:11:10   position: undefined,
2024-10-18 17:11:10   internalPosition: undefined,
2024-10-18 17:11:10   internalQuery: undefined,
2024-10-18 17:11:10   where: undefined,
2024-10-18 17:11:10   schema: undefined,
2024-10-18 17:11:10   table: undefined,
2024-10-18 17:11:10   column: undefined,
2024-10-18 17:11:10   dataType: undefined,
2024-10-18 17:11:10   constraint: undefined,
2024-10-18 17:11:10   file: 'postinit.c',
2024-10-18 17:11:10   line: '947',
2024-10-18 17:11:10   routine: 'InitPostgres'
2024-10-18 17:11:10 }
2024-10-18 17:11:10 
2024-10-18 17:11:10 Node.js v20.18.0

Additional context
The error disappears if I create the database POSTGRES_DB manually.

@andrablaj andrablaj added the Type: Bug Fix something that isn't working as intended label Oct 18, 2024
@witash
Copy link
Contributor

witash commented Jan 7, 2025

could not reproduce

@witash witash closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix something that isn't working as intended
Projects
No open projects
Status: Todo
Development

No branches or pull requests

2 participants