mbegan / Okta-PSModule

Okta API Powershell Wrapper Module
Other
102 stars 31 forks source link

WARNING: Encountered error, returning limited or empty set #23

Closed macdog14368 closed 5 years ago

macdog14368 commented 5 years ago

Getting this from Windows 10 (ISE and PowerShell) using an API token with Okta "Super" permissions when running any cmdlet. Any ideas?

VERBOSE: received -1-byte response of content type application/json;charset=UTF-8 WARNING: Unable to find type [Microsoft.PowerShell.Commands.HttpResponseException]. WARNING: Encountered error, returning limited or empty set VERBOSE: This Page returned: 0, we've seen: 0 results so far VERBOSE: 0 results returned, i predict an empty page coming up, lets skip it VERBOSE: We see no or an invalid next link of: False

mbegan commented 5 years ago

Can you are more details, including the full command you are running?

PS > $oktaVerbose=$true  
PS > oktaGetUserbyID -userName me -Verbose -oOrg matt                                                                                                                           
VERBOSE: GET https://mattegantest.oktapreview.com/api/v1/users/me with 0-byte payload
VERBOSE: received -byte response of content type application/json
VERBOSE: Req-Hdr: Accept-Encoding -> deflate,gzip                                                                                                                                              VERBOSE: Req-Hdr: Accept-Charset -> ISO-8859-1,utf-8                                                                                                                                           VERBOSE: Req-Hdr: Accept-Language -> en-US                                                                                                                                                     VERBOSE: Req-Hdr: Authorization -> SSWS xXxXxXxxXxxXxXxXxxXx                                                                                                                                   
VERBOSE: Req-Hdr: Content-Type -> application/json
VERBOSE: Req-Hdr: User-Agent -> Okta-PSModule/2.4 (6.0.2) (Unix) (Darwin 17.5.0 Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64)
VERBOSE: Res-Hdr: Date -> Wed, 01 Aug 2018 21:28:28 GMT
VERBOSE: Res-Hdr: X-Okta-Request-Id -> W2Il-L1Njw-gv4Q9NEngywAABUo
VERBOSE: Res-Hdr: X-Rate-Limit-Limit -> 2000
VERBOSE: Res-Hdr: X-Rate-Limit-Remaining -> 1999
VERBOSE: Res-Hdr: X-Rate-Limit-Reset -> 1533158968
VERBOSE: Res-Hdr: Content-Type -> application/json; charset=UTF-8
VERBOSE: Okta Request ID: W2Il-L1Njw-gv4Q9NEngywAABUo
VERBOSE: There was content retured, convert from json string
VERBOSE: You have 1999 out of 2000 aka: 99.950% left in the tank
VERBOSE: This Page returned: 1, we've seen: 1 results so far
VERBOSE: We see no or an invalid next link of: False
macdog14368 commented 5 years ago

I get the same with any cmdlet. From the API screen in Okta, I see PS is connecting ("Last used").

PS C:\Users\xxxxxx> $oktaVerbose=$true

PS C:\Users\xxxxx> oktaGetActiveApps -Verbose VERBOSE: GET https://xxxxxx.okta.com/api/v1/apps?limit=500&filter=status eq "ACTIVE" with 0-byte payload VERBOSE: received -1-byte response of content type application/json;charset=UTF-8 WARNING: Unable to find type [Microsoft.PowerShell.Commands.HttpResponseException]. WARNING: Encountered error, returning limited or empty set VERBOSE: This Page returned: 0, we've seen: 0 results so far VERBOSE: 0 results returned, i predict an empty page coming up, lets skip it VERBOSE: We see no or an invalid next link of: False

mbegan commented 5 years ago

What version of powershell are you using?


PS /Users/mattegan> $PSVersionTable                                                                                                                                                            

Name                           Value                                                                                                                                                          
----                           -----                                                                                                                                                          
PSVersion                      6.0.2                                                                                                                                                          
PSEdition                      Core                                                                                                                                                           
GitCommitId                    v6.0.2                                                                                                                                                         
OS                             Darwin 17.5.0 Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64                                                  
Platform                       Unix                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                        
PSRemotingProtocolVersion      2.3                                                                                                                                                            
SerializationVersion           1.1.0.1                                                                                                                                                        
WSManStackVersion              3.0     
macdog14368 commented 5 years ago

Thanks Matt.

Name Value ---- -----
PSVersion 5.1.17134.1 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.1 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

mbegan commented 5 years ago

Can you post the output from this.

PS > $Error.Clear()
PS > $oktaVerbose=$true  
PS > oktaGetUserbyID -userName me -Verbose                                                                                                                                            
PS > $Error[0..($Error.count)]
macdog14368 commented 5 years ago

Now working. It was as simple as running IE. This was a new installation. Thanks Matt!

Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.

mbegan commented 5 years ago

Good to know!