OutlookGoogleCalendarSync icon indicating copy to clipboard operation
OutlookGoogleCalendarSync copied to clipboard

"Precondition Failed [412]" error on every sync

Open panzner opened this issue 6 years ago • 64 comments

Just been directed here by OGCS? Please read:-

:memo: This issue has been long running but a resolution is close! ~~There are reports (here, and #1052) that it is caused by multiple version of OGCS running, but further troubleshooting is needed~~

:bulb: If you encounter this error, please apply hotfix v2.9.5.7 - make sure you are already running at least v2.9.5.0 first

:paperclip: After applying the hotfix and you hit this error, please provide your OGcalsync.log file (see instructions).


Expand Original Post

OGCS Version: v2.7.4.0
Installed or Portable: Installed

Problem Description
Each time a sync runs, it produces the following error message -- twice -- after "Comparing ### existing Google calendar entries":

"Updated event failed to save. Precondition Failed [412=PreconditionFailed]"

Each time the failure message occurs it produces a "Sync item failed" popup that that requires a "Yes" or "No" answer to the question: "Updated Google event exception failed to save. Continue with synchronization?"

Whether I answer yes or no to the two popups, the process finishes and I get the message: "Sync finished with success!"

[deleted]

Steps to Reproduce the Issue

  1. Sync - manually or automatically

Any other information
Didn't seem to happen several versions/months ago, now happens each time

panzner avatar May 22 '18 17:05 panzner

This issue is seven days old and those that were posted both before and after it seem to be in the process of being addressed. Has there been any diagnosis in this case?

panzner avatar May 30 '18 01:05 panzner

I'm struggling to replicate the issue to be honest, but could you apply this hotfix v2.7.4.4.zip (see instructions for applying) and re-upload you logfile at FINE level again.

Also, when you start up OGCS, could you confirm the log file lines you have for:

2018-05-31 19:51:05,203 INFO  9 OutlookGoogleCalendarSync.Settings [481] -  ENVIRONMENT:-
2018-05-31 19:51:05,203 INFO  9 OutlookGoogleCalendarSync.Settings [482] -    Current Locale: en-GB
2018-05-31 19:51:05,203 INFO  9 OutlookGoogleCalendarSync.Settings [483] -    Short Date Format: dd/MM/yyyy
2018-05-31 19:51:05,203 INFO  9 OutlookGoogleCalendarSync.Settings [484] -    Short Time Format: HH:mm

Thanks!

:link: Issue #519

phw198 avatar May 31 '18 21:05 phw198

I tried your suggestions, including the hotfix, but no luck. Here are those log entries you requested:

2018-06-01 09:53:23,775 INFO  1 OutlookGoogleCalendarSync.Settings [0] -  ENVIRONMENT:-
2018-06-01 09:53:23,775 INFO  1 OutlookGoogleCalendarSync.Settings [0] -    Current Locale: en-US
2018-06-01 09:53:23,775 INFO  1 OutlookGoogleCalendarSync.Settings [0] -    Short Date Format: MM/dd/yy
2018-06-01 09:53:23,775 INFO  1 OutlookGoogleCalendarSync.Settings [0] -    Short Time Format: h:mm tt

Also, I seem to have multiple log files -- is that what is supposed to happen after a sync?

[deleted]

panzner avatar Jun 01 '18 14:06 panzner

The names of the log files I have after the latest run, for example, are:

OGcalsync.log OGcalsync.log.1 OGcalsync.log.2

I tried uploading all three, but Github didn't like the format of those file extensions. Would you like me to rename the latter two and upload them as well?

panzner avatar Jun 01 '18 14:06 panzner

Multiple logs are expected, yes. The main one only grows to a certain size before spawning a new file with sequential numbers. However, I don't think I need the additional logs at this point.

:package: Please could you apply v2.7.4.6.zip and let me know how it goes.

phw198 avatar Jun 02 '18 14:06 phw198

I tried the 2.7.4.6 hotfix. The good news is that the old error is gone. The bad new is that there is a new error in its place (at exactly the same location in the Sync run). Here is the text:

Updated event exception failed to save. Invalid sequence value. The specified sequence number is below the current sequence number of hte resource. Re-fetch the resource and use its sequence number on the following request. [400=BadRequest]

[deleted]

panzner avatar Jun 04 '18 13:06 panzner

:slightly_frowning_face: It was a bit of a long shot, but was hoping a simpler approach of just "force the update" might work.

I'll have to go back and look at re-retrieving the object, re-applying the changes and re-saving. Which is really frustrating as in the code, I've only just retrieved all the occurrences of the series (all 230 of them), so there really should have been no changes before OGCS tries to make the update. :confused:

phw198 avatar Jun 04 '18 14:06 phw198

Thank you. Not sure what changed in terms of the recent versions, but I didn't used to have this issue in the past.

Anyway, sorry about this and appreciate your efforts. It is a helpful program, especially for those who prefer to have their personal stuff segregated from work-related stuff.

panzner avatar Jun 04 '18 16:06 panzner

I thought it only fair to say that the program suddenly seems to be working fine now. Not sure why, but hopefully whatever issue that previously existed has gone away forever.

panzner avatar Jun 21 '18 13:06 panzner

Thanks for updating @panzner, though that's fairly frustrating! For me at least :wink:

I'll leave this ticket open in case it returns or someone else encounters the same issue.


:link: Documentation https://developers.google.com/calendar/v3/errors#412_precondition_failed

Suggested action: Re-fetch the entity and re-apply the changes.

:link: Possible fix: https://developers.google.com/calendar/v3/version-resources#conditional_modification

phw198 avatar Jun 23 '18 10:06 phw198

Issue #800 which is reporting the same error, appears to show this bug is fixed in v2.8.1

phw198 avatar Feb 15 '20 23:02 phw198

I'm on 2.8.3 and get this regularly, but not every time.

image

viper1969 avatar Mar 04 '20 20:03 viper1969

@viper1969 Thanks for updating on this - could you increase the logging level to FINE and then provide your OGcalsync.log file after you have encountered that error again?

phw198 avatar Mar 08 '20 13:03 phw198

Encountered again (and a lot in between then and now, but forgot to grab the log)

OGcalsync.log

viper1969 avatar Mar 31 '20 14:03 viper1969

I also keep getting this - scrnshot and log attached. A few clicks to retry sync and it starts to resolve itself but nevertheless both annoying and a new behaviour over last few couple of weeks or so:

fine log attached

image

OGcalsync.log

tk2themax avatar May 07 '20 08:05 tk2themax

@tk2themax Your logfile only shows the successful sync subsequent to your screenshot. Could you upload the previous day's log instead?

phw198 avatar May 08 '20 19:05 phw198

:package: Please apply hotfix v2.8.3.12.zip (see instructions for applying) and let me know how it goes.

phw198 avatar May 08 '20 20:05 phw198

Thank you this hotfix seems to have eliminated the errors. I did not provide more logs as you had requested before your subsequent hotfix suggestion but still can.

tk2themax avatar May 12 '20 16:05 tk2themax

No that's fine thanks, but if you could provide the logs for the latest hotfix that'd be appreciated.

phw198 avatar May 12 '20 20:05 phw198

Thanks @tk2themax but it doesn't look like you've encountered the original error for this ticket yet, so I can't tell if the hotfix is actually working.

You'll know when the issue does happen because either you will get an error message (in which case it hasn't worked), or a popup message box that says

