lithnet / googleapps-managementagent

Google Workspace Management Agent for MIM 2016
MIT License
12 stars 4 forks source link

Export Errors on Google MA #53

Closed JoeZinn closed 4 years ago

JoeZinn commented 4 years ago

Hi, I am receiving errors during a large export that state Message[Precondition Failed] Location[If-Match - header] Reason[conditionNotMet] Domain[global]. Any ideas why this would occur?

IAmStevenJohnson commented 4 years ago

I've also been getting these errors on and off for a couple months. It doesn't seem to happen only on large exports for me. It occurs nearly every export for a week or two and then stops. When it starts happening I add an extra export to my export run profile so it does two exports on every run. The second export usually is successful on the accounts that the first one fails on. I'm guessing the problem is maybe on the google side of things since we're both having the issue and it just clears up after a while. But maybe there's something that can be changed in the MA code to remedy this?? We had the problem the week before last but not this week. So I removed the second export from my export run profile and watch for errors to start again. Would love to hear if others are having this issue too.

ryannewington commented 4 years ago

Hi @JoeZinn @IAmStevenJohnson

This typically means that between us getting the object from google and submitting it for modification, something else on the Google side has modified the object. It's to protect us from overwriting someone else's changes to an object. A 'mid-air collision' if you will.

Now in my google environment, we have nothing modifying google objects except for this MA ,and we do see this from time-to-time. Whether its something not quite right on the google API side (it wouldn't be the first time Google have had issues with their APIs), or there is some other process updating these objects, it's a little hard to tell.

If this is super reproducible, and you have a full stack trace from the MA logs, I can investigate and make sure its not an underlying issue with my MA somewhere triggering in a very specific circumstance.

JoeZinn commented 4 years ago

Ryan,

Good Morning. I have a test environment with over a million students, I am sure I can reproduce the issue. What do you need me to do to capture the data for you? Please send me instructions to enable the debug.

Sincerely,

Joe Zinn

ryannewington commented 4 years ago

Hey @JoeZinn

If you can reproduce it, can you send me the ma.log file from when the error occurs. If you can pick out a single object that failed, and provide me the DN of it, as well as a screen shot of the pending export details from within the miisclient (or a copy of the pending export hologram XML using the lithnet miis powershell module), that would be very helpful. I'll step through the code and see if there are any concurrent paths that could result in an issue.

Ryan

ryannewington commented 4 years ago

For those following this issue, there are two parts to this problem.

When we perform a full update, we have to get the full object from Google, change it, and resubmit the new object. This is where the 'mid air collisions' can happen if something else on the Google side updates the object in between us getting the object and resubmitting it.

That's the unavoidable part of the problem. There's nothing i can see in the code that would be deliberately causing the issue we see. However, I can see that there was an issue where we were performing full updates, when only a patch was required. Patch operations don't have the mid-air collision problem, because we never ask for the full object to begin with, we simply submit the changed attributes. Because of this bug, we were performing full updates most of the time, and therefore running into this issue a lot more frequently.

I've released a new build that fixes this patching issue, so hopefully you should see a lot less of these problems. It has been unit tested and is passing all tests, and will be taken through the production release cycle in my organization before being marked as a final build.

https://github.com/lithnet/googleapps-managementagent/releases/tag/v2.0.7408

You are welcome to test and provide feedback if you can.

real-hackasaurus commented 4 years ago

I as well have a similar issue. I was getting "attribute not re-imported" whenever a GoogleMA import was run. I applied the recent pre-release fix and it got rid of the reported error but my attributes are still not updating in Google.

For example, I am attempting to send a boolean to the suspended value in Google for some accounts. The metaverse and the MA will report that there is a staged export change for this attribute but it will never actually update after an export to Google.

It is very odd that I have a dev environment that I built and ran this on just weeks before and it worked, but now that it is in production it is failing.

ryannewington commented 4 years ago

@Leafry Let's discuss your issue in #54

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

ryannewington commented 4 years ago

Hi all,

This issue is resolved in build https://github.com/lithnet/googleapps-managementagent/releases/tag/v1.0.7328

Which is now marked as production ready.

Ryan