jembi / openhim-core-js

The Open Health Information Mediator core component. OpenHIM Support: Post your query on OpenHIE Discourse using the #openhim tag https://discourse.ohie.org/
http://openhim.org
Mozilla Public License 2.0
70 stars 72 forks source link

middleware/router.js: TypeError: Cannot read property 'key' of null #1203

Open euanmillar opened 1 year ago

euanmillar commented 1 year ago

Hi,

I hope you are all doing well. We have been refactoring our database clear and restore process at OpenCRVS and we have encountered this strange OpenHIM error. It occurs after we clear our database and then seed it using APIs. Strangely, if we try the command a second time, it always works. Its a bit of a hacky solution causing some confusing output to the user so I was wondering if someone could take a look at what might be causing it please?:

"msg":"request to http://localhost:5001/fhir/Practitioner failed, reason: socket hang up"

[1] openhim-core_1 | events.js:377 [1] openhim-core_1 | throw er; // Unhandled 'error' event [1] openhim-core_1 | ^ [1] openhim-core_1 | [1] openhim-core_1 | TypeError: Cannot read property 'key' of null [1] openhim-core_1 | at /usr/src/app/lib/middleware/router.js:245:23 [1] openhim-core_1 | at handler (/usr/src/app/lib/utils.js:91:14) [1] openhim-core_1 | at /usr/src/app/node_modules/mongoose/lib/model.js:5074:18

Kind regards,

Euan

euanmillar commented 1 year ago

FYI, we are using this docker image: jembi/openhim-core:7