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

Importation fails because of connection #224

Open
lpatiny opened this issue Jun 16, 2020 · 1 comment
Open

Importation fails because of connection #224

lpatiny opened this issue Jun 16, 2020 · 1 comment

Comments

@lpatiny
Copy link
Member

lpatiny commented Jun 16, 2020

In my installation it seems that couchdb is not ready fast enough and the importation fails because it can not send the data in the database. This problem seems to disappear after a while.

Should the file in this case not stay in the to_process folder ?

rest-on-couch-import_1     | 2020-06-16T08:34:29.613Z couch:error (bin:import) import error: { GotError: connect ECONNREFUSED 172.18.0.2:5984 at onError (/rest-on-couch-source/node_modules/got/dist/source/request-as-event-emitter.js:136:29) at ClientRequest.request.on.error (/rest-on-couch-source/node_modules/got/dist/source/request-as-event-emitter.js:153:17) at ClientRequest.emit (events.js:203:15) at ClientRequest.origin.emit.args (/rest-on-couch-source/node_modules/@szmarczak/http-timer/dist/index.js:41:20) at Socket.socketErrorListener (_http_client.js:401:9) at Socket.emit (events.js:198:13) at emitErrorNT (internal/streams/destroy.js:91:8) at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) at process._tickCallback (internal/process/next_tick.js:63:19) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14) name: 'RequestError', code: 'ECONNREFUSED' }, GotError: connect ECONNREFUSED 172.18.0.2:5984
rest-on-couch-import_1     |     at onError (/rest-on-couch-source/node_modules/got/dist/source/request-as-event-emitter.js:136:29)
rest-on-couch-import_1     |     at ClientRequest.request.on.error (/rest-on-couch-source/node_modules/got/dist/source/request-as-event-emitter.js:153:17)
rest-on-couch-import_1     |     at ClientRequest.emit (events.js:203:15)
rest-on-couch-import_1     |     at ClientRequest.origin.emit.args (/rest-on-couch-source/node_modules/@szmarczak/http-timer/dist/index.js:41:20)
rest-on-couch-import_1     |     at Socket.socketErrorListener (_http_client.js:401:9)
rest-on-couch-import_1     |     at Socket.emit (events.js:198:13)
rest-on-couch-import_1     |     at emitErrorNT (internal/streams/destroy.js:91:8)
rest-on-couch-import_1     |     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
rest-on-couch-import_1     |     at process._tickCallback (internal/process/next_tick.js:63:19)
rest-on-couch-import_1     |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
rest-on-couch-import_1     | 2020-06-16T08:34:29.617Z couch:debug (bin:import) process file /data/tga-i171i3/to_process/patiny_test_TGA.csv
rest-on-couch-import_1     | 2020-06-16T08:34:29.619Z couch:debug (import) import /data/tga-i171i3/to_process/patiny_test_TGA.csv (eln, tgai171i3)
rest-on-couch-import_1     | 2020-06-16T08:34:29.828Z couch:debug (main:entry) createEntry (id: test,TGA, user: [email protected], kind: sample)
rest-on-couch-import_1     | 2020-06-16T08:34:29.828Z couch:error (bin:import) import error: { GotError: connect ECONNREFUSED 172.18.0.2:5984 at onError (/rest-on-couch-source/node_modules/got/dist/source/request-as-event-emitter.js:136:29) at ClientRequest.request.on.error (/rest-on-couch-source/node_modules/got/dist/source/request-as-event-emitter.js:153:17) at ClientRequest.emit (events.js:203:15) at ClientRequest.origin.emit.args (/rest-on-couch-source/node_modules/@szmarczak/http-timer/dist/index.js:41:20) at Socket.socketErrorListener (_http_client.js:401:9) at Socket.emit (events.js:198:13) at emitErrorNT (internal/streams/destroy.js:91:8) at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) at process._tickCallback (internal/process/next_tick.js:63:19) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14) name: 'RequestError', code: 'ECONNREFUSED' }, GotError: connect ECONNREFUSED 172.18.0.2:5984
@targos
Copy link
Member

targos commented Sep 16, 2021

I think you should setup a health check in docker-compose so that the importation service is not started before CouchDB is ready: https://docs.docker.com/compose/compose-file/compose-file-v2/#healthcheck

@targos targos removed their assignment Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants