Trouble with adding app forms

Thanks for walking me over this app throughly When I did try to run the above command you mentioned As a medic user
I am seeing below error

After trying with medic user url and did upload docs and create users, I am able to login with andra
But all the new forms I did uploaded are showing the same question/form as below

Are you using medic-conf@3.2 now? An issue in medic-conf@3.1 may be responsible for forms not uploading.

Did updated and uploaded forms again
No luck :-1:t2:

What if you open the form via the contact’s tab? Select a contact and click “New Action”?

I am seeing only baby intake in the new action
I did added bay intake couple of times not sure if this can cause this issue

If I click on baby_intake, I am seeing the below

I don’t feel like I have a good grasp of what you’re expecting to see in that menu. More broadly, I don’t feel that I understand your project, or your desired outcomes. How can I understand these things such that I might guide these technical questions? Perhaps we could explain that here, or we could set up a quick support phone call?

appreciate your patience kenn
how can we setup the support call. i mean where can i get the support call number
so that i can explain better

I’ve tried adding forms to my medic app (ver 3.9). I’ve taken the forms from the cht default app used the convert form upload comand but for some reason , I get the following error when trying to create a new person
Could not evaluate: add-date(today(), 0- /model/instance[1]/data/person/ephemeral_dob/age_years , 0- /model/instance[1]/data/person/ephemeral_dob/age_months ), message: r.v.indexOf is not a function"]

Any insights on why this happening?
Thank you.

The latest version of the default app from the cht-core repo is not compatible with 3.x versions of the CHT. That config has been updated to work with 4.x. I believe the error you are seeing is caused by trying to use the updated config with 3.9.

If you want to use the latest config, you should deploy the latest 4.x version of the CHT. Alternatively, for testing purposes only (do not use this in prod), you should be able to use the latest default configuration on your 3.x server by first upgrading your server to the enketo_upgrade_3.x branch which has been created specifically to enable testing 4.x compatible forms on a 3.x server.

Thank you @jkuester, for your feedback. I’ve had some minor issues with setting up 4.x following this procedure defined here CHT 4.x Local Environment Setup | Community Health Toolkit and I keep getting the following error .IsADirectoryError: [Errno 21] Is a directory: ‘/docker-compose/couch’.
So I’m a bit stuck again and unable to proceed.
Thank you.

@ewafula at what point in the process do you see this error? It might be helpful if you could just post the whole terminal output from running the setup commands! Also, what kind of operating system are you using to run this command? (Windows, Linux. MacOS, etc)

Hi @jkuester, I’m using Ubuntu 22.04. This a fresh install but this is what I see when try connecting to localhost

Looking at the console logs there it appears that the cht-upgrade-service container is able to successfully start. That container should handle the creation of the additional containers needed to run the CHT. (Including the cht-nginx container which is what should listen on ports 80/443 on your localhost.) We should see additional logs from the cht-upgrade-service container as it spins everything up, but I don’t see those in your screenshot… What do you see if you run sudo docker ps -a? I am trying to understand if the other containers were created but are not running or if for some reason they were never created…

For the record, I just tested everything locally again on a Linux instance and I did see that .IsADirectoryError: [Errno 21] Is a directory: '/docker-compose/couch' error the first time everything spun up, but the server was still able to start successfully.


Could you please share the folder structure where you’ve placed your docker-compose files?
The upgrader and CHT docker compose files should be stored separately (in different folders). I’ve submitted an issue to fix the documentation: 4.0 local setup instructs to store upgrader and cht compose files in the same folder · Issue #873 · medic/cht-docs · GitHub

Can you try storing them like:

- folder1
  - upgrader.yml
- folder2
  - cht-core.yml
  - cht-couchdb.yml


Hi @diana ,
I’ve looked at my directory structure and it looks exactly like what you have shared. folder 2 is called data in my case with the two files cht-4-core.yml and cht-4-couch are defined.
Is there a way to tail the logs to see what is happening and what might be causing the error?
Thank you.

@ewafula - We have some docker commands for you to try! First, after starting the upgrade service, in another terminal you should confirm all the containers are running with docker ps --format '{{.Names}}'. For me, this looks like this:

upgrade docker ps --format '{{.Names}}'     

If you see all 7 containers running, you can see the logs of different container by calling docker logs CONTAINER_NAME. For example, if you want to see the last 2 lines of logs from the sentinel container, you can pipe it to tail like this docker logs cht_sentinel_1 2>&1 | tail -n 2. For me this shows:

docker logs cht_sentinel_1 2>&1 | tail -n 2

CouchDb Cluster ready
2022-11-28 21:01:29 INFO: Waiting for API to be ready... 

To actively see the logs as they happen, what you might think of as a tail -f FILENAME, you actually use docker logs --follow which looks like this:

docker logs --follow cht_sentinel_1

I won’t show the full output of that command, as it’s quite lengthy.

It might be handy to just try stopping all containers and restarting them. Assuming you’ve followed the local setup guide and your project is named cht, then you would hit ctrl + c twice to stop the upgrade service and then kill just the containers for the cht project with docker kill $(docker ps --all --filter "name=cht" --quiet). Finally, restart everything with the original docker-compose up command. For me, this look like this:

cht-upgrade-service_1  | 
^CGracefully stopping... (press Ctrl+C again to force)
Stopping upgrade_cht-upgrade-service_1 ... 
Killing upgrade_cht-upgrade-service_1  ... done

docker kill $(docker ps --all --filter "name=cht" --quiet)

docker-compose -f ~/cht-local-setup/cht-upgrader.yml --env-file  ~/cht-local-setup/env up

Starting upgrade_cht-upgrade-service_1 ... done
Attaching to upgrade_cht-upgrade-service_1
cht-upgrade-service_1  | Listening on port 5008

Hi @mrjones,
Sorry for taking long to provide feedback on status. Thank you for the docker commands to help me track my logs and see what is happening. This made easy for me to see what is happening and I’m happy to report that my cht app is now working fine. I’m working on the custom forms and will share my feedback on how this goes and if there any challenges.

1 Like

@ewafula - that’s wonderful news! Thank for coming back to let us know.

Keep us posted!

A post was split to a new topic: How to add the group_summary section of the form?