Cannot compile the app settings

INFO Processing config in flourish_vB0718.
INFO Actions:
- compile-app-settings
- backup-app-settings
- upload-app-settings
- convert-app-forms
- convert-collect-forms
- convert-contact-forms
- backup-all-forms
- delete-all-forms
- upload-app-forms
- upload-collect-forms
- upload-contact-forms
- upload-resources
- upload-custom-translations
- upload-privacy-policies
INFO Starting action: compile-app-settings…
INFO Packaging contact-summary
INFO Hash: 9b99318ce61e1e529287
Version: webpack 4.46.0
Child
Hash: 9b99318ce61e1e529287
Time: 4734ms
Built at: 07/20/2023 3:34:33 PM
Asset Size Chunks Chunk Names
./contact-summary.js 129 KiB 0 [emitted] main
Entrypoint main = ./contact-summary.js
[0] ./node_modules/luxon/build/cjs-browser/luxon.js 247 KiB {0} [built]
[1] C:/Users/ICMFI-03/AppData/Roaming/npm/node_modules/medic-conf/src/contact-summary/lib.js 203 bytes {0} [built]
[2] ./contact-summary.templated.js 34.3 KiB {0} [built]
[3] ./contact-summary-extras.js 85.1 KiB {0} [built]
[4] C:/Users/ICMFI-03/AppData/Roaming/npm/node_modules/medic-conf/src/contact-summary/contact-summary-emitter.js 3.29 KiB {0} [built]
INFO Packaging nools
INFO Hash: a9a74f96553d317bd605
Version: webpack 4.46.0
Child
Hash: a9a74f96553d317bd605
Time: 2774ms
Built at: 07/20/2023 3:34:36 PM
Asset Size Chunks Chunk Names
./nools.js 127 KiB 0 [emitted] main
Entrypoint main = ./nools.js
[0] ./node_modules/luxon/build/cjs-browser/luxon.js 247 KiB {0} [built]
[1] C:/Users/ICMFI-03/AppData/Roaming/npm/node_modules/medic-conf/src/nools/definition-preparation.js 1.36 KiB {0} [built]
[2] C:/Users/ICMFI-03/AppData/Roaming/npm/node_modules/medic-conf/src/nools/lib.js 328 bytes {0} [built]
[3] ./tasks.js 82.9 KiB {0} [built]
[4] ./nools-extras.js 38.9 KiB {0} [built]
[5] ./targets.js 20 bytes {0} [built]
[6] C:/Users/ICMFI-03/AppData/Roaming/npm/node_modules/medic-conf/src/nools/task-emitter.js 4.73 KiB {0} [built]
[7] C:/Users/ICMFI-03/AppData/Roaming/npm/node_modules/medic-conf/src/nools/target-emitter.js 2.75 KiB {0} [built]
INFO compile-app-settings complete.
INFO Starting action: backup-app-settings…
(node:10016) 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)
ERROR Error: Failed to fetch existing app_settings from https://medic:****@localhost/medic/_design/medic/_rewrite/app_settings/medic.
Check that medic-api is running and that you’re connecting on the correct port!
at C:\Users\ICMFI-03\AppData\Roaming\npm\node_modules\medic-conf\src\lib\api.js:12:17
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async module.exports (C:\Users\ICMFI-03\AppData\Roaming\npm\node_modules\medic-conf\src\lib\main.js:187:5)
at async C:\Users\ICMFI-03\AppData\Roaming\npm\node_modules\medic-conf\src\bin\medic-conf.js:11:18

Can you help me to fix this one?

Thanks

Hi Marcello,

Check that medic-api is running and that you’re connecting on the correct port!

Means that cht-conf is unable to access the CHT instance. The most common culprit is missing port number as it’s sometimes truncated when copying URLs.

How to check that missing port number?

I am using windows 10

Assuming you’re using the default settings from documentation here:

It should be 5988 and the deployment URL will be:

https://medic:****@localhost:5988/medic/_design/medic/_rewrite/app_settings/medic

Should I update my docker-compose file?

Is there an easy way to install cht-core as developer ?

I am getting hard to install it as of now.

These are some guides that you can follow to install CHT as an app developer:

If you have WSL2, you can directly go to the CHT docker helper section and give it a try. It is probably the easiest way to install CHT for app development. As mentioned in the guide, here are some benefits of using the script:

  • You only have to download one bash script
  • All compose files and images will be downloaded automatically for you
  • All networks, storage volumes and containers will be created
  • A valid TLS certificate will be installed, allowing you to easily test on with CHT Android natively on a mobile device
  • An unused port is automatically chosen for you when creating a new project. No more manually looking at your existing .env files!

Check that medic-api is running and that you’re connecting on the correct port!

But for this issue, what is the best way to fix this faster rather than check a document for installing version 3.x ?

We are getting a new person to develop CHT in our company, but it seems it was really hard to install this, due to this error.

