Ruby/Sinatra calling Powershell scripts - pipe errors

Repository of web frameworks and applications for Microsoft IIS.
User avatar
Posts: 7
Joined: 25 Feb 2015, 11:49

Ruby/Sinatra calling Powershell scripts - pipe errors

25 Feb 2015, 11:57

I am wanting to use the Ruby Hosting Package to host a Sinatra app on IIS. I got everything installed and a basic "hello world" site working. My next step was to call a local powershell script. This test script simply creates a folder, a text file, and puts a line into the text file. When I call the powershell from sinatra, the script executes successfully. It creates the folder, file, and line in the text file. However I'm getting a 500 error:

Error
Helicon Zoo module has caught up an error. Please see the details below.

Worker Status

The process was created

Windows error
The pipe has been ended. (ERROR CODE: 109)
Internal module error

message: Application backend read Error.
type: ZooException
file: App\Jobs\JobBase.cpp
line: 531
version: 3.1.98.538

STDERR


I'm not sure what to make of that error or what's going on. My ruby code is simple:
Code: Select all
get '/' do
   exec "powershell -command c:/temp/test.ps1"
   return [200, settings.client_headers, {:message => msg}.to_json]
end


Any idea what's going on here?

User avatar
Posts: 7
Joined: 25 Feb 2015, 11:49

Re: Ruby/Sinatra calling Powershell scripts - pipe errors

25 Feb 2015, 16:51

I enabled logging in the web.config. Here are the results:

[25.02.2015 14:49:58.622363] [v 3.1.98.538] [tid 0x0000126c] [sev 2] # 960241232768 Application has been started
[25.02.2015 14:50:03.861896] [v 3.1.98.538] [tid 0x000010e4] [sev 2] WorkersManager - OnProcessExit()
[25.02.2015 14:50:03.861896] [v 3.1.98.538] [tid 0x000010e4] [sev 2] WorkersManager - Worker shutdown. #1 - [pid:4120] "C:\Ruby19\bin\ruby.exe" C:\Zoo\Workers\ruby\zoorack.rb

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: Ruby/Sinatra calling Powershell scripts - pipe errors

26 Feb 2015, 08:12

Hello!

What if you change ruby.1.9.rack engine to ruby.1.9.http engine. Try to create new project and follow instructions from http Thin section (you may use another http backend server but the idea is the same). With backend running as http server it would be easier to troubleshoot issue because you will be able to connect to backend locally bypassing Zoo proxy.

User avatar
Posts: 27
Joined: 13 Apr 2015, 03:03

Re: Ruby/Sinatra calling Powershell scripts - pipe errors

13 Apr 2015, 03:23

Thanks you :)

Educa

Return to Helicon Zoo

Who is online

Users browsing this forum: No registered users and 0 guests