Error in syncing for Android App

Hello,
Suddenly I’m facing an issue while syncing configuration while logging. Previously i haven’t faced this issue. I have deleted the remote server URL once through web and tried syncing in android app. I got this issue. So, I have added the URL back from the web. But still facing the same issue 95% of times.


Kindly help me with this issue!
Thank you!

Thanks @Katta_Nityapriya! Could you click on Share and see what details are there?

Please double check that you are entering the complete URL. For instance, in play if I want to connect to the following instance in the screenshot below, I will only enter the part https://play.dhis2.org/40.0.1 and not https://play.dhis2.org/40.0.1/dhis-web-commons/security/login.action


  • Other things to try is changing the connection when syncing. Test using different internet connection options that you have and see if there’s a difference.
  • After checking the connection, another good idea is if you have another phone which you haven’t used and see if you face the same issue.
  • You could also test connecting to any of the play.dhis2.org instances using the credentials android / android123, if it works then it’s not the connection nor the phone but actually an issue connecting to the server…

I hope these help!

Thank you @Gassim Yes, we are able to connect to play.dhis2.org. And the URL entered for our instance is also correct. I’m getting the following details when I click on the “share”.

Cause: Something went wrong. Please check that server url, username and password are correct and try again.

Exception: 

Created: Mon Sep 04 19:14:28 GMT+05:30 2023

Http Error Code: 500

Error component: Server

Url: https://edesk.twoca.org/api/dataElements?fields=id%2Ccode%2Cname%2CdisplayName%2Ccreated%2ClastUpdated%2Cdeleted%2CshortName%2CdisplayShortName%2Cdescription%2CdisplayDescription%2CvalueType%2CzeroIsSignificant%2CaggregationType%2CformName%2CdomainType%2CdisplayFormName%2CoptionSet%5Bid%5D%2CcategoryCombo%5Bid%5D%2CfieldMask%2Cstyle%5Bcolor%2Cicon%5D%2Caccess%5Bread%5D%2ClegendSets%5Bid%5D%2CattributeValues%5Bvalue%2Cattribute%5Bid%2Ccode%2Cname%2CdisplayName%2Ccreated%2ClastUpdated%2Cdeleted%2CshortName%2CdisplayShortName%2Cdescription%2CdisplayDescription%2CvalueType%2Cunique%2Cmandatory%2CindicatorAttribute%2CindicatorGroupAttribute%2CuserGroupAttribute%2CdataElementAttribute%2CconstantAttribute%2CcategoryOptionAttribute%2CoptionSetAttribute%2CsqlViewAttribute%2ClegendSetAttribute%2CtrackedEntityAttributeAttribute%2CorganisationUnitAttribute%2CdataSetAttribute%2CdocumentAttribute%2CvalidationRuleGroupAttribute%2CdataElementGroupAttribute%2CsectionAttribute%2CtrackedEntityTypeAttribute%2CuserAttribute%2CcategoryOptionGroupAttribute%2CprogramStageAttribute%2CprogramAttribute%2CcategoryAttribute%2CcategoryOptionComboAttribute%2CcategoryOptionGroupSetAttribute%2CvalidationRuleAttribute%2CprogramIndicatorAttribute%2CorganisationUnitGroupAttribute%2CdataElementGroupSetAttribute%2CorganisationUnitGroupSetAttribute%2CoptionAttribute%5D%5D&filter=id%3Ain%3A%5BmHCqzkI96qj%2CrJAyjHUaBjM%2CjDPKJZn5XFj%2CtoG0dfaA0c0%2CNtLIOWEqM1p%2Curbjj7MdVMo%2CI0xCEi7M2XZ%2CpQ1SRdfYmsl%2CEcWALTpMbHj%2CsdHbDWIoKdA%2CsiCqXx6IhvD%2CZo5VryOdQiM%2CtCraWVCI2pA%2CN5yhDXZIwwA%2CMiKygojomaY%2CcJcIMxDuPus%2CiY5uiZv7ydF%2CpYanTjRJ4OW%2CNPXQbX24rBM%2Cpro5LQdhhei%2CEcenhlgicQL%2Ckg7jLOZTO1h%2CNdMNfqsSHZt%2CMiSsEL1ukqj%2CceGlH3Dfz5t%2CmGyk6PwYExW%2CT3HhlPWGgCA%2CmRQnYa3wTRn%2Ch6aHvI2Q8sN%2CHCs5RlpipcC%2COyVOlBcBnru%2CSZD3UrX25ZV%2Chi8yBjUBofw%2CZS1XzdQDhoB%2COVH08MRvOei%2CLpwtL6BgYUX%2CM3WlNmFK5Zv%2CZPHYJdL31fw%2CT4j5XZPAeAe%2CQ21wBOfbMuC%2CUUZLxcdmY5q%2CQoieql524Qq%2CDq0s8vDzlz1%2Ce1e7BC2MsHc%2CAsIwF5yElBr%2CLh8rNTAg4p4%2CcAj301dLPiA%2CkEhPuWVP3IB%2CldjKg58rRgx%2CziwkNO5EXvD%2CGZFzlMdcfnp%2CXxMTHE8WajM%2CKV2yDbKx9nd%2CTcniufZUKu4%2CtDbelECtCEw%2CTx6Wv5yn68Q%2COaNAJbdZGzz%2CDSCsrtfJ8ta%2CXBfcDCS170o%2CdwBB2IB1mvQ%2CJzf9NweGvt7%2CVyK1WDH3gGb%2CSweYZ1r282a%2CdaAs1WAKhrq%2Cegk2bD3TbST%2CutMyOzBinuX%2Cmvr0LY3kOcI%2Cqi06TpYLhrm%2CblPAaeCv0Qp%2Cz3rT1bypgC5%2CcAS4MNx9nGa%2CFckzyOIVwlX%2CIGbpDcRwIxH%2CURPP4fS6dIZ%2CFnMZHUfZ2lb%2CletNYOI81tl%2CcvEtrZ3D1Kh%2CSLGQ1uPE3gB%2CTXqIoxxir64%2CVbY2poR1vt6%2CvQQKiJ6tTQz%2CUNqlRa3oMhh%2CarHWsWin2f6%2CrwqtysX3eeS%2CsxtROLLPbK6%2CNyld6BkBgz1%2CAK7Ywut89uN%2ChUUGdMds1l5%2CPRzGF4P2JLZ%2CrEUf4vDQdS4%2CM1HLk3RZL4n%2CTFE1T1PHBlI%2CVUn2WnqGqb2%2CrLTdEpDDCzo%2CEQXteO2DULh%2CNEGp4Qa6m04%2CCEMBx8PTGoL%2CLiofQxyZGoi%2CF7G8SGSk7kE%5D&filter=access.read%3Aeq%3Atrue&paging=false

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

The credentials entered are also correct. And I’m able to login in web. Also, I have entered only the part of the URL that is required. But not sure why I am getting this.

Usually the AutoValue_D2Error happens when the Android App finds an exception in the database, it can happen if a duplicate UID is found (for example which can happen when messing with the DB manually) but also when things are removed from the system. Have you changed the metadata recently? if you sync a new device with the same user do you get the same error?

@vgarciabnz , didn’t we start capturing the exceptions to present something more useful to the user of the crash?

Hello @Katta_Nityapriya . I might have given you a wrong piece of information after discussing with my colleague @vgarciabnz .

Could you actually take that URL you posted and put it in the browser? You will be asked for credentials the first time. If the server throws a 500 as well (very likely) then there is a problem with your metadata and you will need to see, field by field, where the problem might be.