Issue 481 in gdata-python-client: InsertRow gives 400 bad request

195 views
Skip to first unread message

gdata-pyt...@googlecode.com

unread,
Dec 23, 2010, 1:22:20 PM12/23/10
to gdata-python-client-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 481 by abhishek.kona: InsertRow gives 400 bad request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

steps will reproduce the problem [I am on a mac]
1. Using a google app account, by setting gd_client.domain = xyz.com
2.Using the same example ListInsertAction as provided in the example.

The data should be inserted in the spreadsheet but I see {'status':
400, 'body': 'Invalid query parameter value for grid-id.', 'reason': 'Bad
Request'}


gdata-pyt...@googlecode.com

unread,
Jan 20, 2011, 3:09:39 PM1/20/11
to gdata-python-client-...@googlegroups.com
Updates:
Status: Feedback

Comment #1 on issue 481 by joe.gregorio: InsertRow gives 400 bad request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

Can you provide sample code that replicates this problem?

gdata-pyt...@googlecode.com

unread,
Jan 21, 2011, 10:51:15 AM1/21/11
to gdata-python-client-...@googlegroups.com

Comment #2 on issue 481 by jer...@arroki.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

This appears eerily similar to a problem I reported a couple of days ago on
apps-api-issues (Issue 2381); it's possible that it's an issue with the
Python client, but I don't think so, since it works with non-Hosted—i.e.,
Google—accounts.

That issue (and the steps required to reproduce it) are posted here:


http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2381

Sample code is fairly simple: it can be reproduced using the unmodified
sample code bundled with the gdata Python client.

gdata-pyt...@googlecode.com

unread,
Mar 7, 2011, 10:23:49 AM3/7/11
to gdata-python-client-...@googlegroups.com
Updates:
Status: Closed

Comment #3 on issue 481 by joe.gregorio: InsertRow gives 400 bad request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

This is an issue with the Apps API.

gdata-pyt...@googlecode.com

unread,
Apr 14, 2011, 4:57:40 AM4/14/11
to gdata-python-client-...@googlegroups.com

Comment #4 on issue 481 by guido.se...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

Hi Joe,
is there a bug open against the Apps API? Can you reference it here, please?

Cause this closed... but I have no visibility on the issue... is it being
fixed?

regards,
G.

p.s. my code, if you want to reproduce...
http://bazaar.launchpad.net/~zeph1ro/berliner/trunk/view/head:/berliner/gdatalib.py


guserra@4DEL06116:~/tmp/berliner$ ./y_fetch|./g_write
('EURUSD=X', '1.4441')
('EURCHF=X', '1.2941')
('EURGBP=X', '0.8878')
- username: guido.serra
- password:

gdata.service.RequestError: {'status': 400, 'body': 'We're sorry, a
server error occurred. Please wait a bit and try reloading your
spreadsheet.', 'reason': 'Bad Request'}


gdata-pyt...@googlecode.com

unread,
Apr 20, 2011, 10:56:27 AM4/20/11
to gdata-python-client-...@googlegroups.com

Comment #5 on issue 481 by enab...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

Same error trying to insert a row into spreadsheet using gdata. Code
similar to that listed in earlier examples.

gdata-pyt...@googlecode.com

unread,
Apr 27, 2011, 3:09:48 PM4/27/11
to gdata-python-client-...@googlegroups.com
Updates:
Status: Feedback

Comment #6 on issue 481 by vicfry...@google.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

can you set gd_client.debug = True and paste the HTTP output you get when
reproducing the 400?

gdata-pyt...@googlecode.com

unread,
Apr 28, 2011, 1:05:22 PM4/28/11
to gdata-python-client-...@googlegroups.com

Comment #7 on issue 481 by guido.se...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

here you go...
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


grinder:berliner zeph$ ./y_fetch|./g_write
('EURUSD=X', '1.4773')
('EURCHF=X', '1.2938')
('EURGBP=X', '0.8885')
- username: guido.serra
- password:
send: 'POST https://www.google.com/accounts/ClientLogin
HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:
www.google.com\r\nContent-Length: 88\r\nContent-Type:
application/x-www-form-urlencoded\r\n\r\n'
send: 'Passwd=l1ste.%2F&source=None&service=wise&Email=guido.serra&accountType=HOSTED_OR_GOOGLE'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: text/plain
header: Cache-control: no-cache, no-store
header: Pragma: no-cache
header: Expires: Mon, 01-Jan-1990 00:00:00 GMT
header: Date: Thu, 28 Apr 2011 17:03:22 GMT
header: X-Content-Type-Options: nosniff
header: X-XSS-Protection: 1; mode=block
header: Content-Length: 755
header: Server: GSE
send: 'POST
https://spreadsheets.google.com/feeds/worksheets/0AswUaQ1cS3dDdG8yTk8yWjNzUVktRHI0OXUwRTBBemc/private/full
HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:
spreadsheets.google.com\r\nContent-Length: 307\r\nContent-Type:
application/atom+xml\r\nAuthorization: GoogleLogin
auth=DQAAAKYAAAAAoBDfbvA-oxBv7nStvgGR2lmdIVdpOwlMNIrc5RxgZtrhGiAH7kvgjvuh4Ue23RxGNnl25tWP2qciISn1S_w_pPvv6kaYp0JVtG2qGkG0HrcYMc0YP3jYldYPu2Q6zbvh-yZ5oqDZHUtSxThMsOSoNvSkVKxtZshTUUgc1QGuJKEnDVQABtqcuC-DdnzCAvlwclMHyOsMNyEcwi3yOLdTQh2NB7Vit0-pztAtZvhhMA\r\nUser-Agent:
None GData-Python/2.0.14\r\n\r\n'
send: '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<ns0:entry
xmlns:ns0="http://www.w3.org/2005/Atom"><ns1:rowCount
xmlns:ns1="http://schemas.google.com/spreadsheets/2006">3</ns1:rowCount><ns0:title>2011-04-28</ns0:title><ns1:colCount
xmlns:ns1="http://schemas.google.com/spreadsheets/2006">2</ns1:colCount></ns0:entry>'
reply: 'HTTP/1.1 201 Created\r\n'
header: Content-Type: application/atom+xml; charset=UTF-8
header: Expires: Thu, 28 Apr 2011 17:03:23 GMT
header: Date: Thu, 28 Apr 2011 17:03:23 GMT
header: Cache-Control: private, max-age=0, must-revalidate, no-transform
header: Vary: Accept, X-GData-Authorization, GData-Version
header: GData-Version: 1.0
header: Location:
https://spreadsheets.google.com/feeds/worksheets/0AswUaQ1cS3dDdG8yTk8yWjNzUVktRHI0OXUwRTBBemc/private/full/ocs/0
header: Content-Location:
https://spreadsheets.google.com/feeds/worksheets/0AswUaQ1cS3dDdG8yTk8yWjNzUVktRHI0OXUwRTBBemc/private/full/ocs/0
header: X-Content-Type-Options: nosniff
header: X-Frame-Options: SAMEORIGIN
header: X-XSS-Protection: 1; mode=block
header: Server: GSE
header: Transfer-Encoding: chunked
{'value': '1.2938', 'trade': 'EURCHF=X'}
send: 'POST
https://spreadsheets.google.com/feeds/list/0AswUaQ1cS3dDdG8yTk8yWjNzUVktRHI0OXUwRTBBemc/ocs/private/full
HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:
spreadsheets.google.com\r\nContent-Length: 292\r\nContent-Type:
application/atom+xml\r\nAuthorization: GoogleLogin
auth=DQAAAKYAAAAAoBDfbvA-oxBv7nStvgGR2lmdIVdpOwlMNIrc5RxgZtrhGiAH7kvgjvuh4Ue23RxGNnl25tWP2qciISn1S_w_pPvv6kaYp0JVtG2qGkG0HrcYMc0YP3jYldYPu2Q6zbvh-yZ5oqDZHUtSxThMsOSoNvSkVKxtZshTUUgc1QGuJKEnDVQABtqcuC-DdnzCAvlwclMHyOsMNyEcwi3yOLdTQh2NB7Vit0-pztAtZvhhMA\r\nUser-Agent:
None GData-Python/2.0.14\r\n\r\n'
send: '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<ns0:entry
xmlns:ns0="http://www.w3.org/2005/Atom"><ns1:value
xmlns:ns1="http://schemas.google.com/spreadsheets/2006/extended">1.2938</ns1:value><ns1:trade
xmlns:ns1="http://schemas.google.com/spreadsheets/2006/extended">EURCHF=X</ns1:trade></ns0:entry>'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Content-Type: text/html; charset=UTF-8
header: Date: Thu, 28 Apr 2011 17:03:24 GMT
header: Expires: Thu, 28 Apr 2011 17:03:24 GMT
header: Cache-Control: private, max-age=0
header: X-Content-Type-Options: nosniff
header: X-Frame-Options: SAMEORIGIN
header: X-XSS-Protection: 1; mode=block
header: Server: GSE
header: Transfer-Encoding: chunked
Traceback (most recent call last):
File "./g_write", line 23, in <module>
status = not main(sys.argv)
File "./g_write", line 19, in main
excel.write(data)
File "/Users/zeph/tmp/berliner/berliner/gdatalib.py", line 57, in write
entry = self.gd_client.InsertRow(trow, self.curr_key, curr_wksht_id)
File "/Users/zeph/tmp/berliner/gdata/spreadsheet/service.py", line 339,
in InsertRow
converter=gdata.spreadsheet.SpreadsheetsListFromString)
File "/Users/zeph/tmp/berliner/gdata/service.py", line 1236, in Post
media_source=media_source, converter=converter)
File "/Users/zeph/tmp/berliner/gdata/service.py", line 1358, in PostOrPut
'reason': server_response.reason, 'body': result_body}

