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

CatalogTImer Function Issue #45

Open
Bchary8 opened this issue Jan 22, 2024 · 9 comments
Open

CatalogTImer Function Issue #45

Bchary8 opened this issue Jan 22, 2024 · 9 comments

Comments

@Bchary8
Copy link

Bchary8 commented Jan 22, 2024

Hi,

We are facing issue while using the CatalogTimer function, which was working previously, but after changing the secret key we are getting errors. Please find the below error captured from Minitor log.

EXCEPTION: One or more errors occurred. (Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 131.) Exception : Type : System.AggregateException InnerExceptions : Type : Newtonsoft.Json.JsonReaderException LineNumber : 1 LinePosition : 131 TargetSite : Name : Load DeclaringType : Newtonsoft.Json.Linq.JObject MemberType : Method Module : Newtonsoft.Json.dll Message : Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 131. Source : Newtonsoft.Json HResult : -2146233088 StackTrace : at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings) at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings) at Newtonsoft.Json.Linq.JObject.Parse(String json) at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.InvokeRestMethod(String url, String body, PowerBIWebRequestMethod requestType) Message : One or more errors occurred. (Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 131.) TargetSite : Name : ThrowIfExceptional DeclaringType : System.Threading.Tasks.Task MemberType : Method Module : System.Private.CoreLib.dll InnerException : Type : Newtonsoft.Json.JsonReaderException LineNumber : 1 LinePosition : 131 TargetSite : Name : Load DeclaringType : Newtonsoft.Json.Linq.JObject MemberType : Method Module : Newtonsoft.Json.dll Message : Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 131. Source : Newtonsoft.Json HResult : -2146233088 StackTrace : at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings) at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings) at Newtonsoft.Json.Linq.JObject.Parse(String json) at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.InvokeRestMethod(String url, String body, PowerBIWebRequestMethod requestType) Source : System.Private.CoreLib HResult : -2146233088 StackTrace : at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.ExecuteCmdlet() at Microsoft.PowerBI.Commands.Common.PowerBICmdlet.ProcessRecord() TargetObject : Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod CategoryInfo : WriteError: (Microsoft.PowerBI.C…kePowerBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException FullyQualifiedErrorId : One or more errors occurred. (Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 131.),Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod InvocationInfo : MyCommand : Invoke-PowerBIRestMethod ScriptLineNumber : 213 OffsetInLine : 40 HistoryId : 1 ScriptName : C:\home\site\wwwroot\Scripts\Fetch - Catalog.ps1 Line : $getInfoResult = @(Invoke-PowerBIRestMethod -Url "admin/workspaces/getInfo?$getInfoDetails" -Body $bodyStr -method Post | ConvertFrom-Json) PositionMessage : At C:\home\site\wwwroot\Scripts\Fetch - Catalog.ps1:213 char:40 + … oResult = @(Invoke-PowerBIRestMethod -Url "admin/workspaces/getInfo?$ … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\Scripts PSCommandPath : C:\home\site\wwwroot\Scripts\Fetch - Catalog.ps1 InvocationName : Invoke-PowerBIRestMethod CommandOrigin : Internal ScriptStackTrace : at , C:\home\site\wwwroot\Scripts\Fetch - Catalog.ps1: line 213 at Wait-On429Error, C:\home\site\wwwroot\Scripts\Fetch - Utils.psm1: line 184 at , C:\home\site\wwwroot\Scripts\Fetch - Catalog.ps1: line 207 at Get-ArrayInBatches, C:\home\site\wwwroot\Scripts\Fetch - Utils.psm1: line 159 at , C:\home\site\wwwroot\Scripts\Fetch - Catalog.ps1: line 204 at Get-ArrayInBatches, C:\home\site\wwwroot\Scripts\Fetch - Utils.psm1: line 159 at , C:\home\site\wwwroot\Scripts\Fetch - Catalog.ps1: line 198 at , C:\home\site\wwwroot\CatalogTimer\run.ps1: line 31 PipelineIterationInfo :

@Bchary8
Copy link
Author

Bchary8 commented Jan 29, 2024

Could you pls help us here to resolve the issue on priority.

@WillCisler
Copy link
Collaborator

This error is very likely to be caused by throttling - there is a line in Fetch utils that can be modified to allow for this error to prompt Wait-on-429 to pause and resume. The below can be used to remediate and I will push to a solution to main in the next week.

if ($errorText -like "*Error reading JObject from JsonReader*" -or ($errorText -like "*429 (Too Many Requests)*" -or $errorText -like "*Response status code does not indicate success: *" -or $errorText -like "*You have exceeded the amount of requests allowed*"))

here I remove "HttpRequestException" because it could also be "HttpResposeException"

Target line:

if ($errorText -like "*HttpRequestException*" -and ($errorText -like "*429 (Too Many Requests)*" -or $errorText -like "*Response status code does not indicate success: 429*")) {

@Bchary8
Copy link
Author

Bchary8 commented Feb 6, 2024

Thanks for your response, could you pls let me know the status whether you have implemented the changes or still we need to wait for few more days. Need your help to priorities on this issue. Since we need to like review data in the report.

@WillCisler
Copy link
Collaborator

These changes have been made

#46

@Bchary8
Copy link
Author

Bchary8 commented Feb 27, 2024

Hi Will, we are still facing the same issue the script is failing continuously (not getting executed correctly). Could you pls let me know do we need to do any changes from our end the changes which you have implemented in the Fun or not required.
If needed could you pls set up a call on this same.
Below is the error we are getting now.
esult: Failure Exception: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: One or more errors occurred. (Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 131.) Stack: at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.InvokeT at Microsoft.Azure.Functions.PowerShellWorker.PowerShell.PowerShellExtensions.InvokeAndClearCommands[T](PowerShell pwsh) in /mnt/vss/_work/1/s/src/PowerShell/PowerShellExtensions.cs:line 45 at Microsoft.Azure.Functions.PowerShellWorker.PowerShell.PowerShellManager.ExecuteUserCode(Boolean addPipelineOutput, IDictionary outputBindings) in /mnt/vss/_work/1/s/src/PowerShell/PowerShellManager.cs:line 314 at Microsoft.Azure.Functions.PowerShellWorker.PowerShell.PowerShellManager.InvokeFunction(AzFunctionInfo functionInfo, Hashtable triggerMetadata, TraceContext traceContext, RetryContext retryContext, IList`1 inputData, FunctionInvocationPerformanceStopwatch stopwatch) in /mnt/vss/_work/1/s/src/PowerShell/PowerShellManager.cs:line 262 at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.InvokeFunction(AzFunctionInfo functionInfo, PowerShellManager psManager, FunctionInvocationPerformanceStopwatch stopwatch, InvocationRequest invocationRequest) in /mnt/vss/_work/1/s/src/RequestProcessor.cs:line 352 at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.ProcessInvocationRequestImpl(StreamingMessage request, AzFunctionInfo functionInfo, PowerShellManager psManager, FunctionInvocationPerformanceStopwatch stopwatch) in /mnt/vss/_work/1/s/src/RequestProcessor.cs:line 319

@WillCisler
Copy link
Collaborator

Have you pulled the latest code from the Repo?

@Bchary8
Copy link
Author

Bchary8 commented Mar 7, 2024 via email

@Bchary8
Copy link
Author

Bchary8 commented Mar 22, 2024

Hi Team
Could you pls suggest me, do to this my script is failing continuously. Pls suggest me whether I need to do any changes from my end as well. So, that I can accordingly.

Regards
Chary

@JamesDBartlett3
Copy link
Collaborator

@Bchary8, are you still experiencing this issue, and if so, have you tried upgrading to the latest version of pbimonitor, as @WillCisler suggested above?

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

3 participants