Ecc Queue error in input message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2018 02:18 AM
I receive the following error while i try to execute a scheduled job manually(to place a file on mid server) -
probe_time="2922" result_code="4"
<error>The process cannot access the file 'D:\PO_IDs_20180720105610.csv' because it is being used by another process.</error>
What is causing this error and how to resolve this ?
Any suggestions please ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2018 02:33 AM
Hi, can you log onto the MID server host and check if you have the .csv file open in Excel or other application?
Its also likely that an error resulted in the file handler holding the file open. In your MID server code that accesses the file you should use a try, catch, finally to make sure the file handler is already closed.
Try stopping the MID server process from the MID server and then restarting it, this might release the file handler. If not try restarting the MID server.
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2018 04:30 AM
Hi Andrew,
Thank you for your reply.
I restarted the mid server and tried again, I get a different error this time.
The error is:
error="Unable to find script(s) specified in parameters. Make sure the script(s) associated with probe are passed down properly." probe_time="0" result_code="82"
Here is the code I am using to form the payload:
sendECC: function (cmd) {
var payload = '<parameters>' +
'<parameter name="skip_sensor" value="true"/>' +
'<parameter name="probe_name" value="Windows - Powershell"/>' +
'<parameter name="senddata.ps1" value=\'' + cmd + '\'/>' +
'</parameters>';
var sysid = '';
var grECC = new GlideRecord('ecc_queue');
grECC.initialize();
grECC.agent = 'mid.server.' + gs.getProperty('hcm.mid_server');
grECC.topic = 'Powershell';
grECC.name = 'Windows - PowerShell';
grECC.source = '127.0.0.1';
grECC.queue = 'output';
grECC.payload = payload;
sysid = grECC.insert();
return sysid;
},
cmd is a variable i am passing from another function.
When i try printing it in logs, it looks like this:
ROGER CMD = echo "Contract ID|Contract Description|Purchase Order ID|Purchase Order Description" | Out-File -Encoding utf8 -FilePath D:\PO_IDs_20180720130627.csv
And subsequent logs are also printed which contain the data, i am removing the data here and pasting:
ROGER CMD = echo "DATA GOES HERE" | Out-File -Encoding utf8 -FilePath D:\PO_IDs_20180720130627.csv -Append
I do not understand why that error then and how to fix it.
Any help would be appreciated.
Kind Regards,
Vineetha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2018 04:39 AM
Has it got something to do with me sending large chunks of data in one go ? For example, if i keep blocksize(how many rows are sent in one block) as 50 or 100 or more ?