Closed GoogleCodeExporter closed 9 years ago
I figured out the problem. During the changeover from one GData library to
another, and the associated changes in the HttpException, the processing of
auth token expirations was broken. This is particularly hard to test, since
tokens expire every 14 days. Anyway, we were looking for the token in the
message, which is now null, when we should've been reading the status code
directly.
Here's a sample log from a guinea pig, to whom we are forever grateful:
D/MyTracks( 4654): SendToDocs: Uploading to spreadsheet
D/MyTracks( 4654): GData connection prepared:
com.google.android.apps.mytracks.io.ModernAuthManager@40599cc0
W/DefaultRequestDirector( 4654): Authentication error: Unable to respond to any
of these challenges: {googlelogin=WWW-Authenticate: GoogleLogin
realm="http://www.google.com/accounts/ClientLogin", service="writely"}
E/MyTracks( 4654): HttpException, code 401 message null
<<<<-------------
E/MyTracks( 4654):
com.google.android.apps.mytracks.io.gdata.GDataWrapper$HttpException
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.docs.DocsHelper$2.query(DocsHelper.java:198)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.docs.DocsHelper$2.query(DocsHelper.java:1)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.gdata.GDataWrapper.runOne(GDataWrapper.java:
198)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.gdata.GDataWrapper.runCommon(GDataWrapper.ja
va:171)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.gdata.GDataWrapper.runQuery(GDataWrapper.jav
a:162)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.docs.DocsHelper.requestSpreadsheetId(DocsHel
per.java:172)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs.uploadToDocs(SendToDocs.java:193)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs.doUpload(SendToDocs.java:123)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs.access$0(SendToDocs.java:101)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs$1.run(SendToDocs.java:96)
E/MyTracks( 4654): at android.os.Handler.handleCallback(Handler.java:587)
E/MyTracks( 4654): at android.os.Handler.dispatchMessage(Handler.java:92)
E/MyTracks( 4654): at android.os.Looper.loop(Looper.java:123)
E/MyTracks( 4654): at android.os.HandlerThread.run(HandlerThread.java:60)
D/MyTracks( 4654): GData error encountered: null
D/MyTracks( 4654): Retrying due to auth failure <<<<<<<<<<<---------------
The keys are the lines with the arrow on them.
Arrow 1: Note that the message is null, but the status code is 401. In the log
which started this bug, we're ignoring the null message and driving on. Also
in that initial log, we see that GData error encountered null (which means that
the message was null, since the GData error message comes from the
HttpException message in this case.
Arrow 2: Now that we're looking at the status code, we see it recognizing the
auth error and retrying. In the initial log, we don't recognize the auth
failure, and go back into the normal retry, which fails, since we haven't
invalidated and refreshed the token.
The fix for this issue is in simmonmt-staging5
Original comment by simmonmt@google.com
on 10 Feb 2011 at 2:16
I figured out the problem. During the changeover from one GData library to
another, and the associated changes in the HttpException, the processing of
auth token expirations was broken. This is particularly hard to test, since
tokens expire every 14 days. Anyway, we were looking for the token in the
message, which is now null, when we should've been reading the status code
directly.
Here's a sample log from a guinea pig, to whom we are forever grateful:
D/MyTracks( 4654): SendToDocs: Uploading to spreadsheet
D/MyTracks( 4654): GData connection prepared:
com.google.android.apps.mytracks.io.ModernAuthManager@40599cc0
W/DefaultRequestDirector( 4654): Authentication error: Unable to respond to any
of these challenges: {googlelogin=WWW-Authenticate: GoogleLogin
realm="http://www.google.com/accounts/ClientLogin", service="writely"}
E/MyTracks( 4654): HttpException, code 401 message null
<<<<-------------
E/MyTracks( 4654):
com.google.android.apps.mytracks.io.gdata.GDataWrapper$HttpException
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.docs.DocsHelper$2.query(DocsHelper.java:198)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.docs.DocsHelper$2.query(DocsHelper.java:1)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.gdata.GDataWrapper.runOne(GDataWrapper.java:
198)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.gdata.GDataWrapper.runCommon(GDataWrapper.ja
va:171)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.gdata.GDataWrapper.runQuery(GDataWrapper.jav
a:162)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.docs.DocsHelper.requestSpreadsheetId(DocsHel
per.java:172)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs.uploadToDocs(SendToDocs.java:193)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs.doUpload(SendToDocs.java:123)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs.access$0(SendToDocs.java:101)
E/MyTracks( 4654): at
com.google.android.apps.mytracks.io.SendToDocs$1.run(SendToDocs.java:96)
E/MyTracks( 4654): at android.os.Handler.handleCallback(Handler.java:587)
E/MyTracks( 4654): at android.os.Handler.dispatchMessage(Handler.java:92)
E/MyTracks( 4654): at android.os.Looper.loop(Looper.java:123)
E/MyTracks( 4654): at android.os.HandlerThread.run(HandlerThread.java:60)
D/MyTracks( 4654): GData error encountered: null
D/MyTracks( 4654): Retrying due to auth failure <<<<<<<<<<<---------------
The keys are the lines with the arrow on them.
Arrow 1: Note that the message is null, but the status code is 401. In the log
which started this bug, we're ignoring the null message and driving on. Also
in that initial log, we see that GData error encountered null (which means that
the message was null, since the GData error message comes from the
HttpException message in this case.
Arrow 2: Now that we're looking at the status code, we see it recognizing the
auth error and retrying. In the initial log, we don't recognize the auth
failure, and go back into the normal retry, which fails, since we haven't
invalidated and refreshed the token.
The fix for this issue is in simmonmt-staging5
Original comment by simmonmt@google.com
on 10 Feb 2011 at 2:46
Original comment by simmonmt@google.com
on 10 Feb 2011 at 3:00
Original comment by simmonmt@google.com
on 10 Feb 2011 at 9:24
Attachments:
Tested the APK above and it works. First uploaded to Docs alone, the to Fusion
Tables and Docs. I didn't have the "My Tracks" Spreadsheet before, so it got
ceated in the first run. In the second rund, a second row has been added as
expected.
Only thing I notice is that the fusion table URL is missing in the "Map"
column. But that should be another issue, I think.
HTC Desire, Android 2.2
Original comment by marian.s...@gmail.com
on 10 Feb 2011 at 10:45
Original issue reported on code.google.com by
simmonmt@google.com
on 9 Feb 2011 at 5:43Attachments: