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

FAKE.Deploy (Start of process fsi.exe The handle is invalid) #1420

Closed
tadyshev opened this issue Nov 16, 2016 · 2 comments
Closed

FAKE.Deploy (Start of process fsi.exe The handle is invalid) #1420

tadyshev opened this issue Nov 16, 2016 · 2 comments

Comments

@tadyshev
Copy link
Contributor

tadyshev commented Nov 16, 2016

Description

Deployment fails with stack trace

Details:
Failure
  {Messages = seq [];
   Exception =
    System.Exception: Start of process C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\fsi.exe failed. The handle is invalid.

   at [email protected](String message) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 87
   at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, FSharpFunc`2 errorF, FSharpFunc`2 messageF) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 87
   at Fake.ProcessHelper.ExecProcessRedirected(FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 131
   at Fake.FSIHelper.executeFSIWithScriptArgsAndReturnMessages(String script, String[] scriptArgs) in C:\code\fake\src\app\FakeLib\FSIHelper.fs:line 192
   at Fake.DeploymentHelper.doDeployment(String scriptFileName, String[] scriptArgs) in C:\code\fake\src\app\Fake.Deploy\DeploymentHelper.fs:line 88;
   IsError = true;}

Repro steps

Please provide the steps required to reproduce the problem

  1. Download FAKE version 4.44.2+ or later on remote server.

  2. Deploy NuGet Package to that remote server.

Expected behavior

Excepted behavior is successfull remote deployment.

Actual behavior

Deployment fails and returns the stack trace given at the top of this post. I modified exception catching code to return more details about the exception on my machine here are the results.

Details:
Failure
  {Messages = seq [];
   Exception =
    System.Exception: Start of process C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\fsi.exe | 
Start Info:ProcessInfo:
Args:"C:\nuget\FAKE\tools\deployments\DeployPackage\Deploy.fsx " 
Working dir: "" 
UserName: ""
 isMono: false
 | failed. The handle is invalid.
 
 | Stack trance:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.set_OutputEncoding(Encoding value)
   at Fake.ProcessHelper.start(Process proc)
   at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, FSharpFunc`2 errorF, FSharpFunc`2 messageF)
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1360.Invoke(String message)
   at [email protected](String arg40)
   at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, FSharpFunc`2 errorF, FSharpFunc`2 messageF)
   at Fake.ProcessHelper.ExecProcessRedirected(FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut)
   at Fake.FSIHelper.executeFSIWithScriptArgsAndReturnMessages(String script, String[] scriptArgs)
   at Fake.DeploymentHelper.doDeployment(String scriptFileName, String[] scriptArgs) in C:\code\fake\src\app\Fake.Deploy\DeploymentHelper.fs:line 88;
   IsError = true;}

Known workarounds

Based on the stack trace,

   at System.Console.set_OutputEncoding(Encoding value)
   at Fake.ProcessHelper.start(Process proc)

the offending line of code is this.
System.Console.OutputEncoding <- System.Text.Encoding.UTF8

Looking at git blame for that line, it looks like this code was introduced in 4.44.2 by (7afa219). Dowgrading to 4.44.1 or earlier versions resolves this issue.

Related information

  • Operating system: Windows Server 2012
  • Branch: Master
  • .NET Runtime 4.5
@forki
Copy link
Member

forki commented Nov 17, 2016

so it can't set the encoding? can you please send a PR with try catch around it? then we might just continue.

@dsyme
Copy link
Collaborator

dsyme commented Dec 5, 2016

was fixed by PR

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