#1452 SXE generates STAFConnectionProviderConnect: gethostbyname_r

Unix::Linux
closed-invalid
Sharon Lucas
5
2012-05-04
2012-05-03
Anonymous
No

I have STAF 3.4.9 on two systems (hostC and hostA) and hostC is running SXE 3.0.3 and registerd as below in STAF.cfg

...
trust default level 5
SERVICE SXE LIBRARY JSTAF EXECUTE {STAF/Config/STAFRoot}/services/sxe/STAFSXE.jar PARMS LOGNAME SXEServiceLog

MY cmd.sxe contain:

hostC VAR SET SYSTEM VAR STAF/Service/SXE/LogLevel=File
hostC VAR GET SYSTEM VAR STAF/Config/OS/Name
hostA VAR GET SYSTEM VAR STAF/Config/OS/Name
hostA PROCESS START SHELL COMMAND "uname -a" WAIT RETURNSTDOUT

I have firewalls completely disabled on both host (RHEL 5.6 x86_64)
but every time on execution via SXE is get

# staf hostC sxe execute file /user/home/cmds.sxe
Error submitting request, RC: 4001
Additional info
---------------
Loop Number : 1
Line Number : 1
Command Number: 1
Command : hostC VAR SET SYSTEM VAR STAF/Service/SXE/LogLevel=File
RC : 16
Result : STAFConnectionProviderConnect: Error resolving host name: Unknown host name: hostC VAR, gethostbyname_r(): 22, Endpoint: ssl://hostC VAR

If I run all command from bash prompt they run fine and generate correct outputs.

Discussion

  • Sharon Lucas
    Sharon Lucas
    2012-05-04

    Note that the error message says that "hostC VAR" is an unknown host name, not "hostC" is an unknown hostname. So, it appears that there is not a space between the hostname (hostC) and the service name (VAR) in your cmd.exe file. Please recheck your cmd.sxe file and verify that there really is one space (and not a tab, or multiple spaces, or some other character) between the hostname and the servicename (and between the servicename and the request). A single space is the only field separator that the SXE service understands. Once you fix that, it should work fine.

    When I run your cmd.sxe (with thie hostname modified to a valid one for me), and using a space as the field separator, it runs fine with SXE 3.0.3 and STAF 3.4.9.

    If I use a tab instead of a space between the hostname and servicename in my cmd.sxe file (which is not supported), then I get the same error as you.

    Closing as invalid. But if you still are having any issues after fixing your cmd.sxe file, post again.

    Note that you may want to look at using STAX (instead of SXE) as it is also an execution engire for STAF, but with many more features and capabilities.

     
  • Sharon Lucas
    Sharon Lucas
    2012-05-04

    • assigned_to: nobody --> slucas
    • status: open --> closed-invalid