Troubleshooting medic API that's failing

Hello All

I am trying to understand why medic-api fails during set up.(using the formal documentation)

Logs & Screenshot
open ports
Screenshot 2021-11-29 at 17.45.30

Logs error-ssl.log

Browser page

I have tried :

  • Creating images of working containers and using these images to build new containers

  • Starting the medic-api within container

Environment

  • Browser: Chrome
  • Client platform: MacOS
  • App: api
  • Version: 3.7.0, 3.9.0

Hi @atria

Could you please check medic-api logs to see if there’s an obvious error there? You could refer to How do I get the medic-api logs when using Docker? for information about how to get logs.

Thanks!

@atria - I believe you’re following the local setup steps which have you running docker compose to startup the CHT. Medic has published a docker compose helper which might solve your issues.

@diana’s suggestion about the logs will still apply if you get stuck after trying the helper script.

1 Like

Hi @diana

There is nothing in the medic-api logs just the medic-core logs

@diana I do have logs for an instance where the API is failing after a server restart

[2021-11-30 10:37:14] [message]: ‘Child process errored attempting to transform xml’ }
[2021-11-30 10:37:16] Node Environment Options: ‘–max_old_space_size=20000’
[2021-11-30 10:37:16] Node Version: 8.11.4 in production mode
[2021-11-30 10:37:16] COUCH_URL http://medic-api:@localhost:5984/medic
[2021-11-30 10:37:16] COUCH_NODE_NAME couchdb@localhost
[2021-11-30 10:37:16] CouchDB Version: 2.3.0
[2021-11-30 10:37:17] 2021-11-30 10:37:17 INFO: Extracting ddoc…
[2021-11-30 10:37:17] 2021-11-30 10:37:17 INFO: DDoc extraction completed successfully
[2021-11-30 10:37:17] 2021-11-30 10:37:17 INFO: Extracting resources…
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Extracting resources completed successfully
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Extracting initial documents…
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Extracting initial documents completed successfully
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Loading configuration…
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “update_clinics”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “registration”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “accept_patient_reports”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “generate_patient_id_on_people”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “default_responses”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “update_sent_by”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “update_sent_forms”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Loading transition “death_reporting”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “conditional_alerts”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Loading transition “multi_report_alerts”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Skipping asynchronous transition “multi_report_alerts”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “update_notifications”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “update_scheduled_reports”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “resolve_pending”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Loading transition “muting”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Skipping asynchronous transition “muting”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 WARN: Disabled transition “mark_for_outbound”
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Configuration loaded successfully
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Merging translations…
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Translations merged successfully
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Running db migrations…
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Database migrations completed successfully
[2021-11-30 10:37:18] 2021-11-30 10:37:18 INFO: Updating xforms…
[2021-11-30 10:37:18] 2021-11-30 10:37:18 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:18] at _errnoException (util.js:992:11)
[2021-11-30 10:37:18] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:18] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:18] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:18] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:18] 2021-11-30 10:37:18 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:18] at _errnoException (util.js:992:11)
[2021-11-30 10:37:18] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:18] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:18] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:18] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:18] 2021-11-30 10:37:18 ERROR: Fatal error initialising medic-api
[2021-11-30 10:37:18] 2021-11-30 10:37:18 ERROR: { Error: Child process errored attempting to transform xml
[2021-11-30 10:37:18] at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)
[2021-11-30 10:37:18] at emitOne (events.js:116:13)
[2021-11-30 10:37:18] at ChildProcess.emit (events.js:211:7)
[2021-11-30 10:37:18] at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
[2021-11-30 10:37:18] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:18] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:18] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:18] [stack]: ‘Error: Child process errored attempting to transform xml\n at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)\n at emitOne (events.js:116:13)\n at ChildProcess.emit (events.js:211:7)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)\n at onErrorNT (internal/child_process.js:372:16)\n at _combinedTickCallback (internal/process/next_tick.js:138:11)\n at process._tickCallback (internal/process/next_tick.js:180:9)’,
[2021-11-30 10:37:18] [message]: ‘Child process errored attempting to transform xml’ }
[2021-11-30 10:37:20] Node Environment Options: ‘–max_old_space_size=20000’
[2021-11-30 10:37:20] Node Version: 8.11.4 in production mode
[2021-11-30 10:37:20] COUCH_URL http://medic-api:
@localhost:5984/medic
[2021-11-30 10:37:20] COUCH_NODE_NAME couchdb@localhost
[2021-11-30 10:37:20] CouchDB Version: 2.3.0
[2021-11-30 10:37:20] 2021-11-30 10:37:20 INFO: Extracting ddoc…
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: DDoc extraction completed successfully
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Extracting resources…
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Extracting resources completed successfully
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Extracting initial documents…
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Extracting initial documents completed successfully
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Loading configuration…
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “update_clinics”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “registration”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “accept_patient_reports”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “generate_patient_id_on_people”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “default_responses”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “update_sent_by”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “update_sent_forms”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Loading transition “death_reporting”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “conditional_alerts”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Loading transition “multi_report_alerts”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Skipping asynchronous transition “multi_report_alerts”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “update_notifications”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “update_scheduled_reports”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “resolve_pending”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Loading transition “muting”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Skipping asynchronous transition “muting”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 WARN: Disabled transition “mark_for_outbound”
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Configuration loaded successfully
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Merging translations…
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Translations merged successfully
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Running db migrations…
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Database migrations completed successfully
[2021-11-30 10:37:21] 2021-11-30 10:37:21 INFO: Updating xforms…
[2021-11-30 10:37:21] 2021-11-30 10:37:21 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:21] at _errnoException (util.js:992:11)
[2021-11-30 10:37:21] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:21] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:21] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:21] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:21] 2021-11-30 10:37:21 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:21] at _errnoException (util.js:992:11)
[2021-11-30 10:37:21] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:21] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:21] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:21] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:21] 2021-11-30 10:37:21 ERROR: Fatal error initialising medic-api
[2021-11-30 10:37:21] 2021-11-30 10:37:21 ERROR: { Error: Child process errored attempting to transform xml
[2021-11-30 10:37:21] at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)
[2021-11-30 10:37:21] at emitOne (events.js:116:13)
[2021-11-30 10:37:21] at ChildProcess.emit (events.js:211:7)
[2021-11-30 10:37:21] at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
[2021-11-30 10:37:21] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:21] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:21] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:21] [stack]: ‘Error: Child process errored attempting to transform xml\n at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)\n at emitOne (events.js:116:13)\n at ChildProcess.emit (events.js:211:7)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)\n at onErrorNT (internal/child_process.js:372:16)\n at _combinedTickCallback (internal/process/next_tick.js:138:11)\n at process._tickCallback (internal/process/next_tick.js:180:9)’,
[2021-11-30 10:37:21] [message]: ‘Child process errored attempting to transform xml’ }
[2021-11-30 10:37:24] Node Environment Options: ‘–max_old_space_size=20000’
[2021-11-30 10:37:24] Node Version: 8.11.4 in production mode
[2021-11-30 10:37:24] COUCH_URL http://medic-api:@localhost:5984/medic
[2021-11-30 10:37:24] COUCH_NODE_NAME couchdb@localhost
[2021-11-30 10:37:24] CouchDB Version: 2.3.0
[2021-11-30 10:37:24] 2021-11-30 10:37:24 INFO: Extracting ddoc…
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: DDoc extraction completed successfully
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Extracting resources…
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Extracting resources completed successfully
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Extracting initial documents…
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Extracting initial documents completed successfully
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Loading configuration…
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “update_clinics”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “registration”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “accept_patient_reports”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “generate_patient_id_on_people”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “default_responses”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “update_sent_by”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “update_sent_forms”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Loading transition “death_reporting”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “conditional_alerts”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Loading transition “multi_report_alerts”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Skipping asynchronous transition “multi_report_alerts”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “update_notifications”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “update_scheduled_reports”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “resolve_pending”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Loading transition “muting”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Skipping asynchronous transition “muting”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 WARN: Disabled transition “mark_for_outbound”
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Configuration loaded successfully
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Merging translations…
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Translations merged successfully
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Running db migrations…
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Database migrations completed successfully
[2021-11-30 10:37:25] 2021-11-30 10:37:25 INFO: Updating xforms…
[2021-11-30 10:37:25] 2021-11-30 10:37:25 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:25] at _errnoException (util.js:992:11)
[2021-11-30 10:37:25] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:25] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:25] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:25] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:25] 2021-11-30 10:37:25 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:25] at _errnoException (util.js:992:11)
[2021-11-30 10:37:25] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:25] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:25] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:25] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:25] 2021-11-30 10:37:25 ERROR: Fatal error initialising medic-api
[2021-11-30 10:37:25] 2021-11-30 10:37:25 ERROR: { Error: Child process errored attempting to transform xml
[2021-11-30 10:37:25] at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)
[2021-11-30 10:37:25] at emitOne (events.js:116:13)
[2021-11-30 10:37:25] at ChildProcess.emit (events.js:211:7)
[2021-11-30 10:37:25] at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
[2021-11-30 10:37:25] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:25] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:25] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:25] [stack]: ‘Error: Child process errored attempting to transform xml\n at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)\n at emitOne (events.js:116:13)\n at ChildProcess.emit (events.js:211:7)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)\n at onErrorNT (internal/child_process.js:372:16)\n at _combinedTickCallback (internal/process/next_tick.js:138:11)\n at process._tickCallback (internal/process/next_tick.js:180:9)’,
[2021-11-30 10:37:25] [message]: ‘Child process errored attempting to transform xml’ }
[2021-11-30 10:37:27] Node Environment Options: ‘–max_old_space_size=20000’
[2021-11-30 10:37:27] Node Version: 8.11.4 in production mode
[2021-11-30 10:37:27] COUCH_URL http://medic-api:
@localhost:5984/medic
[2021-11-30 10:37:27] COUCH_NODE_NAME couchdb@localhost
[2021-11-30 10:37:27] CouchDB Version: 2.3.0
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Extracting ddoc…
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: DDoc extraction completed successfully
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Extracting resources…
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Extracting resources completed successfully
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Extracting initial documents…
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Extracting initial documents completed successfully
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Loading configuration…
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “update_clinics”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “registration”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “accept_patient_reports”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “generate_patient_id_on_people”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “default_responses”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “update_sent_by”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “update_sent_forms”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Loading transition “death_reporting”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “conditional_alerts”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Loading transition “multi_report_alerts”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Skipping asynchronous transition “multi_report_alerts”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “update_notifications”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “update_scheduled_reports”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “resolve_pending”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Loading transition “muting”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Skipping asynchronous transition “muting”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 WARN: Disabled transition “mark_for_outbound”
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Configuration loaded successfully
[2021-11-30 10:37:28] 2021-11-30 10:37:28 INFO: Merging translations…
[2021-11-30 10:37:29] 2021-11-30 10:37:29 INFO: Translations merged successfully
[2021-11-30 10:37:29] 2021-11-30 10:37:29 INFO: Running db migrations…
[2021-11-30 10:37:29] 2021-11-30 10:37:29 INFO: Database migrations completed successfully
[2021-11-30 10:37:29] 2021-11-30 10:37:29 INFO: Updating xforms…
[2021-11-30 10:37:29] 2021-11-30 10:37:29 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:29] at _errnoException (util.js:992:11)
[2021-11-30 10:37:29] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:29] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:29] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:29] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:29] 2021-11-30 10:37:29 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:29] at _errnoException (util.js:992:11)
[2021-11-30 10:37:29] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:29] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:29] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:29] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:29] 2021-11-30 10:37:29 ERROR: Fatal error initialising medic-api
[2021-11-30 10:37:29] 2021-11-30 10:37:29 ERROR: { Error: Child process errored attempting to transform xml
[2021-11-30 10:37:29] at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)
[2021-11-30 10:37:29] at emitOne (events.js:116:13)
[2021-11-30 10:37:29] at ChildProcess.emit (events.js:211:7)
[2021-11-30 10:37:29] at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
[2021-11-30 10:37:29] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:29] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:29] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:29] [stack]: ‘Error: Child process errored attempting to transform xml\n at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)\n at emitOne (events.js:116:13)\n at ChildProcess.emit (events.js:211:7)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)\n at onErrorNT (internal/child_process.js:372:16)\n at _combinedTickCallback (internal/process/next_tick.js:138:11)\n at process._tickCallback (internal/process/next_tick.js:180:9)’,
[2021-11-30 10:37:29] [message]: ‘Child process errored attempting to transform xml’ }
[2021-11-30 10:37:31] Node Environment Options: ‘–max_old_space_size=20000’
[2021-11-30 10:37:31] Node Version: 8.11.4 in production mode
[2021-11-30 10:37:31] COUCH_URL http://medic-api:
@localhost:5984/medic
[2021-11-30 10:37:31] COUCH_NODE_NAME couchdb@localhost
[2021-11-30 10:37:31] CouchDB Version: 2.3.0
[2021-11-30 10:37:31] 2021-11-30 10:37:31 INFO: Extracting ddoc…
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: DDoc extraction completed successfully
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Extracting resources…
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Extracting resources completed successfully
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Extracting initial documents…
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Extracting initial documents completed successfully
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Loading configuration…
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “update_clinics”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “registration”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “accept_patient_reports”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “generate_patient_id_on_people”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “default_responses”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “update_sent_by”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “update_sent_forms”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Loading transition “death_reporting”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “conditional_alerts”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Loading transition “multi_report_alerts”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Skipping asynchronous transition “multi_report_alerts”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “update_notifications”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “update_scheduled_reports”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “resolve_pending”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Loading transition “muting”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Skipping asynchronous transition “muting”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 WARN: Disabled transition “mark_for_outbound”
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Configuration loaded successfully
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Merging translations…
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Translations merged successfully
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Running db migrations…
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Database migrations completed successfully
[2021-11-30 10:37:32] 2021-11-30 10:37:32 INFO: Updating xforms…
[2021-11-30 10:37:32] 2021-11-30 10:37:32 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:32] at _errnoException (util.js:992:11)
[2021-11-30 10:37:32] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:32] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:32] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:32] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:32] 2021-11-30 10:37:32 ERROR: spawn xsltproc ENOENT Error: spawn xsltproc ENOENT
[2021-11-30 10:37:32] at _errnoException (util.js:992:11)
[2021-11-30 10:37:32] at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
[2021-11-30 10:37:32] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:32] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:32] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:32] 2021-11-30 10:37:32 ERROR: Fatal error initialising medic-api
[2021-11-30 10:37:32] 2021-11-30 10:37:32 ERROR: { Error: Child process errored attempting to transform xml
[2021-11-30 10:37:32] at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)
[2021-11-30 10:37:32] at emitOne (events.js:116:13)
[2021-11-30 10:37:32] at ChildProcess.emit (events.js:211:7)
[2021-11-30 10:37:32] at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
[2021-11-30 10:37:32] at onErrorNT (internal/child_process.js:372:16)
[2021-11-30 10:37:32] at _combinedTickCallback (internal/process/next_tick.js:138:11)
[2021-11-30 10:37:32] at process._tickCallback (internal/process/next_tick.js:180:9)
[2021-11-30 10:37:32] [stack]: ‘Error: Child process errored attempting to transform xml\n at ChildProcess.xsltproc.on.err (/srv/software/medic-api/md5-COhU+vzfKxP6IcVH7UFAQ==/src/services/generate-xform.js:43:21)\n at emitOne (events.js:116:13)\n at ChildProcess.emit (events.js:211:7)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)\n at onErrorNT (internal/child_process.js:372:16)\n at _combinedTickCallback (internal/process/next_tick.js:138:11)\n at process._tickCallback (internal/process/next_tick.js:180:9)’,
[2021-11-30 10:37:32] [message]: ‘Child process errored attempting to transform xml’ }
[2021-11-30 10:37:35] Node Environment Options: ‘–max_old_space_size=20000’
[2021-11-30 10:37:35] Node Version: 8.11.4 in production mode
[2021-11-30 10:37:35] COUCH_URL http://medic-api:
*****@localhost:5984/medic
[2021-11-30 10:37:35] COUCH_NODE_NAME couchdb@localhost
[2021-11-30 10:37:35] CouchDB Version: 2.3.0
[2021-11-30 10:37:35] 2021-11-30 10:37:35 INFO: Extracting ddoc…
[2021-11-30 10:37:36] 2021-11-30 10:37:36 INFO: DDoc extraction completed successfully
[2021-11-30 10:37:36] 2021-11-30 10:37:36 INFO: Extracting resources…
[2021-11-30 10:37:36] 2021-11-30 10:37:36 INFO: Extracting resources completed successfully
[2021-11-30 10:37:36] 2021-11-30 10:37:36 INFO: Extracting initial documents…
[2021-11-30 10:37:36] 2021-11-30 10:37:36 INFO: Extracting initial documents completed successfully
[2021-11-30 10:37:36] 2021-11-30 10:37:36 INFO: Loading configuration…
[2021-11-30 10:37:36] 2021-11-30 10:37:36 WARN: Disabled transition "update_clinic

It seems that your installation is missing a required dependency xsltproc, which is used to generate xmls for forms.

I do have logs for an instance where the API is failing after a server restart

It’s not clear if these are logs from the same instance being discussed in the original post or not.

There is nothing in the medic-api logs just the medic-core logs

If API never started in this case, I suggest checking the links that @mrjones has provided.