CHT 4.0.0 Alpha: ANC Reference App upload docs fails

Hi,

I want to run the ANC Reference App on my local machine using CHT 4.0.0 Alpha.
running cht --url=https://medic:password@localhost --accept-self-signed-certs csv-to-docs upload-docs
the docs are not been uploaded. see below & attached log

tux@T430s:~/cht-core/config/default$ cht --url=https://medic:password@localhost --accept-self-signed-certs csv-to-docs upload-docs
INFO Checking that https://medic:****@localhost/medic/ is available…
(node:1703) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to ‘0’ makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ... to show where the warning was created)
INFO Processing config in default.
INFO Actions:
- csv-to-docs
- upload-docs
INFO Starting action: csv-to-docs…
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/person.clinic.csv …
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/person.district_hospital.csv …
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/person.health_center.csv …
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/place.clinic.csv …
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/place.district_hospital.csv …
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/place.health_center.csv …
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/report.pregnancy.csv …
INFO Processing CSV file: /home/tux/cht-core/config/default/csv/users.csv …
INFO Users csv has been saved
INFO csv-to-docs complete.
INFO Starting action: upload-docs…
WARN This operation will permanently write 25 docs. Are you sure you want to continue?
Are you sure? [y/n]: y
25/25 docs [████████████████████████████████████████████████████████████████████████████████████████████████] 100% 0:00
INFO Summary: 0 of 25 docs uploaded OK. Full report written to: upload-docs.1666438510220.log.json
INFO upload-docs complete.
INFO All actions completedemphasized text

Log contents (.json file upload not allowed)

“ok”: [],
“failed”: {
“00a37402-7bc9-5619-92b0-99ade2056cb2”: “conflict: Document update conflict.”,
“0b465c41-ef04-51a0-89fe-b61b5cf76e4b”: “conflict: Document update conflict.”,
“2112ab72-448a-50bb-a15d-0b19d2927ab7”: “conflict: Document update conflict.”,
“2d21a291-d41c-5289-a735-94a04af127b2”: “conflict: Document update conflict.”,
“2e0ceb06-ced2-5a63-bca0-0283a5aab0e8”: “conflict: Document update conflict.”,
“306a3d95-8e4a-517f-8ae4-c3b391c4d7cb”: “conflict: Document update conflict.”,
“3a44ded6-cc05-53c9-b369-fbc5c4fe8534”: “conflict: Document update conflict.”,
“3a9cecea-8414-5768-9846-474d21b51e91”: “conflict: Document update conflict.”,
“4c3f78b6-54a0-5863-97da-40cd1e407599”: “conflict: Document update conflict.”,
“6295f279-277c-5259-95ef-3edf69a6c901”: “conflict: Document update conflict.”,
“69763819-beff-516a-bf7a-7a178f298fb4”: “conflict: Document update conflict.”,
“745b50c4-9ebe-5515-b0cd-eec1d5438004”: “conflict: Document update conflict.”,
“80b6e34e-7abf-5718-a572-84edbcd4593e”: “conflict: Document update conflict.”,
“8935e9d8-0b2a-5eb0-ae54-ad1377a60097”: “conflict: Document update conflict.”,
“93a84a5d-79b1-5dd2-b3da-7bdf2cc37a15”: “conflict: Document update conflict.”,
“a0c00bd1-8072-528e-8779-a94540183e8b”: “conflict: Document update conflict.”,
“a2d0f8e3-aba6-5bed-b24a-a01fc0978a1b”: “conflict: Document update conflict.”,
“a6931a5c-8dcf-54d5-b1f4-caf9dd1764cf”: “conflict: Document update conflict.”,
“ab5b8b28-8065-546e-a7f8-428ea5bfec02”: “conflict: Document update conflict.”,
“bc199e3f-98ce-5c03-ac8a-a64556e0f5ae”: “conflict: Document update conflict.”,
“bdcceb26-27cb-518c-82e5-774ee521d353”: “conflict: Document update conflict.”,
“c3fcce07-f9eb-5520-8500-8eb4e4d69455”: “conflict: Document update conflict.”,
“f102c70b-b43d-5382-a013-4fe6670d66d8”: “conflict: Document update conflict.”,
“f37cd3f3-c5f6-594d-933d-a631c98b08c0”: “conflict: Document update conflict.”,
“fc721419-87de-5878-a34e-e07e003d0f42”: “conflict: Document update conflict.”
}
}

Hi.

It looks like the docs already exist. Can you check the instance for the docs reporting conflicts already existing?
If yes, I don’t think this has nothing to do with 4.0. This is the behavior you’d see when trying to upload existing docs in any cht version.
If no, can you please share API logs? Is your installation healthy otherwise?

1 Like

Hi @diana,
What are the required columns/variables in report.form_id.csv?
For example in the report.pregnancy.csv, what are the mandory columns/variables that must be included in this csv. Kindly share any example report.form.csv.
Thank you.
Erick

Hi @ewafula,

Here you can get an example report.pregnancy.csv for the default configuration (ANC reference):

In the above example, the columns that are at the beginning can be considered mandatory:

  • content_type
  • reported_date
  • fields.patient_uuid
  • contact._id