gdata-pyt...@googlecode.com

unread,
Apr 28, 2011, 1:09:27 PM4/28/11
to gdata-python-client-...@googlegroups.com

Comment #8 on issue 481 by guido.se...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

sure, here you go...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

grinder:berliner zeph$ ./y_fetch|./g_write
('EURUSD=X', '1.4773')
('EURCHF=X', '1.2938')
('EURGBP=X', '0.8885')

- username: #######me#######


- password:
send: 'POST https://www.google.com/accounts/ClientLogin
HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:
www.google.com\r\nContent-Length: 88\r\nContent-Type:
application/x-www-form-urlencoded\r\n\r\n'

send: 'Passwd=#########&source=None&service=wise&Email=#######me#######&accountType=HOSTED_OR_GOOGLE'


reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: text/plain
header: Cache-control: no-cache, no-store
header: Pragma: no-cache
header: Expires: Mon, 01-Jan-1990 00:00:00 GMT
header: Date: Thu, 28 Apr 2011 17:03:22 GMT
header: X-Content-Type-Options: nosniff
header: X-XSS-Protection: 1; mode=block
header: Content-Length: 755
header: Server: GSE
send: 'POST
https://spreadsheets.google.com/feeds/worksheets/0AswUaQ1cS3dDdG8yTk8yWjNzUVktRHI0OXUwRTBBemc/private/full
HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:
spreadsheets.google.com\r\nContent-Length: 307\r\nContent-Type:
application/atom+xml\r\nAuthorization: GoogleLogin

