Backend should "wait" for the database container to be ready
The error No Living connections, Error: No Living connections, which happens when backend container is started before database is ready to receive its requests, can be (is) confusing, especially for new members in the project.
Error:
backend_1 | [ERROR] Failed getting alias map:, No Living connections, Error: No Living connections
backend_1 | Elasticsearch ERROR: 2019-02-05T13:02:19Z
backend_1 | Error: Request error, retrying
backend_1 | GET http://database:9200/_alias => connect ECONNREFUSED 172.19.0.2:9200
backend_1 | at Log.error (/app/node_modules/elasticsearch/src/lib/log.js:226:56)
backend_1 | at checkRespForFailure (/app/node_modules/elasticsearch/src/lib/transport.js:259:18)
backend_1 | at HttpConnector.<anonymous> (/app/node_modules/elasticsearch/src/lib/connectors/http.js:163:7)
backend_1 | at ClientRequest.wrapper (/app/node_modules/lodash/lodash.js:4935:19)
backend_1 | at ClientRequest.emit (events.js:182:13)
backend_1 | at Socket.socketErrorListener (_http_client.js:392:9)
backend_1 | at Socket.emit (events.js:182:13)
backend_1 | at emitErrorNT (internal/streams/destroy.js:82:8)
backend_1 | at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
backend_1 | at process._tickCallback (internal/process/next_tick.js:63:19)
backend_1 |
backend_1 | [ERROR] Failed getting alias map:, No Living connections, Error: No Living connections
backend_1 | at sendReqWithConnection (/app/node_modules/elasticsearch/src/lib/transport.js:226:15)
backend_1 | at next (/app/node_modules/elasticsearch/src/lib/connection_pool.js:214:7)
backend_1 | at process._tickCallback (internal/process/next_tick.js:61:11)
Possible solution:
healthcheck (docs)
Edited by Jovan Krunić