cliff
September 19, 2022, 6:11pm
1
Hello @jkuester @diana
I am configuring an outbound push to be sent to textit to start a flow whenever a patient is registered in CHT,i marked "mark_for_outbound": true
in the transitions of the app_settings.json
file, here is the configuration .
"outbound": {
"patient triggers enroll workflow in Textit": {
"relevant_to": "doc.type === 'person' && doc.aka",
"destination": {
"base_url": "https://rapidpro.app.medicmobile.org",
"auth": {
"type": "header",
"name": "Authorization",
"value_key": "rapidpro.app"
},
"path": "/api/v2/flow_starts.json"
},
"mapping": {
"flow": {
"expr": "'e16b6f2f-168b-4690-a52d-a27f54f88fc6'"
},
"urns": {
"expr": "['tel:' + doc.phone]"
}
}
}
},
T
cliff
September 19, 2022, 6:13pm
2
How do i access the outbound logs to confirm that the feature works a fine because i dont see the patient going through the flow in textit upon being registered
diana
September 19, 2022, 6:26pm
3
Hi @cliff
Both API and Sentinel logs should contain information about outbound pushes.
Can you please try to create a matching doc and check API logs? If a push fails, Sentinel will attempt to send it again after 5 minutes, so you should be able to see information about initially failed outbound pushes in Sentinel logs.
cliff
September 19, 2022, 6:40pm
4
thanks @diana , though not sure how this is done
diana
September 19, 2022, 6:45pm
5
Hi @cliff
How did you deploy the CHT?
cliff
September 19, 2022, 6:47pm
6
thanks @diana ,i am testing against a remote server
diana
September 19, 2022, 8:07pm
7
Do you have access to the remote server’s logs?
cliff
September 19, 2022, 8:29pm
8
i don’t have access to the remote server logs
diana
September 19, 2022, 8:30pm
9
Can you then please try your config on a server that you do have access to fully and check if outbound works as expected?
1 Like
cliff
September 20, 2022, 8:09am
11
hello @diana ,
I have setting up a local dev environment for core using docker but the docker compose file genarated from
curl -o docker-compose.yml https://raw.githubusercontent.com/medic/cht-core/master/docker-compose.yml
returns 404: Not Found
Could i be missing something here?
diana
September 21, 2022, 6:49am
12
Hi @cliff
We’re in the process of changing the architecture around how CHT 4.0 is deployed, and that file was removed from the main branch. Can you please use the old docker compose file from a previous release, like: cht-core/docker-compose.yml at 3.17.x · medic/cht-core · GitHub
1 Like
cliff
September 21, 2022, 7:29am
13
thanks @diana , let me use that
cliff
September 22, 2022, 6:56am
14
diana:
Both API and Sentinel logs should contain information about outbound pushes.
Can you please try to create a matching doc and check API logs? If a push fails, Sentinel will attempt to send it again after 5 minutes, so you should be able to see information about initially failed outbound pushes in Sentinel logs.
hello @diana i got access to the sentinel logs
2022-08-02 08:53:42] Node Environment Options: '--max_old_space_size=8192'
[2022-08-02 08:53:42] Node Version: 8.11.4 in production mode
[2022-08-02 08:53:42] COUCH_URL http://medic-sentinel:3bf9a36b8f936f63@haproxy:5984/medic
[2022-08-02 08:53:42] COUCH_NODE_NAME couchdb@127.0.0.1
[2022-08-02 08:53:42] CouchDB Version: 2.3.1
[2022-08-02 08:53:42] 2022-08-02 08:53:42 ESC[32mINFOESC[39m: Waiting for API to be ready...
[2022-08-02 08:53:52] 2022-08-02 08:53:52 ESC[32mINFOESC[39m: Api is ready: {"ready":true,"handler":"medic-api","version":"0.1.0","detail":"All required services are running normally"}
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_clinics"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "self_report"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "registration"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "accept_patient_reports"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "accept_case_reports"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "generate_shortcode_on_contacts"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: Loading transition "generate_patient_id_on_people"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: "generate_patient_id_on_people" transition is deprecated. Please use "generate_shortcode_on_contacts" transition instead.
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "default_responses"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_sent_by"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_sent_forms"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: Loading transition "death_reporting"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "conditional_alerts"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "multi_report_alerts"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_notifications"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_scheduled_reports"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "resolve_pending"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "muting"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "mark_for_outbound"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: transitions: processing enabled
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: startup complete.
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: checking schedule again in 4 minutes
[2022-08-02 08:53:54] 2022-08-02 08:53:54 ESC[32mINFOESC[39m: saving tombstone for horti-upgrade
[2022-08-02 08:58:00] 2022-08-02 08:58:00 ESC[32mINFOESC[39m: checking schedule again in 5 minutes
[2022-08-02 09:03:00] 2022-08-02 09:03:00 ESC[32mINFOESC[39m: checking schedule again in 5 minutes
Session terminated, terminating shell... ...terminated.
[2022-08-02 09:03:56] 2022-08-02 09:03:56 ESC[32mINFOESC[39m: Running server checks<E2><80><A6>
[2022-08-02 09:03:56] Node Environment Options: '--max_old_space_size=8192'
[2022-08-02 09:03:56] Node Version: 8.11.4 in production mode
[2022-08-02 09:03:56] COUCH_URL http://haproxy:5984/medic
[2022-08-02 09:03:56] COUCH_NODE_NAME couchdb@127.0.0.1
[2022-08-02 09:03:56] Environment variable "COUCH_NODE_NAME" matches server "couchdb@127.0.0.1"
[2022-08-02 09:03:56] CouchDB Version: 2.3.1
[2022-08-02 09:03:56] 2022-08-02 09:03:56 ESC[32mINFOESC[39m: Waiting for API to be ready...
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Api is ready: {"ready":true,"handler":"medic-api","version":"0.1.0","detail":"All required services are running normally"}
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_clinics"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "self_report"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "registration"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "accept_patient_reports"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "accept_case_reports"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "generate_shortcode_on_contacts"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Loading transition "generate_patient_id_on_people"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: generate_patient_id_on_people transition is deprecated since 3.8.x. Please use "generate_shortcode_on_contacts" transition instead.
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "default_responses"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_sent_by"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_sent_forms"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Loading transition "death_reporting"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "conditional_alerts"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "multi_report_alerts"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_notifications"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_scheduled_reports"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "resolve_pending"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "muting"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "mark_for_outbound"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Task dueTasks started
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Task reminders started
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Task replications started
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Task outbound started
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Task purging started
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Task backgroundCleanup started
:
However when i keep on pressing enter to scroll down the logs i came across
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task outbound started
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task purging started
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task backgroundCleanup started
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task reminders completed
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task replications completed
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task outbound completed
diana
September 22, 2022, 8:29am
15
Hi @cliff
From the Sentinel logs it looks it it had no outbound tasks to execute.
Can you create a document that should be pushed via outbound?
cliff
September 22, 2022, 9:25am
16
hello @diana
According to the configuration below
"outbound": {
"patient triggers enroll workflow in Textit": {
"relevant_to": "doc.type === 'person' && doc.docket",
"destination": {
"base_url": "https://rapidpro.app.medicmobile.org",
"auth": {
"type": "header",
"name": "Authorization",
"value_key": "rapidpro.app"
},
"path": "/api/v2/flow_starts.json"
},
"mapping": {
"flow": {
"expr": "'e16b6f2f-168b-4690-a52d-a27f54f88fc6'"
},
"urns": {
"expr": "['tel:' + doc.phone]"
}
}
}
},
Whenever a patient registration form is filled out with doc.docket
field and type === person
it should trigger a textit enrollment flow . I have created a document and do check to confirm that its in the db but the sentinel logs don’t show whether the outbound has properly been executed on not as seen below
[2022-08-02 08:53:42] Node Environment Options: '--max_old_space_size=8192'
[2022-08-02 08:53:42] Node Version: 8.11.4 in production mode
[2022-08-02 08:53:42] COUCH_URL http://medic-sentinel:3bf9a36b8f936f63@haproxy:5984/medic
[2022-08-02 08:53:42] COUCH_NODE_NAME couchdb@127.0.0.1
[2022-08-02 08:53:42] CouchDB Version: 2.3.1
[2022-08-02 08:53:42] 2022-08-02 08:53:42 ESC[32mINFOESC[39m: Waiting for API to be ready...
[2022-08-02 08:53:52] 2022-08-02 08:53:52 ESC[32mINFOESC[39m: Api is ready: {"ready":true,"handler":"medic-api","version":"0.1.0","detail":"All required services are running normally"}
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_clinics"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "self_report"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "registration"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "accept_patient_reports"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "accept_case_reports"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "generate_shortcode_on_contacts"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: Loading transition "generate_patient_id_on_people"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: "generate_patient_id_on_people" transition is deprecated. Please use "generate_shortcode_on_contacts" transition instead.
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "default_responses"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_sent_by"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_sent_forms"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: Loading transition "death_reporting"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "conditional_alerts"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "multi_report_alerts"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_notifications"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "update_scheduled_reports"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "resolve_pending"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "muting"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[33mWARNESC[39m: Disabled transition "mark_for_outbound"
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: transitions: processing enabled
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: startup complete.
[2022-08-02 08:53:53] 2022-08-02 08:53:53 ESC[32mINFOESC[39m: checking schedule again in 4 minutes
[2022-08-02 08:53:54] 2022-08-02 08:53:54 ESC[32mINFOESC[39m: saving tombstone for horti-upgrade
[2022-08-02 08:58:00] 2022-08-02 08:58:00 ESC[32mINFOESC[39m: checking schedule again in 5 minutes
[2022-08-02 09:03:00] 2022-08-02 09:03:00 ESC[32mINFOESC[39m: checking schedule again in 5 minutes
Session terminated, terminating shell... ...terminated.
[2022-08-02 09:03:56] 2022-08-02 09:03:56 ESC[32mINFOESC[39m: Running server checks<E2><80><A6>
[2022-08-02 09:03:56] Node Environment Options: '--max_old_space_size=8192'
[2022-08-02 09:03:56] Node Version: 8.11.4 in production mode
[2022-08-02 09:03:56] COUCH_URL http://haproxy:5984/medic
[2022-08-02 09:03:56] COUCH_NODE_NAME couchdb@127.0.0.1
[2022-08-02 09:03:56] Environment variable "COUCH_NODE_NAME" matches server "couchdb@127.0.0.1"
[2022-08-02 09:03:56] CouchDB Version: 2.3.1
[2022-08-02 09:03:56] 2022-08-02 09:03:56 ESC[32mINFOESC[39m: Waiting for API to be ready...
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Api is ready: {"ready":true,"handler":"medic-api","version":"0.1.0","detail":"All required services are running normally"}
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_clinics"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "self_report"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "registration"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "accept_patient_reports"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "accept_case_reports"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "generate_shortcode_on_contacts"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[32mINFOESC[39m: Loading transition "generate_patient_id_on_people"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: generate_patient_id_on_people transition is deprecated since 3.8.x. Please use "generate_shortcode_on_contacts" transition instead.
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "default_responses"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_sent_by"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "update_sent_forms"
/srv/storage/medic-sentinel/logs/medic-sentinel.log
when you press enter down the logs you only get
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task outbound started
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task purging started
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task backgroundCleanup started
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task reminders completed
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task replications completed
[2022-08-02 09:09:06] 2022-08-02 09:09:06 ESC[32mINFOESC[39m: Task outbound completed
diana
September 22, 2022, 11:16am
17
cliff:
mark_for_outbound
Please enable this transition mark_for_outbound
.
cliff
September 22, 2022, 11:33am
18
hello @diana
its was enabled
"transitions": {
"default_responses": true,
"update_clinics": true,
"accept_patient_reports": true,
"conditional_alerts": true,
"update_sent_by": false,
"registration": true,
"update_scheduled_reports": false,
"multi_report_alerts": false,
"update_sent_forms": false,
"generate_patient_id_on_people": true,
"death_reporting": true,
"resolve_pending": false,
"mark_for_outbound": true
},
"outbound": {
"patient triggers enroll workflow in Textit": {
"relevant_to": "doc.type === 'person' && doc.docket",
"destination": {
"base_url": "https://rapidpro.app.medicmobile.org",
"auth": {
"type": "header",
"name": "Authorization",
"value_key": "rapidpro.app"
},
"path": "/api/v2/flow_starts.json"
},
"mapping": {
"flow": {
"expr": "'e16b6f2f-168b-4690-a52d-a27f54f88fc6'"
},
"urns": {
"expr": "['tel:' + doc.phone]"
}
}
}
},
diana
September 22, 2022, 11:38am
19
Interesting, because in your logs it appears as disabled:
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "resolve_pending"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "muting"
[2022-08-02 09:04:06] 2022-08-02 09:04:06 ESC[33mWARNESC[39m: Disabled transition "mark_for_outbound"
Can you please double check server settings? These logs looks really old (from August). Can you please check more recent logs?
cliff
September 22, 2022, 11:53am
20
thanks @diana ,
this is strange, my assumption was that when i compile and upload the app settings they override all the settings in the server that have been there at that time .
May i restart the containers ?