cancel
Showing results for 
Search instead for 
Did you mean: 

External commands fail in Background Jobs on Application server

Former Member
0 Kudos

Hi,

We are having problems with jobs that include External Commands. The jobs run successfully if on the Central Instance. But if they run on either of the two Application Server's it fails with 'Unable to connect to Target Host' error message.

I can run the External Commands from SM49 on both AS's. But as soon as its run in background it fails.

I have read the rfcexec.sec file needs to be in the .\work directory on the application so I have this in place.

This is what gets written to dev_w0 when the failure occurs :

M *****************************************************************************

M *

M * LOCATION SAP-Gateway on host <APP_SERVER> / sapgw75

M * ERROR timeout during allocate

M *

M * TIME Fri May 30 11:20:34 2008

M * RELEASE 640

M * COMPONENT SAP-Gateway

M * VERSION 2

M * RC 242

M * MODULE gwr3cpic.c

M * LINE 1795

M * DETAIL no connect of TP sapxpg from host <CENTRAL_INSTANCE.domain>

M * after 22 sec

M * COUNTER 483

M *

M *****************************************************************************

M

A RFC 1446 CONVID 48742194

A * CMRC=27 DATA=0 STATUS=0 SAPRC=242 ThSAPECMINIT

A RFC> ABAP Programm: SAPLCRFC (Transaction: )

A RFC> User: <USERNAME> (Client: 300)

A RFC> Destination: %_TCPIP_%1 (handle: 2, , )

A RFC SERVER> RFC Server Session (handle: 1, 48741194, {C4A35AF0-2F4C-4E36-98C3-9999A6FE99D7})

A RFC SERVER> Caller host: iblonc4306_P75_75

A RFC SERVER> Caller transaction code: (Caller Program: RSBTCXPG)

A RFC SERVER> Called function module: SXPG_STEP_COMMAND_START

I'd really appreciate any suggestions on how to fix this issue??

Thanks,

Kye

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185954
Active Contributor
0 Kudos

Hello,

Also make sure that you have met the prerequisites for running external program.

Check the following link for the pre-requisites:

http://help.sap.com/saphelp_47x200/helpdata/en/c4/3a7fbb505211d189550000e829fbbd/frameset.htm

Regards,

Siddhesh

Former Member
0 Kudos

Hi Siddhesh,

Thank you for your prompt response. I'm confident all of the prerequisites are set correctly.

I have enabled the trace on SAPXPG but its only writing to the log dev_cp and dev_xpg when the command is executed successfully.

For example, if I use SM49 to run the External command from one of the Application Servers dev_cp & dev_xpg are updated and the command completes successfully. However if I run the job (that has the external command as a single step) from SM37 it fails and doesn't log anything to dev_cp or dev_xpg??

Is this normally how the trace would work?

Thanks again,

Kye

former_member185954
Active Contributor
0 Kudos

Does the user running the background job have the required authorizations.

Please note there are two users as far as background jobs are concerned.

1 . User that schedules the job

2. User under whose priveleges the job step is defined.

Make sure both users have the required authorizations.

Regards,

Siddhesh

Former Member
0 Kudos

Both the Job and Job Step are owned by the same User. This user definitely has authorisation to run external commands.

The job runs successfully on the Central Instance with this user. It only fails when its set to run on either of the application servers.

former_member185954
Active Contributor
0 Kudos

Hello Kype,

Do the <sid>adm users on respective application server allowed to perform a remote login (at UNIX level) on your Central instance ?

I think your app servers are unable to perform a remsh to Central instance.

Check this file

/var/adm/messages

on your Central Instance as well as Application Instance.

Regards,

Siddhesh

Former Member
0 Kudos

Hi Siddhesh,

We are running on a Windows / SQL environment and the <SID>adm and SAPService<SID> accounts both have Admin rights on all three servers.

They also have 'Log on as a batch' and 'Act as part of the OS' set in the Local Security Settings.

The remesh function you mention for Unix - Is there a similar function for Windows?

Cheers,

Kye

former_member185954
Active Contributor
0 Kudos

Hello,

For windows, you might want to have the /sapmnt of all app servers accessible to Central Instance and vice versa accessible via <sid>adm user.

Regards,

Siddhesh

Former Member
0 Kudos

Hi Siddhesh,

We are currently using this configuration.

Cheers,

Kye

former_member185954
Active Contributor
0 Kudos

I need to run now... out of office will have a look at this on monday maybe. Do you see a different look and feel of the SDN forum ????

Former Member
0 Kudos

Looking at this over the weekend I believe the error is being caused by using a DNS alias in the External Command step. The alias didn't seem to cause an issue when the job ran on the Message Server, but when the job ran on an Application Server and the External Command step referenced the alias the job would fail. We solved this issue by pointing all External Command steps to a host name rather than the DNS Alias.

Hopefully this might help someone in the future.

former_member185954
Active Contributor
0 Kudos

good, problems can be so confusing sometimes.

can you please mark the question as answered in that case ?

Regards,

siddhesh

former_member185954
Active Contributor
0 Kudos

Hello Kye,

Can you post the dev_cp or dev_xpg files.

Check the following link here for analysing sapxpg problems.

http://help.sap.com/saphelp_47x200/helpdata/en/c4/3a80c4505211d189550000e829fbbd/frameset.htm

Regards,

Siddhesh