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.

Start-Process fails with `EnvironmentBlockTooLong` error

See original GitHub issue

It seems that Start-Process has a hardcoded limit for the environment block, which I am hitting when running in Azure Pipelines (which sets lots of environment variables)

According to the documentation this limit only existed for Windows XP, is there any reason for it to remain?

Steps to reproduce

Start-Process -FilePath "myprocess.exe"

Expected behavior

Process is executed

Actual behavior

2020-11-17T14:21:34.1311704Z Start-Process : EnvironmentBlockTooLong
2020-11-17T14:21:34.1313656Z At C:\Program Files\PowerShell\Modules\PSDeployTools\1.1.55\Functions\Invoke-Process.ps1:44 char:16
2020-11-17T14:21:34.1315142Z +     $process = Start-Process @processParams
2020-11-17T14:21:34.1316243Z +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-11-17T14:21:34.1317681Z + CategoryInfo          : NotSpecified: (:) [Start-Process], InvalidOperationException
2020-11-17T14:21:34.1319184Z + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
iSazonovcommented, Nov 17, 2020

I believe we can remove the limit because Windows XP is out of support.

Since the issue is related to Azure Pipelines I’d ask MSFT team to include the fix in servicing release 7.1.1.

1reaction
msftbot[bot]commented, Mar 11, 2021

🎉This issue was addressed in #14111, which has now been successfully released as v7.1.3.🎉

Handy links:

Read more comments on GitHub >

github_iconTop Results From Across the Web

"The environment block used to start a process cannot be ...
The environment block used to start a process cannot be longer than 65535 bytes. The proejct is alive so yes - we surely...
Read more >
Build fails because the environment block used to start a ...
InvalidOperationException : The environment block used to start a process cannot be longer than 65535 bytes. Your environment block is 67476 ...
Read more >
The environment block used to start a process cannot be ...
Pipeline tasks are failing because the environment block is too large. This is happening because all of the configuration variables for the ...
Read more >
The environment block used to start a process cannot be ...
The error message indicates there is something up with the machine's environment variables. "Remove some environment variables and try again" Is ...
Read more >
What is the maximum size of a process environment block?
The environment block used to start a process cannot be longer than 65535 bytes. Your environment block is 70009 bytes long.
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