Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


peric.danijela
2014-05-07T17:58:29Z
Hi,

I'm fairly new to VC, just installed it today and trying to get some basic stuff up and running in it as a proof of concept.
I am executing a Remote Execute task using a credential that is an admin on the remote server (though this is only for testing, later on we would need it to be a non-admin user). I am trying to execute a python script saved on the network with the local python.exe, and I can't seem to hit the right combination of credential settings and task definition.

So the task is defined something like this:
Command: C:\Python\python.exe
Arguments \\mynetworklocation\pythonscripts\test.py

The output that I get is:
The system cannot find the file specified.Exception in Task: System.Exception: Non zero exit code

I have even tried copying the script locally but I still receive the same error.

Please provide suggestions on how to make it work with scripts on the network, because we cannot copy them locally to all the servers...

Regards,

Danijela
Sponsor
Forum information
peric.danijela
2014-05-08T13:58:26Z
Hi,

Please let me know if my problem was not well described or if there is some information missing in order for you to be able to help me.

Regards,

Danijela
Support
2014-05-09T08:23:55Z
Hi Peric,

the problem is that the Windows API for remote execution is limited in terms of accessing network drives by default. That is why it cannot access your folder. Try a local folder instead.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
peric.danijela
2014-05-09T09:28:31Z
Hi,

Our infrastructure is set in such a way that all the scripts are stored in a shared location, and they are executed on a number of servers. The scripts cannot be copied locally.
We first wanted to test the concept of one VC server remotely executing tasks on servers, because we didn't want to set up yet another decentralized task management system, like we have now. Setting up multiple VC servers (one per execution server) to run the tasks locally would mean that not only we run the risk that if an execution server (and with that the VC server) becomes unavailable we are unable to quickly switch to executing those tasks on another server, but we would also not be able to set up a cluster for the VC servers, therefore having even more risk. It also takes away the possibility of having an overall view on what we have currently running.
Is there no way to allow for network access through remote execution?

Thanks,

Danijela

Support
2014-05-09T09:40:00Z
The problem might either be permissions or context specific (decribed in this post: http://stackoverflow.com...couldnt-access-using-wmi ).

So, what you could do first is to create a small script that maps that drive. Be sure to make it persistent so it works for each call:

http://pcsupport.about.c...ce/p/net-use-command.htm 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
peric.danijela
2014-05-09T14:52:38Z
I am now having problems executing a simple .bat file in VC - is there something I'm overlooking?
I have saved the .bat file as a simple wrapper around the py call with no net use mappings on the server, and it works when I call it with psexec with a specified username and password, but I can't seem to get it to run in VC with a credential, always getting incorrect function errors.

Command: C:\Folder\mybatch.bat
Arguments: "python arguments"

psexec command: psexec \\server -u domain\username -p password C:\Folder\mybatch.bat "python arguments"

The user I am running under is an admin on the server.


Danijela
Support
2014-05-09T15:34:11Z
What is important here is that you use full path to python.exe in your script - do you do that? If yes, what error do you get?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
peric.danijela
2014-05-09T15:50:07Z
I have now changed the bat file to call python with a full path (though with psexec I didn't even need to explicitly call python, the py file was by default opened in python).
The change works again through psexec, but not in VC.

Error message: Incorrect function.Exception in Task: System.Exception: Non zero exit code

bat file:
C:\Python27\python.exe C:\Folder\myscript.py %~1
Support
2014-05-09T16:16:35Z
Originally Posted by: peric.danijela 

I have now changed the bat file to call python with a full path (though with psexec I didn't even need to explicitly call python, the py file was by default opened in python).
The change works again through psexec, but not in VC.

Error message: Incorrect function.Exception in Task: System.Exception: Non zero exit code

bat file:
C:\Python27\python.exe C:\Folder\myscript.py %~1



Not sure why you get these problems. Could it be something with working directory? There are different execution alternatives though:

1. schedule PSExec through Execute Task
2. use Execute Task in remote mode - requires VC server installation on remote server.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top