Upload-contact-forms command fails with original CHT forms

App version 3.14

Dear all,

I wanted to do some minor modification to the person-create.xlsx form.
I than executed the command

cht --local convert-contact-forms upload-contact-forms

The xlsx forms get converted to xml with success, but the second step (uploading the forms into the app) fails for all contact forms.

The error message is:

ERROR Error found while validating .... Validation response: Error: connect ECONNREFUSED
ERROR Error: One or more forms appears to have errors found by the API validation endpoint.
    at module.exports (/usr/local/lib/node_modules/cht-conf/src/lib/validate-forms.js:51:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)

I am not sure what to do with it. The forms itself are well formatted (most of them are unchanged)

Any hints?

Hi @raf ,

I think that first error message is the relevant one. cht-conf is attempting to connect to cht-core to test that the forms are valid. Even if you managed to skip through validation it would still fail to upload if it can’t reach the server.

Using the --local option tells cht-conf to use the URL in your COUCH_URL environment variable. Check if that’s set, and if it is, ensure that it’s set correctly including admin credentials. If it’s not set correctly, you can use --url=... to specify the path and credentials to your CHT instance, as in this documentation.

Let me know if that doesn’t work!

Have been working on forms for a Community Testing project with configurable hierarchy, from HH members to HH to CHVs to CUs to CHAs etc and have the same challenge now, form conversion complete, validation fails with the following two errors:
“WARN Form validation endpoint not found in your version of CHT Core, no form will be checked before push”

“ERROR Form at /var/community-testing-config-test/forms/contact/house_hold-create.xml contains invalid XPath expressions (absolute or relative paths that refer to a non-existant node): ERROR - relevant for /data/insurance/latrine contains […/house_member”

Will appreciate any insights, thank you

Hi @oyierphil

You can skip form validation by passing the - -skip-validate flag as part of the cht command.


@munjoma, this is noted. Will skip and test the forms, then find out the cause of validation errors so that I correct before project rollout

1 Like

@oyierphil This is a newly added feature of cht-conf where it does additional validation to catch form errors early, in this case, that your latrine field has a relevant that references an xml element that doesn’t exist. If you think this is incorrect, or the message could be improved in some way, let me know.

1 Like

@gareth, I skipped validation and completed form conversion, there was no update on the app though after the conversion, some homework for the weekend…

I have managed to use skip validation for now on the XPath errors, but the app doesn’t load forms for places and contacts as I expected. Was hoping to have high-level place on the base-settings file: National office - County Office - Sub County Office - Link Facility - Community Units - etc. Instead, the app starts from New District - Health Facility, which isn’t in my hierarchy or config.

I have emptied contents of the messages-en translation config file and currently empty, I get the same landing page, New District - Health Facility etc, not sure where it is coming from

Will really appreciate your insights on what we are missing so that we conclude the process and move to the field, best

Hi @oyierphil

I believe this was already partially addressed in another thread: Translation for Community Testing App - #13 by diana

Or is this pertaining to a completely separate issue?

@diana, yes, we are currently following on the same issue with diana to identify possible causes error, thanks

This seems to be the more appropriate thread to debug errors in uploading contact forms, than the other thread which is about translations. Would you mind if we continue the conversation about forms here?

I’m going to link to your reply in the other post to keep information concentrated here:

@diana, no worries, appreciate the support, currently looking at the type, name and calculation fields in the forms to see if there are errors

Thanks @oyierphil

From the error in your image, I think your contact form is misconfigured.
Can you please share the contents of the form so I can see the way the fields are set up?

@diana, I have shared a contact form for the CH_Supervisor

I have logged in to the app as a CHW, and I can see targets, different from my target config file, trying to find out why it doesn’t load my configs, including targets

I have handled most of the xPath errors and form conversion is complete, only one error on one form, Hosehold create and edit still persists, will figure it out tomorrow morning since conversions isn’t complete for this specific form, throws the error ‘Unknown question type’.
type name choices
select_one health_insurance health_insurance yes/no

I have checked App Management Console of the app and I can see the App forms, still puzzled why the same can’t load, even after uploading and converting both the contact and forms? I still get a blank page with no option for creating any place with the message, No people found

Hi @oyierphil

Thanks for the update.
Please let me know if you still have trouble with contacts loading after you fix this last form, or if you have trouble fixing it.

I have sorted out the error with the form, successfully converted and uploaded both contact and app forms now, still can’t create any place as admin. It shows no form, no activity but with a blank screen reading No person selected, No people found
I have seen this warning while converting the forms:
WARN Form validation endpoint not found in your version of CHT Core, no form will be checked before push

Any idea where the culprit might be, thank you

Hi @oyierphil

Can you please check the settings document in the database of your instance, to verify that contact_types are correctly set up?

@diana, please clarify settings document in the database of your instance.
I have a demo for the current config tomorrow, thus have to review and sort out the bug, thank you

hi @oyierphil

I’m referring to this document: (this is the instance you linked to in another thread).
Inspecting it, I can find two contact_types entries. I think you’ve been adding your config changes at the wrong level, under uhc:


I can also see you added replication_depth there. That needs to be at a lower level as well.
In your config, please make sure you add these properties at the lowest level and re-upload.