DHIS2 2.38.1.1 Unable to Login to Android - Unknown Server

Dear Community,

I m requesting for assistance on solving a login error users are getting when logging in using the Android App. The users were able to login just fine 3 or so days ago and now all of a sudden the droid is throwing different types of errors

  1. wrong user credentials
  2. In some cases, this is the error that is coming up on the Android

Cause: Unknown server

Exception: java.net.UnknownHostException: Unable to resolve host “Host URL”: No address associated with hostname

Created: Thu Sep 01 16:07:57 GMT+02:00 2022

Error component: Server

StackTrace: org.hisp.dhis.android.core.maintenance.AutoValue_D2Error

The DHIS2 error logs are saying this:

  • INFO 2022-09-02T12:22:20,718 Authentication event AuthenticationFailureBadCredentialsEvent username cmuyunda ip ------- sessionId 874db4913d735687c03bce39e9c14419bef4c1f70968ea2005d076ac2516a0cc exception Bad credentials (AuthenticationLoggerListener.java [https-openssl-nio-443-exec-3])
  • INFO 2022-09-02T12:24:06,402 Authentication event AuthenticationFailureBadCredentialsEvent username cmuyunda exception Bad credentials (AuthenticationLoggerListener.java [https-openssl-nio-443-exec-3])
  • INFO 2022-09-02T12:25:17,972 Authentication event AuthenticationFailureBadCredentialsEvent username cmuyunda exception Bad credentials (AuthenticationLoggerListener.java [http-nio-80-exec-6])

I have tried using a small screen in the browser, bluestacks and multiple phones - still can’t login

Please assist.

Regards,
Cynthia

Hello @ckamb .

It is not fully clear to me if this problem is happening only in Android or using the web browser as well as per the first picture attached.

Is this happening with every user? I have seen the D2Error before and it was due to a misconfiguration on the server but here it seems there might be problems while accessing the server. I would try the following:

  1. For obvious reasons change the password of that user and try again. To discard wrong credentils
  2. Try connecting from the phone via the web browser. Like this we can discard connectivity issues between the phone and the server
  3. Reset the App

Otherwise, please feel free to provide a username / password / server that we could use for testing via private message. Ideally a testing user with minimum access and a testing (and not production) server if possible.

Hi @jaime.bosque ,

This problem is only occuring in Android. Users are able to loggin just fine using the web platform.

The Unknown server error is happening for every user, hence no one is able to login using Android.

Have tried connecting to dhis2 on the phone via the phone’s browser, it’s giving ERR_NAME_NOT_RESOLVED. It is not giving the same problem when accessed using the Computer’s web browser.

I have tried uninstalling and reinstalling the app. Downgrading the app, resetting the app cache on the phone… Nothing seems to be working.

I have tried mapping the hosts [ip to hostname]. Even changing the DNS settings on the server…

Been testing it all morning - the error I keep getting is this one.

If you cannot use the web browser of the phone the problem is not coming from the App itself but due to a connectivity issue between the phone and the server. If you are getting ERR_NAME_NOT_RESOLVED I suspect you are having some DNS issues.

Are your phones using wireless or mobile data? If you are using wireless I would try using a laptop on the same network and checking if you can reach from there the server.

Another question. Your phones are not using any kind of proxy or VPN, right?

Phones are not using any proxy.

Phones using mobile data.

I have tried to tether from one phone so Laptop and phone are on the same network - I can access the server via Laptop web browser, while I am unable to do the same using the phone broswer.

I have sent you login details.

Your server seems unreachable from where I am and I believe there is a problem at network level. I am not sure if this server is online or on premises. If the second I believe there might be some network forwarding issues that the laptops overcome by accessing the server internally (or being allowed by some rules).

If the server is online you need to check with your provider. It is very difficult to diagnose this problems remotely so I am not sure how much I can help.

If you use your phone to tether (via WiFi AP or USB cable) and connect the laptop you should not be able to see the server. If you can there might be some cache issues that are allowing to access the server (for example if the DNS name / IP changed). Try opening an incognito window, or by clearing the server cache (CTRL + F5 or ALT + F5) and see if after that you also cannot reach the server.

You could also see your DNS cached values on your laptop/desktop. Or try performing a nslookup on the server URL and see if you get an IP. If you get one your laptop/desktop are receiving DNS from a private DNS server. Try getting that IP (if public) and see if your phones can reach it

You are right. I used the phone to tether and connected the laptop, then tried to access the site in incognito mode, I couldn’t.

nslookup didn’t give an IP. Will take it up with the service provider.

Thanks for the tips. Will keep you updated on how it goes.

2 Likes