sassoftware / saspy

A Python interface module to the SAS System. It works with Linux, Windows, and Mainframe SAS as well as with SAS in Viya.
https://sassoftware.github.io/saspy
Other
367 stars 149 forks source link

This release of IOM Bridge for Java does not understand the command sent by the peer #492

Closed jc-hart closed 1 year ago

jc-hart commented 1 year ago

I am trying to connect to a SAS Workspace server but keep going round in circles.

My python code is simply:

import saspy
sas = saspy.SASsession(cfgname='winiomwin') 

My sascfg_personal.py file is:


SAS_config_names=['winlocal', 'winiomwin', 'iomcom']

winlocal = {'java': 'C:/Program Files/Java/jre1.8.0_341/bin/javaw.exe',
            'encoding': 'windows-1252'}

winiomwin  = {'java': 'C:/Program Files/Java/jre1.8.0_341/bin/javaw.exe',
              'authkey': 'IOM_Prod_Grid1',
              'provider': 'sas.iomprovider',
              'iomhost': 'sasserver.localdomain.com',
              'iomport': 38080}

iomcom = {'iomhost': 'sasserver.localdomain.com',
          'iomport': 8591,
          'provider': 'sas.iomprovider',
          'user': 'my.name@localdomain.com',
          'encoding': 'windows-1252'}

I'm running the latest version of SAS 9.4, which I can connect to remotely, using the port 38080 and java version "1.8.0_341" (Java(TM) SE Runtime Environment (build 1.8.0_341-b10), Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode))

saspy.SASsession(cfgname='winlocal') works exactly as expected. (I also have SAS installed on the client machine.)

I have tried various options with/without authkey & provider but when I try the winiomwin config I get:

_We failed in getConnection This release of IOM Bridge for Java does not understand the command sent by the peer: 72.

SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.

Attempted to run program C:/Program Files/Java/jre1.8.0_341/bin/javaw.exe with the following parameters:['C:/Program Files/Java/jre1.8.0_341/bin/javaw.exe', '-classpath', 'C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\saspyiom.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\ProgramData\Anaconda3\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '51955', '-stdoutport', '51964', '-stderrport', '51965', '-iomhost', 'mm-sas1.chapel-house.com', '-iomport', '38080', '-user', 'jon.hart@chapel-house.com', '-lrecl', '1048576', '']

No SAS process attached. SAS process has terminated unexpectedly. Invalid response from SAS on inital submission. printing the SASLOG as diagnostic_

**Traceback (most recent call last):

File ~.spyder-py3\temp.py:25 in sas = saspy.SASsession(cfgname='winiomwin') # winlocal winiomwin iomcom

File C:\ProgramData\Anaconda3\lib\site-packages\saspy\sasbase.py:567 in init self.pyenc = sas_encoding_mapping[self.sascei]

KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'**

If I try the iomcom config I get:

Param 'sascfgname' was ignored due to configuration restriction Param 'cfgname' was ignored due to configuration restriction

and the application hangs.

tomweber-sas commented 1 year ago

I haven't seen that specific error before. It makes me think that the port (or the host) isn't quite right. It needs to be the host where an object spawner is running, listening on that port for workspace server connections. The port 38080 seems a bit unusual, and in the COM (which I wouldn't suggest using) config def, you have the more likely 8591 port, which is the default port for a workspace server. Have you tried that with your winiomwin config def? Also, 'provider' isn't a key for the IOM access method; though it's just being ignored, so it's not actually a problem.

tomweber-sas commented 1 year ago

Have you found out the correct host/port for the workspace server you're trying to connect to? Again, it seems you're connecting to something at the host port you tried, but not an object spawner trying to get a workspace server. This error (which I've never seen before), seems like it's trying to talk to the wrong kind of server.

_We failed in getConnection
This release of IOM Bridge for Java does not understand the command sent by the peer: 72.
hartjc commented 1 year ago

I’m currently waiting for SAS Support and it’s looking increasingly likely that the issue is with the SAS setup. Please feel free to close/delete this issue. (I say delete because other users, with a similar issue, may end joining my wild goose chase.)

hartjc commented 1 year ago

Thanks for your response.

tomweber-sas commented 1 year ago

Hey, no problem, and just reopen if you still need some help. Or open a new one for anything else you need! Thanks, Tom