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