Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-3690

Powershell module hangs on latest Powershell (5.1.14394.1000)

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Powershell 2.0.2
    • PowerShell 2.0.4
    • powershell
    • Modules
    • 3
    • Modules 2016-09-21, Modules 2016-10-05, Modules 2016-10-19, Modules 2016-11-16

    Description

      Running the powershell module in a Puppet apply on latest Windows 10 (Anniversary Update) hangs during execution.

      http://www.powershellmagazine.com/2016/08/02/pstip-new-powershell-commands-in-windows-10-anniversary-update/

      Repro:
      Ensure Powershell is version 5.1.14393.0

      Manifest:

        exec { "test":
          command => 'Write-Host "Hello"',
          provider => powershell,
        }
      

      Use Puppet Module 2.0.2 from the forge

      Execute the manifest with puppet apply. Make sure you add --debug to see the bad output

      Debug output

      Debug: Puppet::Type::Exec::ProviderPosix: feature posix is missing
      Debug: Puppet::Type::Exec::ProviderShell: feature posix is missing
      Debug: Creating default schedules
      Debug: Loaded state in 0.01 seconds
      Debug: Loaded state in 0.00 seconds
      Info: Applying configuration version '1470351109'
      Debug: /Stage[main]/Main/Dot_net_core::Install[test]/Exec[dot_net_core_install_C:/source/puppetconf-2016/temp/base/dnc]/before: subscribes to Notify[xxxx dotnet-win-x64.1.0.0.zip]
      Debug: 2016-08-04 15:51:50 -0700 C:\WINDOWS\system32\WindowsPowershell\v1.0\powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -Command - is running as pid: 13716
      Debug: Waited 50 milliseconds...
      Debug: Waited 50 milliseconds...
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   param(
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     [Parameter()]$exitcode,
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     [Parameter()]$output,
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     [Parameter()]$errormessage
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   )
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:1 char:23
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> + function New-XmlResult
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +                       ~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Missing function body in function declaration.
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + FullyQualifiedErrorId : MissingFunctionBody
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: Waited 50 milliseconds...
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   # we make our own xml because ConvertTo-Xml makes hard to parse xml ruby side
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   # and we need to be sure
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   $xml = [xml]@"
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> <ReturnResult>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   <Property Name='exitcode'>$($exitcode)</Property>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:1 char:35
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> + function Invoke-PowerShellUserCode
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +                                   ~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Missing function body in function declaration.
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + FullyQualifiedErrorId : MissingFunctionBody
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:9 char:11
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +     $Code,
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +           ~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Missing expression after ','.
       
      Debug: Waited 50 milliseconds...
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   <Property Name='errormessage'>$([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([string]$errormessage)))</Property>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   <Property Name='stdout'>$([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([string]$output)))</Property>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> </ReturnResult>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> "@
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>   $xml.OuterXml
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:9 char:10
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +     $Code,
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +          ~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Missing ')' in function parameter list.
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:1 char:1
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> + {
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> + ~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Missing closing '}' in statement block or type definition.
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + FullyQualifiedErrorId : MissingExpressionAfterToken
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: Waited 50 milliseconds...
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> IsPublic IsSerial Name                                     BaseType
       
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> -------- -------- ----                                     --------
       
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> True     True     String                                   System.Object
       
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> IsPublic IsSerial Name                                     BaseType
       
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> -------- -------- ----                                     --------
       
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> True     True     Int32                                    System.ValueType
       
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:1 char:16
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +     $EventName,
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +                ~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Missing expression after ','.
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + FullyQualifiedErrorId : MissingExpressionAfterToken
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:1 char:3
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +   )
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +   ~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Unexpected token ')' in expression or statement.
       
      Debug: Waited 50 milliseconds...
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + FullyQualifiedErrorId : UnexpectedToken
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Exception calling "OpenExisting" with "1" argument(s): "Empty name is not legal.
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> Parameter name: name"
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> At line:1 char:3
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +   $event = [System.Threading.EventWaitHandle]::OpenExisting($EventNam ...
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE> +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>     + FullyQualifiedErrorId : ArgumentException
       
      Debug: 2016-08-04 15:51:50 -0700 PIPE>
       
      Debug: Wait object signaled
      Debug: Waited 300 total milliseconds.
      Debug: 2016-08-04 15:51:51 -0700 PIPE> At line:1 char:6
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE> +   try
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE> +      ~
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE> The Try statement is missing its statement block.
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE>     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE>     + FullyQualifiedErrorId : MissingTryStatementBlock
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE> At line:163 char:1
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE> + }
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE> + ~
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE> Unexpected token '}' in expression or statement.
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE>     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE>     + FullyQualifiedErrorId : UnexpectedToken
       
      Debug: 2016-08-04 15:51:51 -0700 PIPE>
       
      Debug: 2016-08-04 15:51:51 -0700 PowerShell initialization complete for pid: 13716
      Debug: Waited 50 milliseconds...
      

      Attachments

        Issue Links

          Activity

            People

              rob Rob Reynolds
              glenn.sarti Glenn Sarti
              Erick Banks Erick Banks
              Votes:
              5 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support