auth=################\r\nUser-Agent: None GData-Python/2.0.14\r\n\r\n'

auth=#####################\r\nUser-Agent: None GData-Python/2.0.14\r\n\r\n'

gdata-pyt...@googlecode.com

unread,
Apr 28, 2011, 1:13:32 PM4/28/11
to gdata-python-client-...@googlegroups.com

Comment #9 on issue 481 by guido.se...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

p.s. the code is here, if you want to play ;-)

http://bazaar.launchpad.net/~zeph1ro/berliner/trunk/revision/25

gdata-pyt...@googlecode.com

unread,
May 4, 2011, 8:52:17 AM5/4/11
to gdata-python-client-...@googlegroups.com

Comment #10 on issue 481 by tomer...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

any update on this? i'm having the same issue

gdata-pyt...@googlecode.com

unread,
May 20, 2011, 10:41:49 AM5/20/11
to gdata-python-client-...@googlegroups.com

Comment #11 on issue 481 by cle...@bucknell.edu: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

I was running into this problem but it turned out to be the uppercase
column name problem discussed here:
http://code.google.com/p/gdata-python-client/issues/detail?id=363#c2
Changing to lowercase column names worked for me.

gdata-pyt...@googlecode.com

unread,
May 20, 2011, 11:32:49 AM5/20/11
to gdata-python-client-...@googlegroups.com

