Error response when uploading contacts

Hello, I’m a newbie in CHT, I have managed to install it on my local computer but I’m having an issue in uploading contacts.
After a successful installation I was able to access the instance via this URL
https://127-0-0-1.local-ip.medicmobile.org:10443/#/messages

Step I created and saved this csv file in a folder known as csv
Desktop/cht-project.csv

Step 2 I ran this command

Step 3:


I followed this tutorial CHT Tutorials - Contact and User Management Part 2 - YouTube

The main issue is that it fails to get response from my instance yet, I am able to access it via my browser. Kindly help.

1 Like

Hi @Kenyuri ,

Can you try following command as mentioned in CHT documentation website?

cht --url=https://medic:password@localhost --accept-self-signed-certs csv-to-docs upload-docs

Hi @niraj I still getting this error

Hi @Kenyuri can you see if localhost is actually running by entering https://localhost/ in Incognito mode in browser? Just wondering if you are seeing cached page.

its not running

@Kenyuri To start the developer CHT instance, run docker-compose , prepending the needed environment variables. Assuming you are following the tutorial (App Developer Hosting in CHT 4.x | Community Health Toolkit), for the local setup you can run following in the terminal:

CHT_COMPOSE_PROJECT_NAME=app-devl COUCHDB_SECRET=foo DOCKER_CONFIG_PATH=${PWD} COUCHDB_DATA=${PWD}/couchd CHT_COMPOSE_PATH=${PWD} COUCHDB_USER=medic COUCHDB_PASSWORD=password docker-compose up

After your developer CHT instance is up, can you try again the command mentioned earlier and see if it resolves the issue?

can you see if localhost is actually running by entering https://localhost/ in Incognito mode in browser?

Just to confirm before completely deciding the instance is down, did you connect to https://localhost:10443/? (with the port) That is where I would expect to see the instance you can also access at https://127-0-0-1.local-ip.medicmobile.org:10443

1 Like

Assuming the instance is actually up, I have some further thoughts:

node@78021f0ad5dc:/workspaces/cht-project

Are you using the VS Code Dev Container as your IDE? If so, I think that might explain why you can access the instance from your browser (not running inside the container) vs your VS Code terminal (which is running inside a container). In the VS Code dev container, localhost (and also 127.0.0.1 I think) will resolve to the container itself and not to your actual host.

The docs for connecting to a local instance do mention connecting via the ...local-ip.medicmobile.org adapter, but I think that might need to have the local ip address of your host machine in the URL (e.g. something like https://192-168-1-34.local-ip.medicmobile.org:10443 and not https://127-0-0-1..... Can you try replacing 127-0-0-1 with your actual local ip address for your host (but using - instand of .). Then see if you can connect to that URL via your browser still. If that works, try running the cht command again in VS Code.

Couple of followup questions:

  • How did you start your CHT instance? (Which docs were you following?)
    • I am curious where the https://127-0-0-1.... originated from…
  • What operating system are you running? (This might affect Docker networking shenanigans…)

(Also, for more information on what is going on with the local-ip.medicmodile.org stuff, you can check out this page, but the TLDR is that it basically provides DNS records (and TLS certs) for local ip addresses. So, 192-168-1-34.local-ip.medicmobile.org is resolved to 192.168.1.34.)

4 Likes

Thanks for your support. It has worked. I used this command

cht --url=https://medic:password@192.168.0.18:10443/ --accept-self-signed-certs upload-docs

2 Likes