CHT Conf fails to push when run in VS code dev container

@Esther_Moturi - you reported an issue I wanted to follow up on:

The issue [I have] now [when using VS Code to run CHT Conf] is that docker helper is providing https://127-0-0-1.local-ip.medicmobile.org:10443/ as the URL which from discussions with @jkuester , is a loopback URL. I am unable to push project files to my local instance (I suspect, it’s because of this loopback URL). Have you experienced this before? I am using cht --url=https://127-0-0-1.local-ip.medicmobile.org:10443 to push the code in the VS code dev container.

Ah hah! Yes I can see this is a problem. The issue is just as you suggested: Since CHT Conf is running in the VS Code container, when you tell it to push to 127.0.0.1, that’s the container itself, and not your computer where the CHT Core containers are running in docker. This is because we try and detect your IP address, but fail to do so for Windows.

I’ll look into a way of outputting the real IP instead of the 127 one, but as a work around, you should be able to provide the IP of your on your LAN instead of using the loopback IP. To find the IP, run ipconfig in Git Bash. The output should be something like this:

Windows IP Configuration

Ethernet adapter Ethernet 2:

   Connection-specific DNS Suffix  . : 
   IPv4 Address. . . . . . . . . . . : 192.168.1.118
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Using the IPv4 Address value, we can replace the dots (.) with dashes (-) so our new URL, in combination with the CHT Conf command, looks like this:

cht --url=https://medic:password@192-168-1-118.local-ip.medicmobile.org:10443

Note: in your example above you didn’t have the username (medic) and default password (password) in the URL - be sure to add those as I have in the cht command above.

As I said, I’ll look for a way to maybe have Docker Helper show this IP for you in the URL when it’s done, but please give the work around a go and let me know how it went!

1 Like

The work around works! Thanks @mrjones ,I can now successfully set up and upload on my local instance using Git Bash, Docker and VS Code on a Windows machine :clap: .I am looking forward to the permanent solution that outputs the real IP.

1 Like

Yay! Glad to hear the work around did the trick for you - thanks for letting us know!

1 Like