getting If-Match or If-None-Match header required (on batch update) #103

Open
GoogleCodeExporter opened this Issue Apr 6, 2015 · 37 comments

Comments

Projects
None yet
1 participant
What steps will reproduce the problem?
1. Run cell demo from the demo spreadsheet demo
2. Selected an empty spreadsheet from my account in it. 
3. Run the batch command entered a command such as "set 1 3 test"
4. command: submit

What is the expected output? What do you see instead?

I expect it to update the sheet.  However, i get this instead:
R1C3 failed (If-Match or If-None-Match header required) null



What version of the product are you using? On what operating system?
1.29

Please provide any additional information below.

Original issue reported on code.google.com by mela...@gmail.com on 15 Jan 2009 at 6:29

I am getting the sameresult --- running on Windows XPSP3 with Java 6.

Original comment by rficcag...@gmail.com on 3 Feb 2009 at 6:49

Yes this is an issue in the sample.  Thanks for reporting.

This seems to be a spreadsheets api server issue.  We are investigating this
(internal bug tracker id: 1641977).   You can explicitly set the service 
version to
v1 using the following statement:
this.service.setProtocolVersion(SpreadsheetService.Versions.V1);

unfortunately there is another data model bug which is blocking the above 
workaround
as well.  This issue will be fixed in the next java client release (expected 
this week).

Summary: with this week's release of java client lib, you should be able to use 
the
above workaround to do batch operations.


Original comment by vbarat...@gmail.com on 10 Feb 2009 at 4:29

  • Changed state: Started
Issue 102 has been merged into this issue.

Original comment by vbarat...@gmail.com on 11 Feb 2009 at 9:12

