opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
86 stars 67 forks source link

User's cannot login after deployment issue: user-mgnt service doesn't restart if it cannot connect to database #6482

Open rikukissa opened 8 months ago

rikukissa commented 8 months ago

Description

pencrvs_user-mgnt.1.2amm2pnodt3s@pameciisrv03    | {"level":50,"time":1706642896160,"pid":28,"hostname":"2331beaa13d8","err":{"type":"MongoServerError","message":"Authentication failed.","stack":"MongoServerError: Authentication failed.\n    at Connection.onMessage (/app/node_modules/mongodb/lib/cmap/connection.js:231:30)\n    at MessageStream.<anonymous> (/app/node_modules/mongodb/lib/cmap/connection.js:61:60)\n    at MessageStream.emit (node:events:513:28)\n    at MessageStream.emit (node:domain:489:12)\n    at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:125:16)\n    at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:33:9)\n    at writeOrBuffer (node:internal/streams/writable:391:12)\n    at _write (node:internal/streams/writable:332:10)\n    at MessageStream.Writable.write (node:internal/streams/writable:336:10)\n    at Socket.ondata (node:internal/streams/readable:754:22)\n    at Socket.emit (node:events:513:28)\n    at Socket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk (node:internal/streams/readable:289:9)\n    at Socket.Readable.push (node:internal/streams/readable:228:10)\n    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)\n    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)","ok":0,"code":18,"codeName":"AuthenticationFailed","$clusterTime":{"clusterTime":{"$timestamp":"7329975407090860033"},"signature":{"hash":"FJPno6PoHNcn3zbyAVTJGEO7wQw=","keyId":{"low":5,"high":1700494176,"unsigned":false}}},"operationTime":{"$timestamp":"7329975407090860033"},"connectionGeneration":0},"msg":"Authentication failed."}
opencrvs_user-mgnt.1.2amm2pnodt3s@pameciisrv03    | {"level":30,"time":1706642897171,"pid":28,"hostname":"2331beaa13d8","msg":"MongoDB disconnected"}
opencrvs_user-mgnt.1.2amm2pnodt3s@pameciisrv03    | {"level":50,"time":1706642897171,"pid":28,"hostname":"2331beaa13d8","err":{"type":"MongoServerError","message":"Authentication failed.","stack":"MongoServerError: Authentication failed.\n    at Connection.onMessage (/app/node_modules/mongodb/lib/cmap/connection.js:231:30)\n    at MessageStream.<anonymous> (/app/node_modules/mongodb/lib/cmap/connection.js:61:60)\n    at MessageStream.emit (node:events:513:28)\n    at MessageStream.emit (node:domain:489:12)\n    at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:125:16)\n    at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:33:9)\n    at writeOrBuffer (node:internal/streams/writable:391:12)\n    at _write (node:internal/streams/writable:332:10)\n    at MessageStream.Writable.write (node:internal/streams/writable:336:10)\n    at Socket.ondata (node:internal/streams/readable:754:22)\n    at Socket.emit (node:events:513:28)\n    at Socket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk

Acceptance criteria

GIVEN WHEN THEN

Design

(Link to Figma)

Dev tasks

euanmillar commented 4 months ago

@rikukissa I dont think this is a bug. If it cant connect to the database then there would have been something wrong on the server. Isnt this therefore resolved?

rikukissa commented 4 months ago

@euanmillar all services need to exit with a non-zero exit code if connection is lost or never established with a database. Alternatively a reliable reconnection mechanism needs to be in place. This ticket is to verify one of these things happen.