Closed sulnm019 closed 4 years ago
Hey, that error is that it can't find the java command you have specified in your config file.
The OS Error was:
The system cannot find the file specified
You can see that here: https://sassoftware.github.io/saspy/troubleshooting.html#java-problems
Looking at the next line:
Attempted to run program C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java
I see that you have single backslashes in your paths. '\' (Note I had to type in two of them here to get one to display) Python on windows has issues with paths because backslashes can be used as escape sequences.
You have the following in yout config:
winlocal = {'java' : 'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java',
You will see that the backslash b in \jre\bin has been converted to a backspace, leaving \jrin
On windows you either need to use double backslashed in all your paths, or mark the strings as raw: r'C:\a\b\c' or 'C:\\a\\b\\c'
You can see a note to this effect in the config doc at: https://sassoftware.github.io/saspy/install.html#iom-using-java
adding these links so if others search this issue, they see the doc links too.
Note
If you have a \u or \U in your classpath string, like: “c:\User\sastpw\...’,
you will have to use either a double backslash instead, like
\\u or \\U (“c:\\User\sastpw\...’) or mark the string as raw (not unicode)
with a r prefix, like r”C:\User\sastpw\...” or else you will get an error
like this: SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode
bytes in position 3-4: truncated UXXXXXXXX escape
Hey Tom, I changed all the directories to a double backslash and I still get the same error
SAS_config_names=['default']
SAS_config_options = {'lock_down': False, 'verbose' : True }
SAS_output_options = {'output' : 'html5'}
default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }
ssh = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en', 'ssh' : '/usr/bin/ssh', 'host' : 'remote.linux.host', 'encoding': 'latin1', 'options' : ["-fullstimer"] }
cpL = "/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/sas.svc.connection.jar" cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/log4j.jar" cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/sas.security.sspi.jar" cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/sas.core.jar" cpL += ":/opt/github/saspy/java/saspyiom.jar"
iomlinux = {'java' : '/usr/bin/java', 'iomhost' : 'linux.iom.host', 'iomport' : 8591, 'encoding' : 'latin1', 'classpath' : cpL }
iomwin = {'java' : '/usr/bin/java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252', 'classpath' : cpL }
cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar"
cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\pfl-basic.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\pfl-tf.jar"
cpW += ";C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904400.1.0.20160824190000_v940m4\sas.rutil.jar" cpW += ";C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904400.0.0.20160427190000_v940m4\sas.rutil.nls.jar" cpW += ";C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\sastpj.rutil.jar"
winlocal = {'java' : 'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', 'encoding' : 'windows-1252', 'classpath' : cpW }
winiomlinux = {'java' : 'java', 'iomhost' : 'linux.iom.host', 'iomport' : 8591, 'encoding' : 'latin1', 'classpath' : cpW }
winiomwin = {'java' : 'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252', 'classpath' : cpW }
winiomIWA = {'java' : 'java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252', 'classpath' : cpW, 'sspi' : True }
iomcom = { 'iomhost': 'mynode.mycompany.org', 'iomport': 8591, 'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c', 'provider': 'sas.iomprovider', 'encoding': 'windows-1252'}
#
httpsviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com', 'context' : 'Data Mining compute context', 'authkey' : 'viya_user-pw', 'options' : ["fullstimer", "memsize=1G"] }
httpviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com', 'ssl' : False, # this will use port 80 'context' : 'Data Mining compute context', 'authkey' : 'viya_user-pw', 'options' : ["fullstimer", "memsize=1G"] }
Reloaded modules: sascfg_personal Using SAS Config named: winlocal The OS Error was: The system cannot find the file specified
SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.
Attempted to run program C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java with the following parameters:['C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\x08in\java', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\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', '54393', '-stdoutport', '54394', '-stderrport', '54395', '-zero', '-lrecl', '1048576', '']
If no OS Error above, try running the following command (where saspy is running) manually to see what is wrong: C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\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 54393 -stdoutport 54394 -stderrport 54395 -zero -lrecl 1048576
No SAS process attached. SAS process has terminated unexpectedly. Traceback (most recent call last):
File "
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/sulnm019/.spyder-py3/temp.py", line 16, in
File "C:\ProgramData\Anaconda3\lib\site-packages\saspy\sasbase.py", line 460, in init pyenc = sas_encoding_mapping[self.sascei]
KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'
Hey, yeah, that's better. You can't trust what this displays :) So, also change this: winlocal = {'java' : 'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', ' The error you are getting is that java.exe can't be found. You would then need the paths for the jars to work once java can run, so the changes above were also needed, next.
I changed it to have double backslash as well
but you're getting the same error that java can't be found? Did you restart your python process so it picks up the change?
yes, I just restarted the process and the change is note being picked up..
IPython 7.6.1 -- An enhanced Interactive Python.
runfile('C:/Users/sulnm019/.spyder-py3/temp.py', wdir='C:/Users/sulnm019/.spyder-py3') Using SAS Config named: winlocal The OS Error was: The system cannot find the file specified
SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.
Attempted to run program C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java with the following parameters:['C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\x08in\java', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\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', '54748', '-stdoutport', '54749', '-stderrport', '54750', '-zero', '-lrecl', '1048576', '']
If no OS Error above, try running the following command (where saspy is running) manually to see what is wrong: C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\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 54748 -stdoutport 54749 -stderrport 54750 -zero -lrecl 1048576
No SAS process attached. SAS process has terminated unexpectedly. Traceback (most recent call last):
File "
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/sulnm019/.spyder-py3/temp.py", line 16, in
File "C:\ProgramData\Anaconda3\lib\site-packages\saspy\sasbase.py", line 460, in init pyenc = sas_encoding_mapping[self.sascei]
KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'
I also appreciate you getting back to me so quickly. Thank you for your help
ok, that doesn't have the change. So, now we verify what file it's using vs. the file you changed. Is this the current version of saspy?
Can you submit the following and we'll see what it's using:
import saspy saspy.SAScfg saspy.list_configs()
you should see something like the following:
>>> import saspy
>>> saspy.SAScfg
'/opt/tom/github/saspy/saspy/sascfg_personal.py'
>>> saspy.list_configs()
['/opt/tom/github/saspy/saspy/sascfg_personal.py', '/opt/tom/github/saspy/saspy/sascfg_personal.py', '/r/sanyo.unx.sas.com/vol/vol810/u81/sastpw/.config/saspy/sascfg_personal.py']
>>>
sure thing! happy to help
Ah, which one did you edit?
the one in the .config folder
okay the error message changed its now:
Using SAS Config named: winlocal We failed in getConnection The application could not find a command to launch a SAS Workspace Server. 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\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java with the following parameters:['C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\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', '54832', '-stdoutport', '54833', '-stderrport', '54834', '-zero', '-lrecl', '1048576', '']
Be sure the path to sspiauth.dll is in your System PATH
yep, so, it's using the other. You can edit the other, or move to a different directory when running pythong (I expect you'tr in you user dir, so it' s picking up that first), or you can use SASsession(cfgfile=....) with the one you editted.
ok, so now we're at: number 4 here: https://sassoftware.github.io/saspy/troubleshooting.html#iom-specific-errors
Can you check your registry to see what command is registered to start SAS (based upon the info in that link.
how can i check my registry? sorry if this isnt the brightest question someone could ask
The registry key to look at is listed after number 5 in that same section, you might need to scroll down to see that. 4 and 5 kinda go together a bit.
On windows, you can use the command regedit. You don't need to edit anything, just browse/look at it.
Also, if you double click on a .sas file, what happens (that's the same thing - it used the command in that registry entry). Is it set for EG or something other than your sas.exe?
it is set in EG
Would this be it? "C:\Program Files\SASHome\SASEnterpriseGuide\7.1\SEGuide.exe" "%1"
It is set to use EG? ok. Assuming you want it to stay that way, you can use the workaround in the trouble shooting guide to specify the command for saspy, so that you still get EG when you click .sas files. No need to break that for you just to use saspy also. :)
Can you add the following to your config, with the correct path to your sas.exe:
'javaparms' : ['-Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE"']
I would put the full path with double backslashed, and not that jiberish windows path that can't support blanks nonsense.
And, yes, that looks like how it starts EG with the file you click on.,
Looking at your jar paths, though, it looks like your SAS install is in the usual place, so that exact path listed above could be correct.
winlocal = {'java' : 'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java',
'encoding' : 'windows-1252',
'classpath' : cpW,
'javaparms' : ['-Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE"']
So the above may just work right for you.
Seems to not work,
Reloaded modules: sascfg_personal
Using SAS Config named: winlocal
Java Error:
log4j:WARN No appenders could be found for logger (com.sas.services.connection).
log4j:WARN Please initialize the log4j system properly.
com.sas.services.connection.FatalConnectionFactoryException: The application could not log on to the server. The server process did not start.
at com.sas.services.connection.ClusterEnvelope.getConnection(ClusterEnvelope.java:240)
at com.sas.services.connection.AggregationKernel.doGetConnection(AggregationKernel.java:242)
at com.sas.services.connection.ConnectionFactoryKernel.getConnection(ConnectionFactoryKernel.java:325)
at com.sas.services.connection.ConnectionFactoryShell.getConnection(ConnectionFactoryShell.java:69)
at com.sas.services.connection.ConnectionFactoryShell.getConnection(ConnectionFactoryShell.java:51)
at pyiom.saspy2j.main(saspy2j.java:193)
Caused by: org.omg.CORBA.COMM_FAILURE: The application could not log on to the server. The server process did not start. vmcid: 0x0 minor code: 0 completed: No
at com.sas.iom.orb.brg.Engine.flowLaunchServer(Engine.java:3052)
at com.sas.iom.orb.brg.Engine.flow(Engine.java:709)
at com.sas.iom.orb.brg.Engine.initClient(Engine.java:674)
at com.sas.iom.orb.brg.ORBImpl.uri_to_object(ORBImpl.java:114)
at com.sas.services.connection.ClusterEnvelope.createObject(ClusterEnvelope.java:293)
at com.sas.services.connection.ClusterEnvelope.getConnection(ClusterEnvelope.java:78)
5 more
Caused by: java.io.IOException: Cannot run program "C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at java.lang.Runtime.exec(Runtime.java:485)
at com.sas.iom.orb.brg.Engine.flowLaunchServer(Engine.java:3030)
10 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.
We failed in getConnection The application could not log on to the server. The server process did not start. Subprocess failed to start. Double check your settings in sascfg_personal.py file.
Attempted to run program C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java with the following parameters:['C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', '-Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE"', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.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;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904400.1.0.20160824190000_v940m4\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904400.0.0.20160427190000_v940m4\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\sastpj.rutil.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '55109', '-stdoutport', '55110', '-stderrport', '55111', '-zero', '-lrecl', '1048576', '']
If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java: C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java -Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE" "-classpath" C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.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;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904400.1.0.20160824190000_v940m4\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904400.0.0.20160427190000_v940m4\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\sastpj.rutil.jar pyiom.saspy2j -host localhost -stdinport 55109 -stdoutport 55110 -stderrport 55111 -zero -lrecl 1048576
well that is now number 5. Can you try the full real path to your sas.exe instead, just to see.
You do have SAS installed on your machine, right? Not just EG?
found the SAS.exe file
but still provided with this error
Using SAS Config named: winlocal
Java Error:
log4j:WARN No appenders could be found for logger (com.sas.services.connection).
log4j:WARN Please initialize the log4j system properly.
com.sas.services.connection.FatalConnectionFactoryException: The application could not log on to the server. The server process did not start.
at com.sas.services.connection.ClusterEnvelope.getConnection(ClusterEnvelope.java:240)
at com.sas.services.connection.AggregationKernel.doGetConnection(AggregationKernel.java:242)
at com.sas.services.connection.ConnectionFactoryKernel.getConnection(ConnectionFactoryKernel.java:325)
at com.sas.services.connection.ConnectionFactoryShell.getConnection(ConnectionFactoryShell.java:69)
at com.sas.services.connection.ConnectionFactoryShell.getConnection(ConnectionFactoryShell.java:51)
at pyiom.saspy2j.main(saspy2j.java:193)
Caused by: org.omg.CORBA.COMM_FAILURE: The application could not log on to the server. The server process did not start. vmcid: 0x0 minor code: 0 completed: No
at com.sas.iom.orb.brg.Engine.flowLaunchServer(Engine.java:3052)
at com.sas.iom.orb.brg.Engine.flow(Engine.java:709)
at com.sas.iom.orb.brg.Engine.initClient(Engine.java:674)
at com.sas.iom.orb.brg.ORBImpl.uri_to_object(ORBImpl.java:114)
at com.sas.services.connection.ClusterEnvelope.createObject(ClusterEnvelope.java:293)
at com.sas.services.connection.ClusterEnvelope.getConnection(ClusterEnvelope.java:78)
5 more
Caused by: java.io.IOException: Cannot run program "C:\sas94\SASHome\SASFoundation\9.4\sas.exe": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at java.lang.Runtime.exec(Runtime.java:485)
at com.sas.iom.orb.brg.Engine.flowLaunchServer(Engine.java:3030)
10 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.
We failed in getConnection The application could not log on to the server. The server process did not start. Subprocess failed to start. Double check your settings in sascfg_personal.py file.
Attempted to run program C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java with the following parameters:['C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', '-Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:\sas94\SASHome\SASFoundation\9.4\sas.exe"', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.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;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904400.1.0.20160824190000_v940m4\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904400.0.0.20160427190000_v940m4\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\sastpj.rutil.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '55254', '-stdoutport', '55255', '-stderrport', '55256', '-zero', '-lrecl', '1048576', '']
If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java: C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java -Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:\sas94\SASHome\SASFoundation\9.4\sas.exe" "-classpath" C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.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;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904400.1.0.20160824190000_v940m4\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904400.0.0.20160427190000_v940m4\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\sastpj.rutil.jar pyiom.saspy2j -host localhost -stdinport 55254 -stdoutport 55255 -stderrport 55256 -zero -lrecl 1048576
Hmm, the jars you're pointing to are in this dir: C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp0__1\deploywiz\sas*.jar
But you're running SAS from C:\sas94\SASHome\SASFoundation\9.4\sas.exe
Is there a sas.exe in C:\Program Files\SASHome\SASfoundation\9.4\ Or is that an EG only install? Do you have SAS in 2 places? Does the place you are now trying to run SAS from also have the jars in that install location?
This may be an EG only install. I'm on a company machine, and I'm not sure if we are storing SAS.exe somewhere else. I do have SAS 9.4 installed on my local machine though, and it is not on one of our remote drives.
Are the following true?
1) C:\Program Files\SASHome... is a EG install and sas.exe isn't in there anywhere 2) C:\sas94\SASHome.. . is a SAS install, but that's a remote directory?
if not, can you give me a little more details?
first one is correct. as for the second one, I went into EG to find the sas root hoping to find the executable file
I'm not sure I understood the second part.
Does this exist on your machine? C:\sas94\SASHome\SASFoundation\9.4\sas.exe Is this a SAS install?
yes, that isn't a SAS install, no SASFoundation/...
No that directory does not exist on my machine
If you use EG, are you really wanting to connect saspy to the same workspace servers you access with EG? You can do that. You can also connect to a local SAS install, when you have a local SAS install :) If you want to get at the workspace servers you get at with EG, we need to change your configuration, See Remote in this section: https://sassoftware.github.io/saspy/install.html#iom-using-java
I can help you through it
ok, so you don't have a local SAS to connect to. Do you want to connect remotely to the EG workspace servers?
yes I believe I would like the same workspace servers i get on EG most of our files programs in SAS are located on the remote
Can you connect to a web-ex if I send you the link? Would be quick and easier , but we can do it through here if not.
Yes Tom, I believe I can connect, unfortunately, I have a meeting I must attend. May I contact you on here afterwards?
yes, no trouble
actually, send me an email, then I can email you back the link to join. easier. tom.weber@sas.com
Thank you.
Problem has been resolved. Thank you Tom.
Hello! I think I am having the same problem but with base SAS. What was the solution?
Hey @jingmeb Can you post what you are submitting and the output it produces? And maybe tell me what you are trying to do; where's your client, where does the SAS you're trying to connect to live, ...?
Actually, creating a new issue for your problem and posting your information there would be best actually.
This was a problem with trying to have saspy use a local version of SAS that didn't exist. So it needed to be configured to get to a remote SAS server that does exit. Nothing special other than configuring saspy per the instructions for the situation.
Thanks, Tom
Hey, there!
I am having the very same problem over here. I also can not find the SASFoundation file on my local windows notebook.
What should I do on this case?
My cfg_pesonal.py file looks like this:
SAS_config_names=['SASApp']
SAS_config_options = {'lock_down': False,
'verbose' : True,
'prompt' : True
}
SAS_output_options = {'output' : 'html5'}
SASApp = {'java' : 'java',
'iomhost' : "myhost",
'iomport' : 8591,
'encoding' : 'latin1',
'omruser' :'myuser',
'omrpw':mypw,
'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c',
'provider': 'sas.iomprovider',
}
iomlinux = {'java' : '/usr/bin/java',
'iomhost' : 'linux.iom.host',
'iomport' : 8591,
}
iomwin = {'java' : '/usr/bin/java',
'iomhost' : 'windows.iom.host',
'iomport' : 8591,
}
winlocal = {'java' : 'java',
'encoding' : 'windows-1252',
}
winiomlinux = {'java' : 'java',
'iomhost' : 'linux.iom.host',
'iomport' : 8591,
}
winiomwin = {'java' : 'java',
'iomhost' : 'windows.iom.host',
'iomport' : 8591,
}
winiomIWA = {'java' : 'java',
'iomhost' : 'windows.iom.host',
'iomport' : 8591,
'sspi' : True
}
iomcom = {
'iomhost' : 'mynode.mycompany.org',
'iomport' : 8591,
'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c',
'provider': 'sas.iomprovider',
'encoding': 'windows-1252'}
httpsviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com',
'context' : 'Data Mining compute context',
'authkey' : 'viya_user-pw',
'options' : ["fullstimer", "memsize=1G"]
}
httpviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com',
'ssl' : False, # this will use port 80
'context' : 'Data Mining compute context',
'authkey' : 'viya_user-pw',
'options' : ["fullstimer", "memsize=1G"]
}
I call de sas session like this:
def config_saspy():
import os
pwd = os.getcwd()
env_path = pwd[:-3] + 'env\\'
print(env_path)
cfg_file = env_path + "/Lib/site-packages/saspy/sascfg_personal.py"
kwargs_sas = {"cfgfile":cfg_file}
return kwargs_sas
def main():
import os
import saspy
kwargs_sas = config_saspy()
sas = saspy.SASsession(cfgname='SASApp',**kwargs_sas)
print("Be happy with my queries yeyey ...")
if __name__ == '__main__':
main()
I have this code working on one machine with:
java -version
openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode)
python --version
Python 3.7.1
saspy.__version__
3.7.2
And I am trying it on another windows machine with the same python and saspy version but with:
java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java Hotspot(TM) 64-Bit Server VM 18.9 (build 25.181-b13, mixed mode)
On the first machine everything works just fine, in this last one I keep ending on a error like:
Java Error:
java.lang.UnsupportedClassVersionError: pyiom/saspy2j : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: pyiom.saspy2j. Program will exit.
Exception in thread "main"
Subprocess failed to start. Double check your settings in sascfg_personal.py file
Attempted to run program java with the following parameters:['java', '-classpath', 'D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\saspyiom.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\iomclient\\log4j.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\iomclient\\sas.security.sspi.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\iomclient\\sas.core.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\iomclient\\sas.svc.connection.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\iomclient\\sas.rutil.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\iomclient\\sas.rutil.nls.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\iomclient\\sastpj.rutil.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\thirdparty\\glassfish-corba-internal-api.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\thirdparty\\glassfish-corba-omgapi.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\thirdparty\\glassfish-corba-orb.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\thirdparty\\pfl-basic.jar;D:\\Users\\myuser\\Documents\\Repositorios\\myrepo\\env\\lib\\site-packages\\saspy\\java\\thirdparty\\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '52620', '-stdoutport', '52621', '-stderrport', '52622', '-iomhost', '10.59.129.93', '-iomport', '8591', '-user', 'cr318741', '-lrecl', '1048576', '']
If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java:
java -classpath "D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\saspyiom.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\iomclient\log4j.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\iomclient\sas.core.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar" pyiom.saspy2j -host localhost -stdinport 52620 -stdoutport 52621 -stderrport 52622 -iomhost 10.59.129.93 -iomport 8591 -user cr318741 -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 "conexao_saspy.py", line 89, in <module>
main()
File "conexao_saspy.py", line 47, in main
sas = saspy.SASsession(cfgname='SASApp',**kwargs_sas) #cfgname='winiomwin','SASApp'
File "D:\Users\myuser\Documents\Repositorios\myrepo\env\lib\site-packages\saspy\sasbase.py", line 567, in __init__
self.pyenc = sas_encoding_mapping[self.sascei]
KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'
I did the test of making the java command suggest by the error message and I got:
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at pyiom.saspy2j.main(saspy2j.java:175)
Exception in thread "main" java.lang.NullPointerException
at pyiom.saspy2j.main(saspy2j.java:184)
Which would be the case 4 on https://sassoftware.github.io/saspy/troubleshooting.html "Classpath Problems". However I do not see any of my cases on the next session of the page.
Thanks ahead for any help that you could give me :)
Hey @marianesalo I can help you figure this out. First, can you open a new issue for this? This 2 years old one isn't really the same. Opening a new issue for your problem is the best way to do this.
I'm going to need more information about this environment you're trying to run in for the case that doesn't work. I don't understand what the config_saspy() is for. If seems to assume the cwd has to be the directory above your environments in your python deployment, to then explicitly provide a path to the sascfg_personal.py that seems to be the default one it would already use. There's also a couple invalid keys in your config definition; neither class_id nor provider are valid in that, though they would happen to be ignored, so they aren't the cause of any problem in this case.
Since you're apparently using environments, the most likely cause of this has to do with them, but we need more information. The error you show is:
Could not find the main class: pyiom.saspy2j.
which implies that something about how you're running isn't what you think. Are you really in the environment you have saspy installed in? is 'java' really the one you think it is when you're running this? When you ran the command by itself, it found the pyiom.saspy2j class, so that sounds like you ran that command from a different environment than where java tried to run when you tried it with saspy. This is bound to be an issue with the environments within which you are trying to run.
Would a teams session (webex) work for you? I can try to provide you code to run to try to see what's going on, but a quick screen share call would probably sole this much quicker.
Thanks, Tom
Hello, @tomweber-sas !
Sure, I will open a new issue. Also, I would be glad to have a teams session. Should I e-mail you on the address stated on your github profile?
Thanks for the fast reply, Mariane Reis
Hello,
I've tried looking at other issue posts to solve this problem, but I can't seem to get SAS to connect even after updating the sascfg file.
I've attached the modified sascfg file below:
SAS_config_names=['winlocal']
SAS_config_options = {'lock_down': False, 'verbose' : True }
SAS_output_options = {'output' : 'html5'}
default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }
ssh = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en', 'ssh' : '/usr/bin/ssh', 'host' : 'remote.linux.host', 'encoding': 'latin1', 'options' : ["-fullstimer"] }
cpL = "/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/sas.svc.connection.jar" cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/log4j.jar" cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/sas.security.sspi.jar" cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz94485prtxxsp01/deploywiz/sas.core.jar" cpL += ":/opt/github/saspy/java/saspyiom.jar"
iomlinux = {'java' : '/usr/bin/java', 'iomhost' : 'linux.iom.host', 'iomport' : 8591, 'encoding' : 'latin1', 'classpath' : cpL }
iomwin = {'java' : '/usr/bin/java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252', 'classpath' : cpL }
cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar"
cpW += ";C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar" cpW += ";C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar" cpW += ";C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\sastpj.rutil.jar"
cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\pfl-basic.jar" cpW += ";C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\thirdparty\pfl-tf.jar"
winlocal = {'java' : 'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', 'encoding' : 'windows-1252', 'classpath' : cpW }
winiomlinux = {'java' : 'java', 'iomhost' : 'linux.iom.host', 'iomport' : 8591, 'encoding' : 'latin1', 'classpath' : cpW }
winiomwin = {'java' : 'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252', 'classpath' : cpW }
winiomIWA = {'java' : 'java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252', 'classpath' : cpW, 'sspi' : True }
iomcom = { 'iomhost': 'mynode.mycompany.org', 'iomport': 8591, 'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c', 'provider': 'sas.iomprovider', 'encoding': 'windows-1252'}
httpsviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com', 'context' : 'Data Mining compute context', 'authkey' : 'viya_user-pw', 'options' : ["fullstimer", "memsize=1G"] }
httpviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com', 'ssl' : False, # this will use port 80 'context' : 'Data Mining compute context', 'authkey' : 'viya_user-pw', 'options' : ["fullstimer", "memsize=1G"] }
This is the error message I keep recieving:
Reloaded modules: sascfg_personal Using SAS Config named: winlocal The OS Error was: The system cannot find the file specified
SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.
Attempted to run program C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java with the following parameters:['C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\x08in\java', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\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', '53908', '-stdoutport', '53909', '-stderrport', '53910', '-zero', '-lrecl', '1048576', '']
If no OS Error above, try running the following command (where saspy is running) manually to see what is wrong: C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94485prtxxsp01\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904300.0.0.20150204190000_v940m3\sas.rutil.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904300.0.0.20150204190000_v940m3\sas.rutil.nls.jar;C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.rutil_6.1.0.0_SAS_20121211183517\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 53908 -stdoutport 53909 -stderrport 53910 -zero -lrecl 1048576
No SAS process attached. SAS process has terminated unexpectedly. [autoreload of sascfg_personal failed: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\extensions\autoreload.py", line 245, in check superreload(m, reload, self.old_objects) File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\extensions\autoreload.py", line 434, in superreload module = reload(module) File "C:\ProgramData\Anaconda3\lib\imp.py", line 314, in reload return importlib.reload(module) File "C:\ProgramData\Anaconda3\lib\importlib__init__.py", line 168, in reload raise ModuleNotFoundError(f"spec not found for the module {name!r}", name=name) ModuleNotFoundError: spec not found for the module 'sascfg_personal' ] Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/sulnm019/.spyder-py3/temp.py', wdir='C:/Users/sulnm019/.spyder-py3')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/sulnm019/.spyder-py3/temp.py", line 16, in
sas = saspy.SASsession()
File "C:\ProgramData\Anaconda3\lib\site-packages\saspy\sasbase.py", line 460, in init pyenc = sas_encoding_mapping[self.sascei]
KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'