So for this one, it should be this command, right?

medic-conf --url=https://medic:password@localhost:5988 --accept-self-signed-certs

But, I tried that one and I have still error like ECONNREFUSED 127.0.0.1:5988

C:\Work Folder\flourish_final>medic-conf --url=https://medic:password@localhost:5988 --accept-self-signed-certs
INFO Processing config in flourish_final.
INFO Actions:
- compile-app-settings
- backup-app-settings
- upload-app-settings
- convert-app-forms
- convert-collect-forms
- convert-contact-forms
- backup-all-forms
- delete-all-forms
- upload-app-forms
- upload-collect-forms
- upload-contact-forms
- upload-resources
- upload-custom-translations
- upload-privacy-policies
INFO Starting action: compile-app-settings…
INFO Packaging contact-summary
INFO Hash: 9b99318ce61e1e529287
Version: webpack 4.46.0
Child
Hash: 9b99318ce61e1e529287
Time: 3924ms
Built at: 07/30/2023 6:18:28 PM
Asset Size Chunks Chunk Names
./contact-summary.js 129 KiB 0 [emitted] main
Entrypoint main = ./contact-summary.js
[0] ./node_modules/luxon/build/cjs-browser/luxon.js 247 KiB {0} [built]
[1] C:/Users/Lilia/AppData/Roaming/npm/node_modules/medic-conf/src/contact-summary/lib.js 203 bytes {0} [built]
[2] ./contact-summary.templated.js 34.3 KiB {0} [built]
[3] ./contact-summary-extras.js 85.1 KiB {0} [built]
[4] C:/Users/Lilia/AppData/Roaming/npm/node_modules/medic-conf/src/contact-summary/contact-summary-emitter.js 3.29 KiB {0} [built]
INFO Packaging nools
INFO Hash: 4b902315d6f2d9bb048f
Version: webpack 4.46.0
Child
Hash: 4b902315d6f2d9bb048f
Time: 189ms
Built at: 07/30/2023 6:18:28 PM
Asset Size Chunks Chunk Names
./nools.js 4.67 KiB 0 [emitted] main
Entrypoint main = ./nools.js
[0] C:/Users/Lilia/AppData/Roaming/npm/node_modules/medic-conf/src/nools/definition-preparation.js 1.36 KiB {0} [built]
[1] C:/Users/Lilia/AppData/Roaming/npm/node_modules/medic-conf/src/nools/lib.js 328 bytes {0} [built]
[2] ./tasks.js 20 bytes {0} [built]
[3] ./targets.js 20 bytes {0} [built]
[4] C:/Users/Lilia/AppData/Roaming/npm/node_modules/medic-conf/src/nools/task-emitter.js 4.73 KiB {0} [built]
[5] C:/Users/Lilia/AppData/Roaming/npm/node_modules/medic-conf/src/nools/target-emitter.js 2.75 KiB {0} [built]
INFO compile-app-settings complete.
INFO Starting action: backup-app-settings…
(node:3088) 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)
ERROR RequestError: Error: connect ECONNREFUSED 127.0.0.1:5988
at new RequestError (C:\Users\Lilia\AppData\Roaming\npm\node_modules\medic-conf\node_modules\request-promise-core\lib\errors.js:14:15)
at Request.plumbing.callback (C:\Users\Lilia\AppData\Roaming\npm\node_modules\medic-conf\node_modules\request-promise-core\lib\plumbing.js:87:29)
at Request.RP$callback [as _callback] (C:\Users\Lilia\AppData\Roaming\npm\node_modules\medic-conf\node_modules\request-promise-core\lib\plumbing.js:46:31)
at self.callback (C:\Users\Lilia\AppData\Roaming\npm\node_modules\medic-conf\node_modules\request\request.js:185:22)
at Request.emit (node:events:513:28)
at Request.onRequestError (C:\Users\Lilia\AppData\Roaming\npm\node_modules\medic-conf\node_modules\request\request.js:877:8)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:494:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

Hi @Marcelo_De_Guzman

Please make sure that API is accessible on the URL that you’re using. If you access this exact URL in your browser, are you getting a response? If the URL is correct, accessing it in the browser should take you to the login page.
If you are running CHT 3.x using Docker, I suspect your URL should be https://medic:password@localhost .

Is there a video on how to install medic, rather than reading the document?

Hi @Marcelo_De_Guzman,

We have video tutorial course on " Introduction to Building CHT Applications" in CHT Academy here. The course offers basic understanding of technical details to develop simple CHT applications. So, it may be helpful to train a new person on developing CHT application. However, the setup process here is on CHT version 4.x.

1 Like

Hi @ niraj, really thanks about this. I think this one will really helps, especially with the ones who gonna start from scratch, or should I say, a non-techie person.

and no worries about CHT version 4.x, we have also plan to transition to that, it was just we still have development on-going,

Will reply to you when we install the version 4.x on our local.

3 Likes