Hi David, I've run into a similar problem. I am getting the 1300 EntityExists error when attempting to create new accounts. However, when checking for the user ( in both control panel and through the API ), no user is found.
The cause of the errors might be different in our cases but I agree that it is very confusing to simultaneously receive EntityExists during an add and null for a retrieve on the same username. Your suggestion of extending EntityExists to convey more information if available seems sound. Recently I had performed a bulk import using the control panel during which 17 accounts were not created. In the update report email, the usernames which failed to update were listed at the top and labeled "Affected usernames" Most of the usernames were preceded by an asterisk, but three of them were not. I assume this is meaningful in some way but have not yet discovered what the meaning is. The three accounts that were not preceded by an asterisk are the ones that I am now having problems with. Does anyone know what the asterisks, or lack thereof, indicate? As an aside, we at Adelphi are having the same sync issues - we have about 15K accounts, and rather than doing provisioning api lookups, we just cross-refernce our local table of should-be google users with the data we receive from the reporting API. This works well enough if you're content with a once per day sync process, and the reporting api data is useful enough to justify grabbing it and storing it in a local db anyway. On Sep 22, 4:16 am, "Julian (Google)" <[EMAIL PROTECTED]> wrote: > Hi David, > > Can you submit a support request with some examples we can use to > troubleshoot this issue? Instructions for submitting a support > request (including Customer and Support PIN) are in the control panel > > Thanks, > Julian > > On Sep 21, 9:58 am, George <[EMAIL PROTECTED]> wrote: > > > Sorry, I will not help you with your problem. It never happened to me > > the way you describe. > > > Regards, > > George (Jiri) > > > On Sep 19, 5:43 pm, David McMurray <[EMAIL PROTECTED]> wrote: > > > > Thank you very much for your detailed reply Jiri. > > > > I hadn't see the 1100 - User Deleted Recently error code, but if > > > that's the case it seems something more sinister is occurring here, > > > because I'm getting the 1300 - Entity Exists error and not the 1100 > > > error. But as I say when I search for the user in the control panel it > > > says the account does not exist. > > > > Indeed I'll certainly look at using the multi-threaded get users > > > method you described, since the state table method certainly has it's > > > synchronisation flaws. > > > > So how come the API says an account exists and the control panel says > > > it doesn't? > > > > Regards, > > > David. > > > > On Sep 19, 4:22 pm, George <[EMAIL PROTECTED]> wrote: > > > > > Hi David, > > > > > I use .NET client library version 1.2.2.0 and there is constant > > > > AppsException.UserDeletedRecently defined, which is returned as error > > > > code, when user was deleted recently i.e. 5 days has not passed yet > > > > from the day the user was deleted. You can use it to distinguish this > > > > situation from one, where user already exists (error constant > > > > AppsException.EntityExists is returned). I do it this way, have tested > > > > it and it works. > > > > > Btw...you can also retrieve all accounts quite fast. Our organization > > > > (also college) has 10.700 Google users currently. I am able to > > > > retrieve information about all these users in 40 seconds, which is not > > > > that bad compared to standard functions available in .NET client > > > > library. The trick is multi-threading. You retrieve multiple pages of > > > > users concurrently. Here is how to do it in case you are interested: > > > > > 1) Sort all Google users in your table by name exactly the same way > > > > Google uses when you retrieve users page by page. > > > > 2) Loop through the sorted table and remember batches of 95 accounts > > > > and store them e.g. in separate DataTables. > > > > 3) For each 95-row DataTable start new thread, which retrieves the > > > > page of accounts starting from username equal to username contained in > > > > first row of 95-row DataTable. > > > > 4) Compare retrieved entries with rows in table and decide if user was > > > > created/updated/deleted manually in Google and make appropriate > > > > changes to you user table. > > > > > Note that: > > > > - You must retrieve all users from your table into big client's in- > > > > memory DataTable before spawning number of worker threads, otherwise > > > > you will not be able to update the table in threads because of DB > > > > locks placed on table by your SELECT SQL statement. > > > > - You need to control maximum amount of currently running worker > > > > threads. Do not start new threads, when current number of running > > > > worker threads is greater than e.g. 15 threads (i.e. 15 connections to > > > > Google server). > > > > - You need to allow multiple concurrent connections to Google server. > > > > Default concurrent connection limit is set to 2 in .NET. You can do it > > > > by setting ServicePointManager.DefaultConnectionLimit to value equal > > > > to number of maximum allowed number of concurrently running threads or > > > > set it in your app.config file e.g.: > > > > <system.net> > > > > <connectionManagement> > > > > <add address = "*" maxconnection = "15" /> > > > > </connectionManagement> > > > > </system.net> > > > > - You must properly handle cases, where e.g. a lot of new accounts > > > > were added in one page or allot of accounts were deleted. In first > > > > case, you need to retrieve next pages from Google in worker thread, > > > > until you encounter user-name, equal to or greater than starting user- > > > > name of next worker thread. In second case, you need to end the worker > > > > thread, if you encounter user-name in your table, which is equal to or > > > > greater than the starting user-name of next worker thread. > > > > > Regards, > > > > Jiri > > > > > On Sep 19, 3:50 pm, "[EMAIL PROTECTED]" > > > > > <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > I've been reading what I could find in the discussions on deleted > > > > > accounts and unfortunately it hasn't quite covered the problem I've > > > > > got. > > > > > > Because of the number of accounts we have here at the college, some > > > > > 11,500, it's not really practical for us to obtain the list of current > > > > > user accounts via the API and compare it with our list of students in > > > > > order to decide what accounts need to be created or deleted. So > > > > > instead we have created a kind of google state table in our system to > > > > > list students that we have created on the google email system. New > > > > > accounts are added to this table and deleted accounts are removed from > > > > > this table, simple enough. > > > > > > A problem has occurred where an account has been deleted from google > > > > > and also from our state table as expected. When the student re- > > > > > enrolled and because they were current on our system and not in the > > > > > state table our software attempted to create the google email account, > > > > > so far so good. > > > > > > Unfortunately it seems that (through the API) the email account still > > > > > exists as I get error code '1300 - Entity Exists' (searching for this > > > > > student in the google email control panel it says it doesn't exist). > > > > > So our system, seeing that it exists then updates the state table to > > > > > indicate that the email account exists in google. It does this to try > > > > > and keep itself up to date in case someone manually created their > > > > > email account for them. So at this point our system believes the > > > > > student has a google email account and will not attempt to create it > > > > > again. > > > > > > I'm thinking that when the 5 grace days are over after deleting the > > > > > account and it actually does get removed from the google system then > > > > > the API would actually successfully recreate the email account if it > > > > > tried. But this is not going to happen because as I said it now thinks > > > > > the student has a current google email account. > > > > > > I suppose what I'm getting at is that it is misleading for the API to > > > > > return 1300 - Entity Exists when trying to create an account that is > > > > > in the process of being deleted. Maybe an extra exception error code > > > > > should be made available that indicates what is really happening, such > > > > > as 1304 - Entity Deleted or Entity Awaiting Purge, etc. > > > > > > Alternatively, couldn't a CreateUser call on an account name being > > > > > deleted actually resurrect the deleted account? I'm assuming here that > > > > > RestoreUser reverses the SuspendUser process and doesn't restore a > > > > > deleted account, correct me if I'm wrong here because the help info > > > > > I've seen on RestoreUser doesn't actually say what it's restoring > > > > > from, suspension or deletion or maybe both, I don't know. If > > > > > RestoreUser does only counter a SuspendUser then what is the procedure > > > > > currently for undeleting an account that has not yet been purged? > > > > > > Any help on this would be greatly appreciated. > > > > > > Regards, > > > > > David- Hide quoted text - > > > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Apps APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-apps-apis?hl=en -~----------~----~----~----~------~----~------~--~---
