Outbound push config

Hi @cliff, compiling and uploading the app settings would work as you expected, but I’m unsure if you’re sharing recent enough logs. What command are you running to get logs?

thanks @diana
i am using these commands to view the medic-sentinel and medic-api logs int he containers

After ssh into the remote server i run

  • docker exec -it medic-os /bin/bash to access a shell in the medic-os containe

then i run less /srv/storage/medic-sentinel/logs/medic-sentinel.log

Ok cool, that’s the right place to get logs, but can you please run tail -n 100 /srv/storage/medic-sentinel/logs/medic-sentinel.log (tail is just an example) to get the last lines in the log instead of the first?

1 Like

thanks @diana , it has generated the recent logs

[2022-09-22 16:16:48] 2022-09-22 16:16:48 WARN: Reminder configuration invalid: { form: '',
[2022-09-22 16:16:48]   text_expression: '',
[2022-09-22 16:16:48]   cron: '',
[2022-09-22 16:16:48]   mute_after_form_for: '',
[2022-09-22 16:16:48]   message: '' } 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task replications started 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task outbound started 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task purging started 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task backgroundCleanup started 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task reminders completed 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task replications completed 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task purging completed 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task dueTasks completed 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Background cleanup batch: 1630 -> 1630 (0) 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task backgroundCleanup completed 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 ERROR: Failed to push 41f05b40-7581-4ee2-8271-7c1deaf9592f to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 ERROR: Failed to push 48e872d2-903b-44cb-93d6-ed348f998fc0 to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 ERROR: Failed to push 5909cf18-924f-45e7-85e1-dd90f8a6dfa0 to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 ERROR: Failed to push 868a0a85-b2d5-447d-aa17-dd391c62ea42 to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:16:48] 2022-09-22 16:16:48 INFO: Task outbound completed 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task dueTasks started 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task reminders started 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 WARN: Reminder configuration invalid: { form: '',
[2022-09-22 16:21:48]   text_expression: '',
[2022-09-22 16:21:48]   cron: '',
[2022-09-22 16:21:48]   mute_after_form_for: '',
[2022-09-22 16:21:48]   message: '' } 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task replications started 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task outbound started 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task purging started 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task backgroundCleanup started 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task reminders completed 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task replications completed 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task purging completed 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Background cleanup batch: 1630 -> 1631 (1) 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task dueTasks completed 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 ERROR: Failed to push 41f05b40-7581-4ee2-8271-7c1deaf9592f to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task backgroundCleanup completed 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 ERROR: Failed to push 48e872d2-903b-44cb-93d6-ed348f998fc0 to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 ERROR: Failed to push 5909cf18-924f-45e7-85e1-dd90f8a6dfa0 to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 ERROR: Failed to push 868a0a85-b2d5-447d-aa17-dd391c62ea42 to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation. 
[2022-09-22 16:21:48] 2022-09-22 16:21:48 INFO: Task outbound completed 
[2022-09-22 16:22:09] 2022-09-22 16:22:09 INFO: saved changes on doc 77c8f55f-8d59-40d3-ac3f-5937fd7c7f9a seq 1632-g1AAAAJmeJyd0DsKwkAQANDVCNp6Aj2B7MfdZCtzE91PlhCiVtZ6ErX3ADaC4iGsBL1J3E_KICQMzMB8XjElAGCURxqM1Xanci1ThOMZtIFKO-oLICdVVRV5JC5r2xgqbBASqOngDyOnNstFLT29lHBGDWNtpdRJy1o6egmyucoQaSutnLSvpauXcEY1NaaltBnYDA62WOzktLfXCJE0TlQn7Ry0u9Ne4V9GYmx0J-0RtI_Tbl7Tdo3wuJP2DZr7mwSgBwPIBaSSN50WP_9lpCg

i see ERROR: Failed to push 868a0a85-b2d5-447d-aa17-dd391c62ea42 to patient triggers enroll workflow in Textit: CouchDB config key 'medic-credentials/rapidpro.app' has not been populated. See the Outbound documentation in the logs . Could this be a result of the key value in the outbound configuration ?
"value_key": "rapidpro.app"

Hi @cliff,

That’s right. Have you added the rapidpro.app credentials?
This is the relevant documentation about how to add these credentials: API to interact with CHT Applications | Community Health Toolkit

1 Like

uumh thanks @diana i had spiked this ,let me look into it

hello @diana i added the rapidpro.app credentials though it says the credentials were not provided

root@e5352b116fea:/srv# tail -n 5 /srv/storage/medic-sentinel/logs/medic-sentinel.log
[2022-09-22 21:31:49] 2022-09-22 21:31:49 ERROR: Failed to push 5092f538-7e88-4ff4-bac8-4e925e0246bd to patient triggers enroll workflow in Textit, server responsed with 403 
[2022-09-22 21:31:49] 2022-09-22 21:31:49 ERROR: Response body: {"detail":"Authentication credentials were not provided."} 
[2022-09-22 21:31:49] 2022-09-22 21:31:49 ERROR: Failed to push c7e4b935-a410-4690-8614-877db77dba0c to patient triggers enroll workflow in Textit, server responsed with 403 
[2022-09-22 21:31:49] 2022-09-22 21:31:49 ERROR: Response body: {"detail":"Authentication credentials were not provided."} 
[2022-09-22 21:31:49] 2022-09-22 21:31:49 INFO: Task outbound completed

Not sure which kind of credentials are needed here because i added the deployments credentials via curl and Fauxton

Hi @cliff

You should have details about required authentication in textit.
value_key is added, as is, as the Authorization header of the request. This means that you should include the Token prefix along with the token itself as the value_key, if those are the texit authorization instructions.

hello @diana

i have added the token authorization key in textit used while POSTing to CHT


as the value_key in outbound config and also added it via Fauxton

 "destination": {
        "base_url": "https://textit.in",
        "auth": {
          "type": "header",
          "name": "Authorization",
          "value_key": "Token 57b30498a5b0aae73f2bd974f850ef4181856378"
        },
        "path": "/api/v2/flow_starts.json"
      },

but kind of facing ERROR: Response body: {"detail":"Authentication credentials were not provided."}

Hi @cliff
From what I understood, you need to add your token as per API to interact with CHT Applications | Community Health Toolkit and then reference it with the value_key in your configuration.

3 Likes

thanks @magp18
I added the token to the medic-credentials as seen below in couch DB


However when i use the /api/v1/credentials endpoint it gives

cliff@cliff-Latitude-5580:~$ curl -X PUT -H "Content-Type: text/plain" https://medic:password@cht.openelis-global.org/api/v1/credentials/Token 57b30498a5b0aae73f2bd974f850ef4181856377 -d 'password1'
{"error":"not_found","reason":"Database does not exist."}
curl: (6) Could not resolve host: 57b30498a5b0aae73f2bd974f850ef4181856377

Hi @cliff

/api/v1/credentials is being added in 4.0, please use the 3.x api section from the documentation for directions: API to interact with CHT Applications | Community Health Toolkit

hello @diana
The api token number in textit had changed which worked on changing to the same token in CHT.
Thanks much for your assistance always :+1:

3 Likes