cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver adapter OS command does not invoke script

0 Kudos
247

Hi All,

I have requirement similar to the one in this thread:

Requirement:

PI need to pick the file from source directory on PI server which is Windows 2003 and send it to target directory using SFTP.

I'm using PSCP command for this purpose.

When I run the PSCP script from command prompt on PI server on Windows 2003, script is working fine.

Same batch file is called from PI File adapter but script is not getting invoked.

In the communication channel logs, "Executed OS command" is available. There are no Error/Warning messages in the log.

NFS transport protocol is used in the File communication channel.

Complete directory path of the batch file is mentioned in File channel -> Run Operating System command after message processing. Also tried giving timeout in seconds but still not working.

Command line in Receiver file adapter:

C://Outbound/SCPtest.bat %F SFTPserver.com:/dir/test

Please let me know if anyone has experience on this and tested successfully.

Thanks,

John

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

any chance you can use the info from my blog to catch the error ?

Regards,

Michal Krawczyk

0 Kudos

Hi Michael,

I tried the blog and caught the following error:

'echooo' is not recognized as an internal or external command,

operable program or batch file.

Hi Greg,

The user has authorization to put files from PI server to the SFTP. The script works from Windows server when executed from command prompt but not from Communication channel. PI server is on Windows server. I'm not sure what you meant when tried from OS level and but not from PI.

Thanks,

John

former_member184681
Active Contributor
0 Kudos

Hi John,

I'm not sure what you meant when tried from OS level and but not from PI.

I meant that your script works well when executed from Windows, but not when executed from the Communication Channel. And these symptoms are identical to the case described in that thread: , there the authorizations were the solution.

In relation to Michal's response and his blog: do not use the whole

cmd.exe /C "echooo error 2> D:\usr\sap\CXX\SYS\global\demo1.txt"

statement in your communication channel. I don't really think this is the point in Michal's blog. Add the statement like

> log.txt

to your current statement instead. Thanks to this, the results of your .bat script will be written to the log.txt file in the same directory, and most probably you will find some error details from your script there. It is the ">" character that allows you to put results of one command somewhere else then the command line itself.

Please let us know if you had further questions.

Hope this helps,

Greg

0 Kudos

Thanks Greg, for the elaboration. I will try it out and see if that helps me catch the error and fix it.

Regards,

John

0 Kudos

I am getting the following error, anyone knows how to fix this?

The server's host key is not cached in the registry. You

have no guarantee that the server is the computer you

think it is.

The server's rsa2 key fingerprint is:

xxxxxxxx.........

Connection abandoned.

Lost connection

Thanks,

John

Former Member
0 Kudos

Hi John,

Maybe this helps you: [http://www.aspdeveloper.net/tiki-index.php?page=LinuxTipsPuttyNotCachingKeys] this is clearly not a pi problem anymore but a PSCP one.

Regards,

Horia

0 Kudos

Hi Horia,

Thanks for the link but I had already gone through the link, the problem is I don't get the prompt to store the key in cache. We only access to a specific directory of the SFTP server, could this be the problem why we are not seeing the prompt to cache the key? Do we also need to give the SFTP server admin to store our ssh key and we need to store their SSH key on our server which is Windows server?

Regards,

John

0 Kudos

Anyone knows how to fix this error?

The server's host key is not cached in the registry. You

have no guarantee that the server is the computer you

think it is.

The server's rsa2 key fingerprint is:

xxxxxxxx.........

Connection abandoned.

Lost connection

Please note that I don't get prompt to store key in cache.

Thanks,

John

Former Member
0 Kudos

Hi,

John. You definitely need to store the target's server key in your windows registry. If for example you would use winscp the first time you connect you will get the prompt. WINSCP also has the possibility of running a script to upload the files.

Regards,

Horia

0 Kudos

Hi!!!

Just to update the url blog (in 2020 the url sends to error 'Page no found')

https://blogs.sap.com/2005/08/17/xi-operation-system-command-error-catching/

L GF

Answers (1)

Answers (1)

former_member184681
Active Contributor
0 Kudos

Hi John,

Did you try the solution provided in the thread you linked? Are you absolutely sure your PI user has sufficient authorization in the target SFTP server? Note that also in Geetha's case the script was executed successfully on OS level, but not from PI.

Hope this helps,

Greg