Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODK Authentication stops working on ODK Collect for no apparent reason. #82

Closed
getodk-bot opened this issue Sep 5, 2016 · 17 comments
Closed
Assignees
Labels

Comments

@getodk-bot
Copy link
Member

Issue by mitchellsundt
Thursday Jul 09, 2015 at 19:03 GMT
Originally opened as getodk/getodk#693 (39 comment(s))


Originally reported on Google Code with ID 692

We are running ODK Aggregate (v1.2.0) on our own server and it all seems to work fine.
We have set up ODK authenticated Data Collector users in Aggregate and matched those
credentials as stored username/password settings on the ODK Collect (v1.2.1) app on
our Android devices. Doing a "Get Blank Form" works fine with those credentials and
we get the form uploaded onto the Android device. "Fill Blank Form" works fine and
we can finish and finalize forms with no problems.

However, when it comes time to "Send Finalized Form", the Android phone reports an
authentication error (despite the credentials being correct) against the Aggregate
server and asks for a username and password to be entered. I can type in any valid
username and password and it still will not send the form. All sets of credentials
are in fact valid and work fine when we use a web browser to log in to Aggregate itself.

The only way we seem to be able to fix it is to do another "Get Blank Form" and re-upload
the same form. Magically the "Send Finalized Form" starts working again with no change
to the stored username/password settings.

Can anyone think of a reason why this might occur? (..and how we might stop it happening?)

Thanks

Evan Yates

Reported by wbrunette on 2012-09-26 18:13:03

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:03 GMT


Are you using the latest ODK Collect 1.2.1 (1015) build for ODK Collect? 
(shown on the main screen).

(thank you for the detailed reproduction/recovery description)


Reported by mitchellsundt on 2012-10-04 21:04:46

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:03 GMT


Yes, I am using v1.2.1 (1015) of ODK Collect.

Thanks for following this up.

Evan Yates
Technology Manager
AsureQuality Ltd.

Reported by kotukunui on 2012-10-04 22:55:12

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:03 GMT


This is a link to a video that shows the issue in action.

http://www.youtube.com/watch?v=goAtrkh456U

Hope this helps.

Reported by kotukunui on 2012-11-01 23:14:43

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:03 GMT


As the video shows, we are also using the latest ODK Collect 1.2.1 (1020) and the issue
is still occurring.

Reported by kotukunui on 2012-11-02 00:54:01

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:03 GMT


I have created a generic login to our system to allow a development team member to try
our form and see why this is happening.

Server = https://odktrial.asurequality.com/ODKAggregate/
Username = DataCollector1
Password = collectdata
Form = FruitFlyV6

Is it something about our Aggregate installation that causes the authentication to
pop-up on a "Send Finalized Form"?

Once someone from the dev team has tried the issue and seen the error, let me know
and I will turn off the generic login.

Thanks

Reported by kotukunui on 2012-11-19 23:09:45

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


Any progress with this issue?

Reported by kotukunui on 2012-12-04 01:16:24

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


I haven't found a clear cause for this.  
Testing from here to your server on a Droid (Android 2.2.3) works.

What phone/device are you using? What Android OS version?

Can you install CatLog and attach a log capture to this issue taken during your reproduction
of this issue on your device? http://code.google.com/p/opendatakit/wiki/CollectTroubleshooting

Reported by mitchellsundt on 2012-12-05 19:26:15

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


We are using Samsung Galaxy Ace Plus phones (GT-S7500) with Android 2.3.6

I will get a CatLog capture to you ASAP. I'm not sure if it will help as ODK Collect
doesn't crash, it just refuses to acknowledge valid authentication until after a new
"Get Blank Form" is performed.

Thanks

Reported by kotukunui on 2012-12-10 00:24:53

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


LogCat file attached

Reported by kotukunui on 2012-12-10 00:38:33


- _Attachment: [logcat_and_device_info.zip](https://storage.googleapis.com/google-code-attachments/opendatakit/issue-692/comment-10/logcat_and_device_info.zip)_

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


Hmm. I'm seeing these errors:

12-10 13:29:48.809 W/System.err(989): java.net.UnknownHostException: odktrial.asurequality.com
12-10 13:29:48.819 W/System.err(989):   at java.net.InetAddress.lookupHostByName(InetAddress.java:508)
12-10 13:29:48.819 W/System.err(989):   at java.net.InetAddress.getAllByNameImpl(InetAddress.java:296)
12-10 13:29:48.819 W/System.err(989):   at java.net.InetAddress.getAllByName(InetAddress.java:258)
12-10 13:29:48.819 W/System.err(989):   at org.opendatakit.httpclientandroidlib.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)