Comment #12 on issue 481 by guido.se...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

hi, there are no upper case column names involved in my scenario...

Existing document > I create a new worksheet > I create the row

column names are "trade" and "value", in lower case

gdata-pyt...@googlecode.com

unread,
May 25, 2011, 6:54:36 PM5/25/11
to gdata-python-client-...@googlegroups.com

Comment #13 on issue 481 by erikwick...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

Just wanted to report that I found the solution.

This bug only seems to occur with *blank* spreadsheets. If I go into the
spreadsheet via the web UI, and add the header columns manually -- then I'm
able to successfully add the data using gdata.

I had been creating a blank spreadsheet using the instructions here:
http://code.google.com/apis/documents/docs/1.0/developers_guide_python.html#CreatingAnEmptyDocument

The trick to make this work, is to add the header row first with the "Cell
Based Feed" api:
http://code.google.com/apis/spreadsheets/data/1.0/developers_guide_python.html#updateCell

Then, use the Row api to add the rest of your data. Works like a charm! :-)

gdata-pyt...@googlecode.com

unread,
May 31, 2011, 7:22:41 AM5/31/11
to gdata-python-client-...@googlegroups.com

Comment #14 on issue 481 by commonze...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

thanks Erik, i have been struggling with the same problem

gdata-pyt...@googlecode.com

unread,
Oct 7, 2011, 10:30:36 AM10/7/11
to gdata-python-client-...@googlegroups.com
Updates:
Labels: Component-Spreadsheets

Comment #15 on issue 481 by afs...@google.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

(No comment was entered for this change.)

gdata-pyt...@googlecode.com

unread,
Feb 7, 2012, 6:17:20 PM2/7/12
to gdata-python-client-...@googlegroups.com

Comment #16 on issue 481 by spo...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

any plans on fixing this?

gdata-pyt...@googlecode.com

unread,
Aug 14, 2013, 2:34:06 AM8/14/13
to gdata-python-client-...@googlegroups.com

Comment #17 on issue 481 by novojilo...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

I found that server returns 400 when there are ^[a..z] in column names
even _ problematic..
Seems an XML issue

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

gdata-pyt...@googlecode.com

unread,
Oct 9, 2013, 5:55:53 AM10/9/13
to gdata-python-client-...@googlegroups.com

Comment #18 on issue 481 by PaulCati...@gmail.com: InsertRow gives 400 bad
request
http://code.google.com/p/gdata-python-client/issues/detail?id=481

Thank you erickwick!!

gdata-pyt...@googlecode.com

unread,
Jan 7, 2015, 8:29:11 PM1/7/15
to gdata-python-client-...@googlegroups.com

Comment #19 on issue 481 by mkhan1...@gmail.com: InsertRow gives 400 bad
request
https://code.google.com/p/gdata-python-client/issues/detail?id=481

Is this issue going to ever get fixed?
Reply all
Reply to author
Forward
0 new messages