A PreCondition Failed [412] was avoided, but will still be thrown to help troubleshooting. Please upload your logfile to GitHub.

Please let me know when either happens.

phw198 avatar May 16 '20 11:05 phw198

I am also getting this error. I opened a new issue before I found this one. Is that hotfix still valid?

aprayiii avatar Oct 22 '20 14:10 aprayiii

I tried the hotfix but got a different error Screenshot 2020-10-22 081424

aprayiii avatar Oct 22 '20 14:10 aprayiii

Well... there was a calendar entry that it was trying to process before the error occurred, I deleted that entry from Outlook and the problem went away.

aprayiii avatar Oct 22 '20 17:10 aprayiii

@aprayiii A shame you didn't upload your OGcalsync.log file as I have nothing to work with without that.

phw198 avatar Dec 20 '20 16:12 phw198

Encountered same issue. First with latest common release. Then installed the Alpha and it looked first but same issue. Happy to share log by mail but not here as there is personal data in the log.

PS. Will hit the donate button. Think this is a great project and you deserve the credits. Hope you will continue working on this!

mpmbrouns avatar Jun 10 '21 07:06 mpmbrouns

Hi Paul. Thanks for the useful tool. Having the same issue as everyone else.

Have attached the logfile if it helps

Many thanks

Andrew OGcalsync.log

adbeggs avatar Jul 09 '21 19:07 adbeggs

I'm getting the same error in version 2.9.0 every single time it tries to sync.

OGcalsync.log .

pj-camp avatar Feb 07 '22 17:02 pj-camp

I'm getting the same error in version 2.9.0 every single time it tries to sync.

OGcalsync.log .

Never mind. There were two instances of OCGS running for some reason. That caused it.

pj-camp avatar Feb 07 '22 17:02 pj-camp

@pj-camp Sounds like your issue was the same as 1052 then. I'm not sure if all 412 errors are related to multiple instances though...!

:package: I've now pulled these troubleshooting changes into v2.9.3 - hotfix v2.9.3.2.zip (see instructions for applying).

Anyone that tries this hotfix, please let me know how it goes.

phw198 avatar Feb 27 '22 13:02 phw198