Trouble accessing DHIS2 instance with a local WSL created DHIS2 web application

Hello everyone.
I localy created a DHIS web application in a WSL.
But I’m having trouble to access it via browser using the addresses and the login details shared in this guide Creating a DHIS2 Web app | DHIS2 Developer Portal.
Please find attached a shot of the window I got while trying to connect to DHIS2 via the web App.


When I hit “Sign in”, the page just reloads; the DHIS2’s welcome page doesn’t show-up.
Thanks in advance for any help in fixing this.
Regards,
DAGBEMAMBOU

1 Like

Hi @DAGBEMAMBOU

Please refer to the below trail. Hope this helps.

1 Like

Hi @DAGBEMAMBOU

Did the topic @Vishwanideep_Kumar refer to help? If not I’d be happy if you could share more details such as the Network log from the DevTools (F12) when you click on Sign In.

Also, are you sure that the instance ‘localhost’ is using port 8080? Please check the configuration.

I’m also happy to see that you have now managed to have a locally running instance, well done!

Hi @Gassim
Thank you for your reply.
Unfortunately, the topic @Vishwanideep_Kumar referred to didn’t help me.
Please, find attached the Network log from the DevTools


After checking, I found that nothing is using port 8080.
Thank you for any help to fix that issue.
Regards

1 Like

@Vishwanideep_Kumar
Thank you so much for your reply.
Unfortunalely, it didn’t work for me and I’m still facing the issue.
So, any other tips to help solve this would be greatly appreciated.
Once again, thanks for your help.
Regards.

1 Like

Hi!

Do you have a dhis2 instance running locally at 8080 or with some other port?
You can find instructions to do so here: How to spin up a DHIS2 local instance | DHIS2 Developer Portal. Getting it to work might be a little harder with WSL though from experience.


An alternative is to use an online instance you might have access to, Login app | DHIS2 for instance. You start your app with:

yarn start --proxy https://play.im.dhis2.org/stable-2-42-1

You should be able to note in the console the following new lines:

Starting proxy server... 
The proxy for https://play.im.dhis2.org/stable-2-42-1 is now available on port 8080

Now you should be able to connect via the proxy:


You want to make sure the instance you connect to (local or online) has the correct CORS allow list as indicated in the topic shared by Vishwanideep Kumar (How can I connect to a live DHIS2 instance from a localhost custom app).


I hope that’s helpful,
Bruno

1 Like

@Vishwanideep_Kumar ,
After installing DHIS Portal following the instructions on the following page GitHub - awgaan/dhis-portal , how do we access the instance via a browser?
http://localhost:9999 did not get me to the instance.
Thanks for any help in this!
Regards

Hi @DAGBEMAMBOU

If I understand correctly, you have installed a local instance using WSL before running the web app? The page you are seeing localhost:3000 is the web app allowing you to connect to an instance that you already have setup.
→ Please check the URL of the instance that you have installed? Did you use Docker?
If you used Docker then you can use the following command to find all the instances that are running in your machine:

docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Ports}}\t{{.Status}}\t{{.Label \"com.docker.compose.project\"}}\t{{.Label \"com.docker.compose.service\"}}"

If you used d2 then in the terminal use d2 cluster list (you can see that in my d2 setup all instances are down and there’s a difference between those used in WSL and those used in CMD/windows):

These instructions are to connect directly to an instance in your machine; however, if you would like to connect to an instance that’s already setup online such as the play instances, I recommend trying @Bruno instructions.