Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with setting password at account creation #80

Open
JakobQv opened this issue Apr 8, 2024 · 11 comments
Open

Issues with setting password at account creation #80

JakobQv opened this issue Apr 8, 2024 · 11 comments
Assignees

Comments

@JakobQv
Copy link

JakobQv commented Apr 8, 2024

Recently we have started getting errors related to the initial flow of password when creating an account, sometimes it works but most of the times it fails with below error, the account is created in Google but the password is not set. Any idea what might be wrong?

2024-04-08 11:42:08: Error setting password for user@contoso.com


An exception has occurred in SetPassword
Type: Google.GoogleApiException
Message: Google.Apis.Requests.RequestError
Resource Not Found: userKey [404]
Errors [
Message[Resource Not Found: userKey] Location[ - ] Reason[notFound] Domain[global]
]
Source: Google.Apis
TargetSite: Void MoveNext()
StackTrace:
at Google.Apis.Requests.ClientServiceRequest1.<ParseResponse>d__31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Google.Apis.Requests.ClientServiceRequest1.d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Google.Apis.Requests.ClientServiceRequest1.<ExecuteAsync>d__26.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at Lithnet.GoogleApps.ApiExtensions.ExecuteWithRetry[T](ClientServiceRequest1 request, Func2 shouldRetry, Int32 retryAttempts, Int32 consumeTokens)
at Lithnet.GoogleApps.ApiExtensions.ExecuteWithRetry[T](ClientServiceRequest1 request, RetryEvents policy, Int32 retryAttempts, Int32 consumeTokens) at Lithnet.GoogleApps.ApiExtensions.ExecuteWithRetryOnBackoff[T](ClientServiceRequest1 request, Int32 retryAttempts, Int32 consumeTokens)
at Lithnet.GoogleApps.ApiExtensions.ExecuteWithRetryOnBackoff[T](ClientServiceRequest1 request, Int32 retryAttempts) at Lithnet.GoogleApps.ApiExtensions.ExecuteWithRetryOnBackoff[T](ClientServiceRequest1 request)
at Lithnet.GoogleApps.UserRequestFactory.SetPassword(String id, SecureString newPassword)
at Lithnet.GoogleApps.MA.ManagementAgent.SetPassword(CSEntry csentry, SecureString newPassword, PasswordOptions options) in D:\dev\git\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 583


@ryannewington ryannewington self-assigned this Apr 8, 2024
@ryannewington
Copy link
Member

@JakobQv

It's just a terrible API. We've created the user, and then made a follow-up API call to set the password, and whatever endpoint we are hitting on the second call doesn't think that users exists. It hasnt replicated through their system for whatever reason.

We've seen this before, and it tends to be transient - eg something goes wrong on the google back end and its inconsistent for a while and then goes back to normal.

I'll check in with some other users and see if they are seeing this at the moment as well.

@JakobQv
Copy link
Author

JakobQv commented Apr 9, 2024

@ryannewington
Thanks for the quick response, in this particular environment the issue appeared in late January and has persisted since so I'm not very hopeful that it will resolve itself.

@ryannewington
Copy link
Member

@JakobQv

I've modified the agent to perform a backoff/retry when setting a user password and encountering a 404. Try this test build and see if its any better

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

@JakobQv
Copy link
Author

JakobQv commented Apr 10, 2024

@ryannewington
I will implement it ASAP and let you know how it goes, thanks!

@JakobQv
Copy link
Author

JakobQv commented Apr 10, 2024

@ryannewington
Got a different error now.

2024-04-10 08:42:32: Error setting password for user@contoso.com


An exception has occurred in SetPassword
Type: Google.GoogleApiException

Message: Google.Apis.Requests.RequestError
Required parameter: [resource.name.field] [400]
Errors [
Message[Required parameter: [resource.name.field]] Location[ - ] Reason[required] Domain[global]
]

Source: Google.Apis
TargetSite: Void MoveNext()
StackTrace:
at Google.Apis.Requests.ClientServiceRequest1.<ParseResponse>d__35.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Google.Apis.Requests.ClientServiceRequest1.d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Google.Apis.Requests.ClientServiceRequest1.<ExecuteAsync>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Lithnet.GoogleApps.ApiExtensions.ExecuteWithRetry[T](ClientServiceRequest1 request, Func`2 shouldRetry, Int32 retryAttempts, Int32 consumeTokens)
at Lithnet.GoogleApps.UserRequestFactory.SetPassword(String id, SecureString newPassword)
at Lithnet.GoogleApps.MA.ManagementAgent.SetPassword(CSEntry csentry, SecureString newPassword, PasswordOptions options)


@ryannewington
Copy link
Member

that... shouldn't have anything to do with the change that I made. very confused

@ryannewington
Copy link
Member

Are you getting that on any and all password changes, or is it working for some but not all?

@JakobQv
Copy link
Author

JakobQv commented Apr 10, 2024

Three accounts have been created so far, the first two failed with the same error and the third was successful

@ryannewington
Copy link
Member

What version were you on prior to this? If you rollback to that version, does the error message stay the same, or revert back to the old one?

@JakobQv
Copy link
Author

JakobQv commented Apr 15, 2024

Sorry about the delayed response.
Version 2.1.7857, rolling back to that version produces the old error "Errors [
Message[Resource Not Found: userKey] Location[ - ] Reason[notFound] Domain[global]
]"

Copy link

stale bot commented Jun 15, 2024

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.

@stale stale bot added the stale label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants