question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipelines cannot be run concurrently

See original GitHub issue

Customers are running into System.Management.Automation.PSInvalidOperationException: The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently error when calling Add-AzVhd method from Az.Compute module. Looking at the stack trace, it’s coming from the following method in Automation SDK: System.Management.Automation.Runspaces.PipelineBase.DoConcurrentCheck(Boolean syncCall, Object syncObject, Boolean isInLock)

However, we are not able to reproduce it every time. We are only able to reproduce it successfully around 20% of the time. We are not using any piping in our PS script. Could you guys help us out in determining what the problem might be?

Steps to reproduce

No reliable reproduce method. Personally, I am unable to reproduce it, however another engineer is able to and he has around 20% repro rate. 

# Cosine IOT Services Azure Internal Consumption
$subscriptionId='f9cb372a-8903-4370-9ce0-3042e3bb2cc8'

$rgSeed = "akstest" # TODO customize
$vmSeed = "0430c101a"
$vhdFolder = "C:\Users\jiria\Downloads"
$vhdFileName = "aks-vhd-2.0.20200815.0745.vhd"
$storageAccountName = "storage" + $rgSeed

$location = "westus2"

# $vmSize = "Standard_A2"
$vmSize = "Standard_NC6"

.\vm-create.ps1 $subscriptionId $rgSeed $vmSeed $vhdFolder $vhdFileName $storageAccountName $location $vmSize

Expected behavior

No error

Actual behavior

error: Exception - System.Management.Automation.PSInvalidOperationException: The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently. 

Environment data


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
rjmholtcommented, Aug 21, 2020

We are not using any piping in our PS script

A pipeline here is what runs the commands. The error message means you’re trying to run multiple commands at the same time on the same thread (i.e. in the same runspace).

In the snippet and error message you’ve shown, there isn’t enough information to establish what’s going on. In particular we don’t know what cmdlets are being used, where the error occurs or any other details about the error. We need:

  • The contents of vm-create.ps1 and any other scripts being called – we need to know the whole program you’re running
  • The full stack trace of the error, which you can get with Get-Error or $error[0] | fl * -force after you reproduce
1reaction
vexx32commented, Aug 21, 2020

I think they mentioned the cmdlet they ran; Add-AzVhd – I suspect the cmdlet is doing something… unwise… internally if that’s all they ran.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipeline not executed because a pipeline is already ...
When attempting to run a script, I am getting an error message. Here is my script: ... Pipelines cannot be executed concurrently.
Read more >
PowerShell - Pipeline not executed because a ...
PowerShell - Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.
Read more >
Exchange Management Shell Pipeline Not Executed ...
Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently. + CategoryInfo : OperationStopped: ( ...
Read more >
Powershell Error: Pipelines Cannot be Executed ...
Today I have received the Powershell error “Pipelines Cannot be Executed Concurrently” while running commands in Exchange Management Shell.
Read more >
Bitbucket Cloud Pipelines parallel steps do not run ...
The reason why Step-3 did not run concurrently with the other steps is that it has to prepare the step container to set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found