The latest version of the Java client (version 1.30) was launched on Feb 11th.  
Could
you try the workaround described above?  Let us know our results.  In the 
meantime,
there is an internal bug (#1641977) on this issue.  Thanks!

Original comment by mon...@gmail.com on 6 Mar 2009 at 7:36

I am trying to batch delete contacts using latest v2(gdata-java-1.30.0) of the 
API,
the same was working well with v1. None of the contacts in batch are getting 
deleted.
I am getting failure reason as

Attribute reason='If-Match or If-None-Match header required'

Following is near by log details, 

20 Mar, 2009 1:07:46 AM com.google.gdata.util.XmlParser startElement
FINE: Start element batch:status
20 Mar, 2009 1:07:46 AM com.google.gdata.util.XmlParser startElement
FINER: Attribute reason='If-Match or If-None-Match header required'
20 Mar, 2009 1:07:46 AM com.google.gdata.util.XmlParser startElement
FINER: Attribute code='403'
20 Mar, 2009 1:07:46 AM com.google.gdata.util.XmlParser endElement
FINE: End element batch:status

Original comment by abhinavgupta697 on 20 Mar 2009 at 8:24

Abinav,
    This is a server-side bug which is causing v2 batch requests to fail.  We are
working on a fix.  In the meantime please use v1.  To do so use:
service.setProtocolVersion(SpreadsheetService.Versions.V1);

Original comment by vbarat...@gmail.com on 20 Mar 2009 at 1:04

Hi,

I am having the same issue while trying to batch delete with the .Net version 
of the API.

Attribute reason='If-Match or If-None-Match header required'

Regards

Tim

Original comment by tjcar...@gmail.com on 3 Sep 2009 at 6:02

Hi,

I'm getting the same error.
I use the official google example:
http://code.google.com/intl/de-DE/apis/calendar/data/2.0/developers_guide_java.h
tml#DeletingEvents

To work around the issue I must use:
myService.setProtocolVersion(CalendarService.Versions.V1);

Original comment by icebee...@egotec.com on 21 Oct 2009 at 2:36

icebeer:
    can you paste the snippet of problematic code where you create the entries
included in the batch request.

Please check:
* If you are setting the Etag (entry.setEtag()) on the entry that is included 
in the
batch request.

Original comment by vbarat...@gmail.com on 21 Oct 2009 at 3:12

Hi,

Has this been fixed yet?

Get the same with deletes or updates. Please help

Regards

Tim

Original comment by tjcar...@gmail.com on 1 Dec 2009 at 4:10

Tim,
    How are you deleting the entry?  If you include the etag attribute in the delete 
request, you shouldnt be seeing this problem.    Please paste the snippet of 
code 
containing the DELETE call.


Original comment by vbarat...@gmail.com on 1 Dec 2009 at 12:37

  • Changed state: RequestedFeedback
I am also getting the same error when doing a batch update on cell feed 
following the
example given in
http://code.google.com/apis/spreadsheets/data/3.0/developers_guide_java.html#Sen
dingBatchRequests
The first cell received a "A1 failed (If-Match or If-None-Match header required)
null" error and the rest of the cells in the same batch got error similar to "B1
failed (Internal Error) null". I am using the latest libraries (spreadsheet 3.0)
downloaded. My other project using spreadsheet 1.0 (libraries downloaded last 
year)
was able to update the spreadsheet without any problem.

I tried the suggestion mentioned above to use set the service to V1, the first 
cell
now received "A1 failed (Missing resource version ID) null" error and the rest 
have
the same errors as above.

The attached are the comparisons of the libraries I am using for the old and 
new project.


Thanks,
Kiat

Original comment by HuanK...@gmail.com on 30 Dec 2009 at 10:49

Attachments:

try to define protocol version earlier in the code. replacing it just after
authorization procedure have helped me fine. ike this:

spreadsheetService.setUserCredentials(gmail_login, gmail_password);     
spreadsheetService.setProtocolVersion(SpreadsheetService.Versions.V1);

Original comment by Drozd.Ul...@gmail.com on 6 Apr 2010 at 11:11

Is the (server-side?) "internal bug" #1641977 supposed to be fixed by now?

Original comment by c.langre...@gmail.com on 16 Apr 2010 at 6:06

I can confirm that is has NOT been fixed. I am using version 3.0 of the Java 
client.
The workaround still works.

Original comment by moincree...@gmail.com on 26 Apr 2010 at 12:20

I can confirm that it has NOT been fixed. I am using GData java client libeary 
version 1.41.4. The workaround still works.

Original comment by dhava...@gmail.com on 19 Aug 2010 at 3:57

I can confirm that it has NOT been fixed. I am using gdata-2.0.10. The 
workaround still works.

Original comment by gongjing...@gmail.com on 19 Aug 2010 at 10:51

An alternative workaround that work for me is to use:
googleCalendarService.delete(deleteUrl, "*");
instead of just
googleCalendarService.delete(deleteUrl);

Original comment by confess2...@gmail.com on 16 Sep 2010 at 12:30

[deleted comment]
[deleted comment]
Just wanted to confirm that I receive the same error with a batch update using 
version 3. When I specify version 1 the error goes away. Any real fixes other 
than this workaround?

Original comment by j.casey....@gmail.com on 2 Jun 2011 at 5:01

Still broken.  I worked around it by passing doing this:

 service.setHeader("If-Match", "*");
 batchResponse = service.batch(new URL(batchLink.getHref()), batchRequest);
 service.setHeader("If-Match", null);


Original comment by jatw...@linuxstuff.org on 3 Jul 2011 at 12:26

Thanks jatw, that fixed it for me!

Original comment by dcas...@gmail.com on 27 Aug 2011 at 2:47

Also to me... Thanks

Original comment by filippo....@sinesy.it on 8 Sep 2011 at 2:16

Why is this still not addressed in v3? Are we using the api incorrectly that it 
causes such error?

Original comment by TimRys...@gmail.com on 9 Nov 2011 at 6:27

Same issue for me trying to update just a single cell with a PUT request. I 
added the If-Match header (not using a library so just added it to the bare 
http request) as suggested by Jatw, and it worked. This is 2012 and this issue 
was opened in 2009. Guess not many people use this api.

Original comment by mr.j...@gmail.com on 19 Jan 2012 at 11:40

April and it still has not been fixed?!

Original comment by tunys...@gmail.com on 6 Apr 2012 at 12:12

It's November 2012 and the issue remains =) for 
https://developers.google.com/google-apps/spreadsheets/#updating_multiple_cells_
with_a_batch_request

Original comment by jakob.do...@gmail.com on 8 Nov 2012 at 3:59

yes. the issue still remains. Jatw's workaround works though. Thanks Jatw !

Original comment by yogesh.m...@gmail.com on 27 Nov 2012 at 9:50

issue still remains. annoying.

Original comment by andy.woo...@gmail.com on 16 Dec 2012 at 6:31

Same here!
Tks to jatw for saving me some pain!
Adding "If-Match: *" to the header solve the problem.
Ouf.

Original comment by prof.leb...@gmail.com on 12 Feb 2013 at 8:34

Thanks Jatw! The issue still remains as Aug 2013.

Original comment by fferre...@gmail.com on 30 Aug 2013 at 1:34

11 Dec 2013 and the problem still remains :(
Tryt to fix it myself (Java sdk)

Original comment by roland.b...@arcus-business.com on 11 Dec 2013 at 12:37

[deleted comment]
This bug started appearing in the Python SDK in the last few months. Very ver 
annoying, and it is not even getting resolved by adding the If-Match: * 
header... Sigh

Original comment by ska...@gmail.com on 8 Jun 2014 at 7:09

The ticket for the Python bug has a temporary workaround:

http://code.google.com/p/gdata-python-client/issues/detail?id=700

Original comment by joseph.d...@gmail.com on 2 Jul 2014 at 1:47

same error exists with batch update for V3.

Original comment by ankit.si...@m.darcl.com on 23 Jan 2015 at 6:21

wired8 referenced this issue in theoephraim/node-google-spreadsheet Jan 27, 2016

Closed

Fix for bulk deleting data: Way to clear entire sheet? #45 #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment