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

404 exception doesn't get caught, results in error. #12

Open
T4ESamuel opened this issue Jul 30, 2024 · 2 comments · May be fixed by #13
Open

404 exception doesn't get caught, results in error. #12

T4ESamuel opened this issue Jul 30, 2024 · 2 comments · May be fixed by #13
Labels
bug Something isn't working

Comments

@T4ESamuel
Copy link

if ($errorMessage.AuditErrorMessage -Like "*No account found*" -or $errorMessage.AuditErrorMessage -Like "*(404) Not Found.*" -or $errorMessage.AuditErrorMessage -Like "*User not found*") {

What regularly occurs is that the SCIM API from Infoland cannot handle the number of requests (too many requests are made, please try again). In the backend of Zenya, the account is then deleted, but HelloID does not receive a success status due to the timeout. During a retry, this fails because the user no longer exists. I have already set a concurrent action limit, but unfortunately, this is not completely foolproof.

The retry on a revoke keeps failing with the following logging:
Error deleting account []. AccountReference: { "Id": "xxx-xxx-xxx-xxx-xxx", "Username": "g.xxxxxxxx@xxxxx.nl" }. Error Message: Response status code does not indicate success: 404 (Not Found).

Debug logging:
[
{
"messageTimeUtc": "2024-07-30T06:38:32.3259688Z",
"message": "You cannot call a method on a null-valued expression.",
"level": 4
},
{
"messageTimeUtc": "2024-07-30T06:38:32.3301554Z",
"message": "You cannot call a method on a null-valued expression.",
"level": 4
},
{
"messageTimeUtc": "2024-07-30T06:38:32.3458Z",
"message": "Creating Access Token",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:32.7403668Z",
"message": "Adding Authorization headers",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:32.7539991Z",
"message": "Querying account with id [xxxx-xxxx-xxxx-xxxx-xxxx]",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.0516333Z",
"message": "Error at Line [237]: $currentAccount = Invoke-RestMethod @splatWebRequest -Verbose:$false\r\n. Error: \n{\n "schemas": [\n "urn:ietf:params:scim:api:messages:2.0:Error"\n ],\n "detail": "{\u0022type\u0022:\u0022https://iprova.nl/probs/notfound\u0022,\u0022title\u0022:\u0022User not found\u0022,\u0022status\u0022:404} (Success NotFound)",\n "status": "404"\n}",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.0532671Z",
"message": "URI: https://identitymanagement.services.zenya.work/scim/users/xxxx-xxxx-xxxx-xxxxx-xxxx",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.0625154Z",
"message": "Deleting account []. AccountReference: {\n "Id": "xxxx-xxxx-xxxx-xxxxx-xxxx",\n "Username": "g.xxxxxxxxxx@xxx.nl"\n}.",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.2068743Z",
"message": "Error resolving Zenya error message, using default Powershell error message",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.2114987Z",
"message": "Error at Line [285]: $deletedAccount = Invoke-RestMethod @splatWebRequest -Verbose:$false\r\n. Error: Response status code does not indicate success: 404 (Not Found).",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.2123217Z",
"message": "URI: https://identitymanagement.services.zenya.work/scim/users/",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.2126807Z",
"message": "Body: ",
"level": 2
},
{
"messageTimeUtc": "2024-07-30T06:38:33.2176235Z",
"message": "Terminal error occurred. Error Message: Response status code does not indicate success: 404 (Not Found).",
"level": 3
},
{
"messageTimeUtc": "2024-07-30T06:38:33.2278465Z",
"message": "An error occurred while running the script, details: One or more errors occurred. (ScriptHalted)",
"level": 4
}
]

If there is any additional information is required, feel free to contact me.

@JeroenBL JeroenBL added the bug Something isn't working label Aug 5, 2024
@rschouten97
Copy link
Contributor

@T4ESamuel, we are addressing this issue in the upcoming release. However, we haven't been able to reproduce the error on our end.

Could you please implement and test the new release where the issue previously occurred to verify if it has been resolved?

@T4ESamuel
Copy link
Author

Could you please implement and test the new release where the issue previously occurred to verify if it has been resolved?

Thanks for the update! I will update and/or resolve this issue if the bug has or has not been resolved with the code in the new branche.

@rschouten97 rschouten97 linked a pull request Sep 3, 2024 that will close this issue
@rschouten97 rschouten97 linked a pull request Sep 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants