FORUMS: list search recent posts

Windows Worker Node Command Line Execution

COW Forums : Square Box CatDV

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeff Schaap
Windows Worker Node Command Line Execution
on Mar 28, 2014 at 1:13:20 pm
Last Edited By Jeff Schaap on Mar 28, 2014 at 1:14:04 pm

Ok...

We transitioned to running a CatDV Server / Worker Node on a Mac to a PC (Worker Node 4.0.6). I had about 4 or 5 actions in the Mac's Worker Node and can't get them working now on the PC. For example, on the Mac I had a Server Query that under the "Conversions" tab would execute the command line:

mkdir -p /Volumes/maxxraid1/CatDV_Previews$p

This worked just great on the Mac. So for the PC I changed it to:

mkdir y:\CatDV_Previews$p

I did this because I assume that Worker is running a cmd.exe session and the mkdir "-P" parameter is not an option under the Windows flavor of this command. So I dropped that and also corrected the path location and slash directions...

However. when the task runs it does not create the directory and in the details of the task (from the task view) I get:

Execute 'mkdir': java.io.IOException: Cannot run program "mkdir": CreateProcess error=2, The system cannot find the file specified

So... accounting for the idea that the variable $p might not be the exact same thing under CatDV Server for Windows as it is in a Mac environment I decide to see if it is the command or the path that is the issue.

So I changed the "Execute command line 2:" under the "Conversions" tab to just:

mkdir

And I get:

Execute 'mkdir': java.io.IOException: Cannot run program "mkdir": CreateProcess error=2, The system cannot find the file specified

I've tried other DOS level commands that are supposed to be understood by cmd.exe and I get the same error.

I can't think what to try next. Maybe I have a fundamental misunderstanding of how this works and what the differences are between the Mac and PC environments. Any help is greatly appreciated.

Jeff


Return to posts index

Jeff Schaap
Re: Windows Worker Node Command Line Execution
on Apr 1, 2014 at 5:47:24 pm

Anyone?? Has anyone done any command line stuff in the PC version of Worker Node?


Return to posts index

Matthew Stamos
Re: Windows Worker Node Command Line Execution
on Apr 1, 2014 at 11:31:48 pm

Jeff does it work without the Variable?

I found this link and it appears you have this correct syntax for windows?
https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/e...


Please try sending a ticket to support at sqaurebox.com and let's escalate this up the support cue.
http://www.squarebox.com/exporting-logs-to-support/


Return to posts index


Jeff Schaap
Re: Windows Worker Node Command Line Execution
on Apr 2, 2014 at 3:13:11 pm

Matt,

Thanks for the response. I did try it without the variable and got the same erro message. I also tried doing this:

echo $p $g > C:\variable.log

But got the same error except it said "echo" was the command it could not find.

Under "Execute command line 4:" I use a "move" command (instead of the "mv" command I used on the Mac) and that never throws an error (???).

Unfortunately, our version of Worker doesn't have the handy "export these log files to a .zip" button. Can you tell me exactly which files you need and maybe where they are located and I can zip them manually.

Along the way I am so excited to hear yesterday that CatDV 11 is supporting AVCHD playback natively. This is going to change my life!! Thanks to everyone there for working hard to improve the product.

Jeff


Return to posts index

Dougal Matthews
Re: Windows Worker Node Command Line Execution
on Apr 2, 2014 at 5:45:42 pm

hi Jeff

you need to use the following syntax

cmd /c "mkdir C:\Users\MYPC\Desktop\MY_FOLDER"

where the mkdir and the path to make the folder are in " " quotes

that should get the mkdir command working for you

to export logs:

click the view logs button and the export option is at the top on the right side of the menu bar

then please mail the logs to support@squarebox.com along with a description of the problem and a link to this thread


thank you Dougal

Improvise Adapt and Overcome


Return to posts index

Jeff Schaap
Re: Windows Worker Node Command Line Execution
on Apr 2, 2014 at 8:32:36 pm

Dougal,

Thank you so much. The cmd /c and the quotes were what I was missing. I was able to get Worker to create a directory.

Still having a small issue though... The mkdir command I'm using is creating the "shadow path" to where I'll drop new proxy files. Under the Mac I would do this:

mkdir -p /Volumes/maxxraid1/CatDV_Previews$p

and that worked great since $p was always:

/Volumes/maxxraid1/Footage/[rest of the path to file]

However, in the Windows environment $p includes the drive letter and a ":\" so the string becomes:

Y:\Footage\[rest of the path to file]

So when I try to do this:

cmd /C "mkdir Y:\CatDV_Previews$p"

it get interpereted as:

cmd /C "mkdir Y:\CatDV_Previews\Y:\Footage\[rest of the path to file]"

ARRGGHHH. So the Y:\ being in there screws up my methodology. I tried figuring out a regular expression that would drop the first three characters in $p but to no avail. Any thoughts on how to do that or another way out of the conundrum?

Many Thanks,
Jeff


Return to posts index


Dougal Matthews
Re: Windows Worker Node Command Line Execution
on Apr 3, 2014 at 11:05:30 am

hi Jeff

Please can you send an email to support at sqaurebox.com so we can raise this as a support ticket

please can you include a description of the problem the version of the software you are using and having restarted the worker run your problem worker action on a couple of files and export the logs see here for guidance on this

http://www.squarebox.com/exporting-logs-to-support/

Thankyou Dougal

Improvise Adapt and Overcome


Return to posts index

Charlie Langrall
Re: Windows Worker Node Command Line Execution
on Jun 14, 2014 at 7:26:58 pm

Anyone know the correct way to execute a powershell script from within Worker? The following command works correctly from the Windows command line:

powershell -Command "C:\path_to_scripts\myScript.ps1"

When this command is run in Worker, myScript.ps1 executes correctly, but then Worker waits forever for powershell to exit.

Interestingly batch files execute correctly from Worker and return cleanly using:

cmd /C "C:\path_to_scripts\myScript.bat"

-Charlie Langrall


Return to posts index

Dougal Matthews
Re: Windows Worker Node Command Line Execution
on Jun 26, 2014 at 10:22:40 am

hi Charles

i think the problem is that the powershell isn't returning an end command to catdv so the worker doesn't know that the job has finished

you can reduce the time out in worker for the task so it auto terminated and picks up the next job but this is messy as worker will show the task as failed ( timed out )

a neater solution would be to wrap the powershell in a batch file and have worker run this batch you should then get a correct end of process notification in worker

thank you Dougal

Improvise Adapt and Overcome


Return to posts index


Charlie Langrall
Re: Windows Worker Node Command Line Execution
on Jun 26, 2014 at 9:57:49 pm

Thanks for your reply Dougal.

The problem is powershell actually does not exit after executing the script. You can confirm that it continues running by looking in Task Manager. I only see this "staying open" behavior when the powershell script is executed from Worker, by:

cmd /C "powershell -Command C:\path_to_scripts\myScript.ps1"

Following your suggestion, I placed the above command into a batch file. When I double-click the batch file to execute it, or if I execute it by name from the command prompt, powershell opens, executes myScript.ps1 and then closes. Perfect.

But when I execute this same batch file from Worker, powershell continues running after its script completes, just as before.

The work-around I've resorted to is to launch powershell from Worker using the START command, something like this:

cmd /C "START powershell -Command C:\path_to_scripts\myScript.ps1"

This method gets myScript.ps1 executed and powershell then exits. The problem here is Worker never receives the exit status of the powershell script. It receives exit code 0 (success) from the START command, whether the powershell script had errors or not.

Am I wrestling with a Windows 7 security feature perhaps? Worker is somehow not fully authorized to execute powershell scripts?

-Charlie Langrall


Return to posts index

Dougal Matthews
Re: Windows Worker Node Command Line Execution
on Jun 27, 2014 at 11:41:43 am

hi Charles

i'm not too familiar with powershell but would it be possible to include an exit command in your powershell script with exit codes for successful and unsuccessful completion this should both close the pwoershell script and tell catdv what is happening ( as we monitor and report on standard ERRORLEVEL and stderr conditions )

thankyou Dougal

Improvise Adapt and Overcome


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]