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

[Automation Account Tests] Management script fails to parse job result stream. #8694

Closed
vladimir-shcherbakov opened this issue Mar 5, 2019 · 2 comments

Comments

@vladimir-shcherbakov
Copy link
Contributor

vladimir-shcherbakov commented Mar 5, 2019

Description

Report flow:

  1. Automation Account runbook job put results into verbose stream:
Write-Verbose 'Resolve-AzError Information'
Write-Verbose '--------------------------------'
Resolve-AzError | Write-Verbose
  1. Management script waits for the job completion:
$failedJobs = $jobs | Wait-Job | ForEach-Object {
        $name = $_.Name
        $state = $_.State
        $output = $_ | Receive-Job -Keep
        $jobId = @($output | Where-Object { $_ -like 'JobId:*' } | Select-Object -First 1) -replace 'JobId:','' | Out-String
        $failureCount = @($output | Where-Object { $_ -like '!!!*' } | Measure-Object -Line).Lines
        New-Object PSObject -Property @{Name = $name; State = $state; JobId = $jobId; FailureCount = $failureCount}
}

and fails on $_ | Receive-Job -Keep call with the exception:

Conversion from JSON failed with error: Unexpected character encountered while parsing value: J. Path '', line 0, position 0.
+ CategoryInfo          : CloseError: (:) [Start-AzAutomationRunbook], CmdletInvocationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook
+ PSComputerName        : localhost

Conversion from JSON failed with error: Unexpected character encountered while parsing value: J. Path '', line 0, position 0.
+ CategoryInfo          : CloseError: (:) [Start-AzAutomationRunbook], CmdletInvocationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook
+ PSComputerName        : localhost

Conversion from JSON failed with error: Unexpected character encountered while parsing value: J. Path '', line 0, position 0.
+ CategoryInfo          : CloseError: (:) [Start-AzAutomationRunbook], CmdletInvocationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook
+ PSComputerName        : localhost

Conversion from JSON failed with error: Unexpected character encountered while parsing value: J. Path '', line 0, position 0.
+ CategoryInfo          : CloseError: (:) [Start-AzAutomationRunbook], CmdletInvocationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook
+ PSComputerName        : localhost

Conversion from JSON failed with error: Unexpected character encountered while parsing value: J. Path '', line 0, position 0.
+ CategoryInfo          : CloseError: (:) [Start-AzAutomationRunbook], CmdletInvocationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook
+ PSComputerName        : localhost

Conversion from JSON failed with error: Unexpected character encountered while parsing value: J. Path '', line 0, position 0.
+ CategoryInfo          : CloseError: (:) [Start-AzAutomationRunbook], CmdletInvocationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook
+ PSComputerName        : localhost

Conversion from JSON failed with error: Unexpected character encountered while parsing value: J. Path '', line 0, position 0.
+ CategoryInfo          : CloseError: (:) [Start-AzAutomationRunbook], CmdletInvocationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook
+ PSComputerName        : localhost

Cost 2

@lwajswaj
Copy link
Contributor

lwajswaj commented Mar 9, 2019

I think this issue is also fixed with this PR: #8607; different approach but it sounds like a similar scenario to other two issues (#7977 and #8600)

@markcowl markcowl added this to the 2019-04-09 milestone Mar 25, 2019
@markcowl markcowl removed this from the 2019-04-09 milestone Apr 6, 2019
@maddieclayton maddieclayton added this to the 2019-05-21 milestone Apr 16, 2019
@markcowl markcowl modified the milestones: 2019-05-21, 2019-07-30 May 2, 2019
@markcowl
Copy link
Member

markcowl commented Aug 3, 2019

no longer relevant

@markcowl markcowl closed this as completed Aug 3, 2019
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

4 participants