Google Drive returns 503 error on uploading file with non-ascii title

171 views
Skip to first unread message

ko...@coconut-trail.com

unread,
Jun 30, 2013, 3:08:19 AM6/30/13
to google-api-obj...@googlegroups.com
Since 27 June, Google Drive suddenly starts returning 503 error on uploading a file with non-ascii title.

The detail of the problem is
  1. The problem only lies on title. The content of the main text doesn't matter.
  2. However, title only update works fine with non-ascii characters.
  3. Both on "title and text" or "text" update / insert, the 503 error always occurs.
  4. "Client Library for Python" works fine. It seems iOS environment related issue.
I have verified the issue with 4 apps. Our app, another app which seems using Google Drive SDK and two sample code (DriveSample and DrEdit) from Google. All results in 503 error. I enclosed the picture of the sample apps for your information.

How to reproduce the problem on DrEdit Sample is this,
  1. Download the latest DrEdit and compile it as instructed (You need Client/Secret Key)
  2. Open new document and set title with non-ascii characters (I used "日本語").
  3. Fill in the main text.
  4. Tap save button on the right-top.
I also checked the URL the client library accesses.

Python:
Objective-C:
Python's URL is the documented URL on Google Drive SDK Documentation.
However, Objective-C's is not. It is undocumented one.

I wonder why the library does not use the documented one. If the problem is on the server side, it might be related to the cause.

Does anybody have the same problem with the Client LIbrary?
Could somebody look into the problem?

Any help is welcome. Thanks!

ko...@coconut-trail.com

unread,
Jul 1, 2013, 12:37:01 AM7/1/13
to google-api-obj...@googlegroups.com
I figured out the cause of the problem is JSON parsing.

I looked into the difference between the insert request of python's and objective-c's.
Python's one seems ensure_ascii encoded (simplejson's default) but the objective-c's is not. It is written in UTF-8.

Then, I checked GTLJsonParser and found it mainly uses NSJSONSeriarlization or SBJsonParser inside.
Both of them only supports UTF-8 output. No ascii option.

So, I changed a few part of the library code to make all the JSON serialization ensure_ascii like python does.
It works fine and the problem looks vanished.

However, I am not very sure if changing all the JSON serialization to ensure_ascii ones is okay or not.
Could somebody check my code? If there is a potential risk, please tell me of it.

I have created a fork of DrEdit with the fix on GitHub. The url is below.


Any help is welcome. Thanks in advance!

Greg Robbins

unread,
Jul 1, 2013, 10:11:05 PM7/1/13
to google-api-obj...@googlegroups.com
Thank you for reporting the issue. The API server engineers are investigating the problem. The internal Google bug number for this issue is 9660366.

ko...@coconut-trail.com

unread,
Jul 1, 2013, 11:29:37 PM7/1/13
to google-api-obj...@googlegroups.com
Hi Greg,

Thank you for your reply. I will wait for the result of the investigation.
Message has been deleted

ko...@coconut-trail.com

unread,
Jul 5, 2013, 4:04:49 AM7/5/13
to google-api-obj...@googlegroups.com
The problem seems fixed on the server side on 3 July 21:30 PDT.
Thank you for your fast work.
Reply all
Reply to author
Forward
0 new messages