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

Update-OktaApplication always gets "The script failed due to call depth overflow." error for oidc_client app #75

Open
adurk opened this issue Jan 8, 2025 · 2 comments

Comments

@adurk
Copy link

adurk commented Jan 8, 2025

Just trying to get an app, not even make any changes and then update it never succeeds.

$appLabel = "test from PS"
$apps = Invoke-OktaListApplications -Limit 1 -Q $appLabel
$existingApp = $apps[0]
$resultApp = Update-OktaApplication -Application $existingApp -AppId $existingApp.id

The apps are oidc_client apps, so there are a lot of properties. I can't seem to find where depth comes into play, but properties do go 4 levels deep. Spitting out the object and passing the same json to the API works.

Remove-NullProperties: C:\Users...\Documents\PowerShell\Modules\Okta.PowerShell\1.0.3\Client\JsonHelper.ps1:40:46
Line |
40 | … $NewObject[$Property.Name] = Remove-NullProperties $Property.Value
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The script failed due to call depth overflow.

Attaching a sample json, which has only been modified to remove identifiers.
app.json

@laura-rodriguez
Copy link
Collaborator

Hi @adurk,

Thank you for reporting this issue. I've filed an internal ticket so the team can review and prioritize during the next planning rounds.

Internal Ref: OKTA-850731

In the meantime and considering the Remove-NullProperties function is failing, maybe you can try passing the IncludeNullValues switch when calling Update-OktaApplication so it skips the Remove-NullProperties logic. FWIW all public functions expose the IncludeNullValues switch. Let me know if this helps in the short term. Thank you!

@adurk
Copy link
Author

adurk commented Jan 10, 2025

That worked, didn't notice that parameter. It would still be ideal to be able to remove the null properties to make the payload smaller. But definitely less urgent now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants