CMN_1949 Error:[Pre/Post Session Command] in Informatica - informatica-powercenter

I am getting the error:
CMN_1949 Error:[Pre/Post Session Command].The shell command failed with exit code=2.
The shell command contains only the code:
/bin/rm $INFA_HOME/server/infa_shared/Cache/*.idx*;
Can you help me?

Hope you are using the shell command in windows environment and since it could not execute your command . Try using MS-DOS command if in case you are using in the windows enviromnent . Use the command del inorder to delete the files . If you are using Unix environment kindly execute you command in the console and try , if you are getting any error .

Related

Error while trying to run shell script using OS process sampler in jmeter

one.jmx file takes command line arguments so i am putting the long command to run one.jmx in a shell script(RUN_GET_CALLS.sh). Now i am using Two.jmx which calls One.jmx via the shell script using OS process sampler.
When i execute Two.jmx it is giving error
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect
1548833794770,4,"Patient_""_id""",500,"Exception occurred whilst executing system call: java.io.IOException: Cannot run program ""bash /home/ubuntu/HSDP_Suit/TestSuite/JMX_files/RUN_GET_CALLS.sh"" (in directory ""/home/ubuntu/JMeter/apache-jmeter-5.0/bin""): error=2, No such file or directory",Patient 1-4,text,false,,0,0,6,6,null,0,0,0
I tried putting path in Working directory box also but it is not working
Your syntax is a little bit incorrect you should configure the OS Process Sampler as follows:
Command: /bin/bash
Working directory: /home/ubuntu/HSDP_Suit/TestSuite/JMX_files
Argument #1: -c
Argument #2: ./RUN_GET_CALLS.sh ${PROPERTY_FILE} ${RESOURCE} ${PARAMETERS_STRING} ${FILE_NAME} ${RESULT_FILE}
Example configuration screenshot:
As per bash man page
-c string
If the -c option is present, then commands are read from string. If there are arguments after the string, they are assigned to the positional parameters, starting with $0.
More information: How to Run External Commands and Programs Locally and Remotely from JMeter

How to configure copy command in nifi?

i wants to know how to configure the executestream command for the below command.
copy C:\input\ip.txt \\host2\C:\destFolder\ip.txt
Actually if i open cmd prompt(AnyPath) then write this command it could worked in windows.
But i need to process those command in NiFi.
I tried those command in following attributes like below.
Command Arguments:copy C:\input\ip.txt \\host2\C:\destFolder\ip.txt
Command Path:C:\Windows\system32\cmd.exe
Argument Delimiter: space
Here after success of executestream command processed in OutputStream relationship but functionality of the command not issued.
In that command i have copy the file(ip.txt) from host1 into host2 machine.Generally if i run that command in cmd.exe then file copied into host2.
But if configure those parameters in ExecuteStreamcommand i have received outputstream but my command not run and file not moved into host2.
Can anyone guide me to resolve this?
you are trying to call a command without any streaming of the flow file.
so you need ExecuteProcess processor
Example with dir command:
Command : cmd
Arguments : /C dir c:\11
Delimiter : [space]
/C for cmd means call and exit
Command Arguments:copy C:\input\ip.txt \\host2\C:\destFolder\ip.txt
Add to front [/C]
Command Arguments:**/C** copy C:\input\ip.txt \\host2\C:\destFolder\ip.txt

Jenkins fails with Execute shell script

I have my bash script in ${JENKINS_HOME}/scripts/convertSubt.sh
My job has build step Execute shell:
However after I run job it fails:
The error message (i.e. the 0: part) suggests, that there is an error while executing the script.
You could run the script with
sh -x convertSubt.sh
For the safe side, you could also do a
ls -l convertSubt.sh
file convertSubt.sh
before you run it.
make sure that the script exist with ls
no need to sh , just ./convertSubs.sh ( make sure you have run permissions)

Not Able to Run PowerShell Script from CMD

I want to execute a PowerShell script from Command Prompt. I have verified script from PowerShell, it worked fine. I went to script location and executed it as
./hyperv_disk_ops.ps1 -op 'getDiskAttachmentInfo' -vmid '{6612D0CB-BCC3-44D4-988B-526500578D54}' -disk_ids ("Microsoft:7B036CE0-5D67-46BA-AF7B-B2AFD8DD7946\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\D")
But when I tried running it from command prompt as
powershell.exe C:\hyperv_disk_ops.ps1 -op 'getDiskAttachmentInfo' -vmid '{6612D0CB-BCC3-44D4-988B-526500578D54}' -disk_ids ("Microsoft:7B036CE0-5D67-46BA-AF7B-B2AFD8DD7946\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\D")
it gave me an error
ERROR: Failed to find object of [Microsoft:7B036CE0-5D67-46BA-AF7BB2AFD8DD794683F8638B-8DCA-4152-9EDA-2CA8B33039B400D] disk which is associated with [{6612D0CB-BCC3-44D4-988B-526500578D54}] VM.
Both are exact same but why it is not running from Command Prompt?
Try running from the command prompt with double backslashes, like so:
powershell.exe C:\hyperv_disk_ops.ps1 -op 'getDiskAttachmentInfo' -vmid '{6612D0CB-BCC3-44D4-988B-526500578D54}' -disk_ids ("Microsoft:7B036CE0-5D67-46BA-AF7B-B2AFD8DD7946\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\0\\0\\D")
It looks like, in the error you provided, all of the slashes are being omitted in the disk path.

Running a PHP CLI Script from a PHP Application

I have a php file which needs to be executed in CLI from my Php application which runs on CodeIgniter framework. I tried the exec and shell_exec command and it seems to not start the process. Please find the code below which I try to execute.
$phpPath = exec('which php');
$cmd = $phpPath.' '.dirname(__DIR__).'/API/notification/NotificationServer.php';
echo "<pre>".shell_exec($cmd)."</pre>";
When I try running the above in Terminal it executes fine. I need to automatically trigger this once the user has a session set.
The path/$cmd variable prints
when I print the variable $cmd i get the below output, and the below when given in terminal works fine.
/usr/bin/php /Users/lalithb/Desktop/Android/AndroidWS/API/notification/NotificationServer.php
the above command works fine in the Terminal. When i try to exec/shell_exec it, it is not working.
APACHE_ERROR LOGS ARE :
sh: line 1: 2437 Trace/BPT trap: 5 /usr/bin/php
sh: line 1: /Users/lalithb/Desktop/Android/AndroidWS/API/notification/NotificationServer.php: Permission denied
Can someone help me out in running this above code in CLI ?
I solved the problem, Guess there would be someone else like me trying to access the restricted folders. I found the solution here
http://ubuntuforums.org/showthread.php?t=1302259
exec('chmod +x'.dirname(__DIR__).'/API/notification/NotificationServer.php);
The above worked the magic.

Resources