ravipatidar54 / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Exception-Precondition failed #222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Updating an event in google calendar through code is throwing the following 
exception frequently
{The request 'Google.Apis.Requests.Request(update @ 
//www.googleapis.com/calendar/v3/calendars/<calendarId>/events/<eventid>?alt=jso
n&prettyPrint=true">https://www.googleapis.com/calendar/v3/calendars/<calendarId
>/events/<eventid>?alt=json&prettyPrint=true 
[//www.googleapis.com/calendar/v3/calendars/<calendarId>/events/<eventid>?alt=js
on&prettyPrint=true" target="_blank">)' has failed. The service calendar has 
thrown an exception: Google.GoogleApiRequestException: 
Google.Apis.Requests.RequestError
Precondition Failed [412]
Errors [
    Message[Precondition Failed] Location[If-Match - header] Reason[conditionNotMet] Domain[global]
]

When i try to update the event again it updates sucessfully.
2.
3.

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

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

The Api dll version is 1.1.4344.23403.Operating System is Windows Sever 2003 r2.
Please provide any additional information below.

The situation is same as explained in the following forum
https://groups.google.com/forum/#!topic/google-calendar-api/qQFXcCSQD9k.Since 
this is a random issue,sync with Google calendar is not always a success.

Thanks,
Sreedevi

Original issue reported on code.google.com by sreedevi...@gmail.com on 15 Jun 2012 at 6:47

GoogleCodeExporter commented 9 years ago
In some other forums,I found that 'update' method requires all the 
information.So it is better to use the 'patch' method.So i tried with patch 
instead of update.At that time ,converting a short day event to all day and 
vice versa is throwing error .
The exception is
The request 'Google.Apis.Requests.Request(patch @ 
https://www.googleapis.com/calendar/v3/calendars/<calendarId>/events/<eventId>?a
lt=json&prettyPrint=true)' has failed. The service calendar has thrown an 
exception: Google.GoogleApiRequestException: Google.Apis.Requests.RequestError
Invalid or mismatching start and end times. [400]
Errors [
    Message[Invalid or mismatching start and end times.] Location[ - ] Reason[invalid] Domain[global]
]
 ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Google.Apis.Requests.Request.InternalEndExecuteRequest(IAsyncResult asyncResult)

When I am using the 'update' method,the conversion from allday to short day 
event is working fine

Thanks,
Sreedevi

Original comment by sreedevi...@gmail.com on 15 Jun 2012 at 7:59

GoogleCodeExporter commented 9 years ago
old old issue with old classes.
If you still find this problem in the new code, please feel free to reopen this 
issue.

Original comment by pele...@google.com on 8 Dec 2013 at 5:45