--------
This likely indicates a problem with your network gateway(s). Often networks have 2
gateways that supply name look-ups (i.e., from odktrial.asurequality.com to an IP address).


It looks like one of these 2 gateways does not have an entry for odktrial.asurequality.com.
 Note that the gateway(s) are specified in your WiFi router (or the cellular network,
if using that for connectivity).

Per other reported Android issues on this, "Addresses are cached for 600 seconds (10
minutes) by default. Failed lookups are cached for 10 seconds."

So it is likely if you just waited 10+ seconds, and attempted to re-send the submission,
that, too, should work.  If two gateways are available, the phone will alternate which
it uses when requesting a lookup. Hence every-other connection seems to go OK, or every
interaction within 10 minutes of a successful lookup goes OK, then the cache expires
(e.g., while filling out a form), and the next attempt fails.

I haven't tried it, but this app might provide some insight into what the phone is
seeing for your server address: https://play.google.com/store/apps/details?id=com.ulfdittmer.android.ping&hl=en

Reported by mitchellsundt on 2012-12-10 18:24:50

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


I think those Network error are a red-herring. As you say, I just waited and tried again
to solve the network connection when the cache expired.

The real issue actually shows up at about line 7188 of the original log file. I've
edited the log file (and attached the shortened modified one) to start from the ODK
form submission line.

You can see a /submission (line 1) is called and very soon after a "clearHostCredentials"
is called (line 23) when ODK splashes up the credentials screen. You can see I try
this a couple of times (lines 57, 124)
I then do a "Get  Blank Form" (line 330)
After that the next "Send Finalized Form" succeeds (line 435)

Does this change anything? I'm hoping this is just an ODK Aggregate configuration thing
rather than a bug in ODK Collect, but I'm not sure how to go about diagnosing it beyond
observing behaviour.

Thanks

Reported by kotukunui on 2012-12-11 20:24:36


- _Attachment: [logcat_edited.txt](https://storage.googleapis.com/google-code-attachments/opendatakit/issue-692/comment-12/logcat_edited.txt)_

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


Download the "ODK Collect v1.2.2 uploader 1022.apk" test build of Collect here: 

http://homes.cs.washington.edu/~msundt/collect/

If you allow (have checked) : Settings / Applications / Unknown Sources

Then you can use the browser on the phone to go to the above URL, and click on the
apk file, and install ODK Collect.

You will likely need to uninstall your existing ODK Collect to be able to install this
one.

With this build, try to reproduce the problem and attach the logs if it is still happening.
 I made some changes to how the activity is saved and restored which might fix this
issue.

Mitch

Reported by mitchellsundt on 2012-12-12 02:05:32

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


I just updated the APK on the above page. Try the REVISED apk.  I think the uploads
likely did succeed, but that a variable was not being re-initialized, causing the erroneous
re-asking of the username/password.

Reported by mitchellsundt on 2012-12-12 17:39:11

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


I have downloaded the v1.2.2 REVISED apk from your website and installed it. 
I'm still getting the authentication dialog on Submit Finalized Form. I have noticed
that it can be made to happen by re-booting the phone, going in to ODK, Filling in
a Blank Form and trying to Send Finalized Form straight away. 
Once you have re-loaded the Get Blank Form, the Send Finalized starts to work again
and keeps working until the app is closed and the phone goes to sleep. Something to
do with submission authentication seems to get lost in the "ODK Collect shutdown" process.
Logfile attached. The action starts on line 5638

Reported by kotukunui on 2012-12-13 20:33:34


- _Attachment: [logcat_and_device_info.zip](https://storage.googleapis.com/google-code-attachments/opendatakit/issue-692/comment-15/logcat_and_device_info.zip)_

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


I'm still unable to replicate the problem on 2.2.3 or 2.3.5 even with a reboot and initial
launch.

I made some minor changes and added logging statements in the recently released 1.2.2
(rev 1023), but doubt they will have much effect on your problem.

I suspect it is related to the specific OS version and hardware on your phone.  if
there are any ROM updates available from your telecom provider or from Samsung, you
might try applying them.



Reported by mitchellsundt on 2012-12-19 00:35:55

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


Ok. Looks like it is related to the model of phone we use. I will investigate OS updates
from Samsung and will report back. I'm happy for you to close this issue.

Thanks

Reported by kotukunui on 2012-12-19 21:12:08

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:04 GMT


I have made another change to the code. Can you download the latest update on the above
link and try it?

My supposition is that the first attempt to upload fails with a connection timeout,
and that this poisons all subsequent upload attempts.

Reported by mitchellsundt on 2013-01-04 18:54:47

@yanokwa yanokwa removed the Collect label Sep 16, 2016
@yanokwa yanokwa closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants