Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running saspy with SAS Enterprise Guide #163

Closed
peter-hamilton-MOH opened this issue Aug 23, 2018 · 17 comments
Closed

Running saspy with SAS Enterprise Guide #163

peter-hamilton-MOH opened this issue Aug 23, 2018 · 17 comments

Comments

@peter-hamilton-MOH
Copy link

Hi there, I'm trying to get saspy up and running using SAS EG and have run into a roadblock.

I've set the config file to winlocal and was able to find all of the .jar files on my machine, and tested the
"java -classpath ..." command. Where I got stuck I was able to locate in the trouble shooting guide:

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:162)
Exception in thread "main" java.lang.NullPointerException
        at pyiom.saspy2j.main(saspy2j.java:171)

Fixes listed as:


1. for Windows Local connection, you don’t have the path to the sspiauth.dll in yout System Path variable.
2. for Windows Local connection, the registry doesn’t have the right path to the SAS start up command.
3. for Windows Local connection, the start up command in the registry isn’t formated just right. Blanks

, quotes, ...

I don't have the SAS Workspace Server (eg. sas.exe) application on my computer - is it still possible to use saspy? Can I get this application somehow? Also, is it even possible to use saspy with SAS Enterprise Guide?

Thanks for your help,

Peter

@tomweber-sas
Copy link
Contributor

@peter-hamilton-MOH No, I'm afraid that EG isn't what saspy can use. It needs to be SAS (sas.exe) or a remote workspace serer. When you use EG outright, is it not connecting to a workspace server somewhere?
If so, saspy can connect to that same server. That's the Remote version.
https://sassoftware.github.io/saspy/install.html#remote

Basically, you need the ip (hostname) of the object spawner that starts up that workspace server, and the workspace server port. You need OMR credentials too, which should be the same as you need with EG.

Can you connect to the workspace server instead of trying a local connection (that you don't have SAS to make)?

Tom

@peter-hamilton-MOH
Copy link
Author

Hey Tom,

Thanks for the quick reply. So would that be the 'winiomwin' option? I believe our server is running windows.

I set that in the configuration with what I believe is the hostname & port (which I took from SAS EG's settings) and got back the following error (some credentials redacted - note that my host name isn't an IP but just a long alpha string):

Java Error:

The OS Error was:
Permission denied

SAS Connection failed. No connection established. Double check you settings in sascfg.py file.

Attempted to run program java with the following parameters:['java', '-classpath', '"C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94478__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94478__prt__xx__sp0__1\\deploywiz\\log4j.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94478__prt__xx__sp0__1\\deploywiz\\sas.security.sspi.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94478__prt__xx__sp0__1\\deploywiz\\sas.core.jar;C:\\cygwin64\\lib\\python3.6\\site-packages\\saspy\\java\\saspyiom.jar"', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '63822', '-stdoutport', '63823', '-stderrport', '63824', '-iomhost', 'XXXXXXXXXXXXXXX', '-iomport', '8561', '-user', 'XXXXXX', '-lrecl', '1048576', '']

If no OS Error above, try running the following command (where saspy is running) manually to see what is wrong:
java -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\sas.core.jar;C:\cygwin64\lib\python3.6\site-packages\saspy\java\saspyiom.jar" pyiom.saspy2j -host localhost -stdinport 63822 -stdoutport 63823 -stderrport 63824 -iomhost XXXXXXXXXXX -iomport 8561 -user XXXXX -lrecl 1048576


SAS Connection failed. No connection established. Staus=(58988, 64000)  Double check you settings in sascfg.py file.

@tomweber-sas
Copy link
Contributor

Yes, that winiomwin template shows what you need for this case. You are getting a permission error running the java command. Can you run that whole java command from a cmd prompt and see if it displays any more of an error?

java -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94478__prt__xx__sp0__1\deploywiz\sas.core.jar;C:\cygwin64\lib\python3.6\site-packages\saspy\java\saspyiom.jar" pyiom.saspy2j -host localhost -stdinport 63822 -stdoutport 63823 -stderrport 63824 -iomhost XXXXXXXXXXX -iomport 8561 -user XXXXX -lrecl 1048576

Also, depending upon how java was installed, just saying 'java' may work fine, but sometimes you have to specify the full path to java.exe.

Try running the command interactively and lets see if there more error messages to point us in the right direction.

Tom

@peter-hamilton-MOH
Copy link
Author

Here's what running in a DOS prompt yielded:

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:162)
Exception in thread "main" java.lang.NullPointerException
        at pyiom.saspy2j.main(saspy2j.java:171)

@tomweber-sas
Copy link
Contributor

Well, that looks like it 'worked'. You didn't get a permission error. Java ran, found saspyiom.jar and ran it. The socket error would be expected in this case, and it's trying to connect back to pyhon, which isn't running in this case.
How are you running saspy? Is it under a different id then what you have when you ran the command? Were you in a different directory or something that could cause a permission error trying to run it from python?

@peter-hamilton-MOH
Copy link
Author

I realized afterwards I was running saspy via python3 through a cygwin (shell emulation) terminal instead of a DOS prompt! I re-ran using python3 through a DOS prompt and got a slightly different error:

Java Error:

The OS Error was:
No such file or directory

Running the java command via DOS prompt returns the same java.net.ConnectException: Connection refused: connect error however

@tomweber-sas
Copy link
Contributor

Try specifying the full path including \java.exe for the 'java' keyword in your winiomwin cofig definition. I think it can't find 'java' in your path how you're running.

@peter-hamilton-MOH
Copy link
Author

Thanks I think it's working now!! It's asking for my password - I need to contact my SAS admin for this, so I can't confirm what happens after I enter it.

Thanks for all your help!

@tomweber-sas
Copy link
Contributor

Great!, btw, you can put your user/pw in an _authinfo file in your home directory (secured so you're the only one w/ read access), and you won;t have to enter credentials any more. Check it out in the install/config guide.
Let me know if you have any other questions!
Tom

@peter-hamilton-MOH
Copy link
Author

Thanks again! Waiting to hear about credentials - in the meantime I've realized after looking through the SAS EG settings that I'm configured to use IWA for authentication. I have enabled the flag and gotten the error:

We failed in getConnection
The native implementation module for the security package could not be found in the path.

According to the trouble shooting guide I need to add the path to the sspiauth.dll in my System Path variable. Not sure what this means? Some Googling suggests adding to the Windows registry, but I'm unsure where and what to add exactly?

@tomweber-sas
Copy link
Contributor

Very good. Yes, for IWA, you don't need the _authinfo nor to specify user or pw.
Yes, you now need the path to that .dll in your sysen PATH environment variable. That's easy. Just find that file on your system. The doc showed a likely place, but that's for a real SAS install, so w/ EG it may be somewhere else. Just add the to PATH. If you are in a cmd prompt, type

set

and you'll see the environment variables, including Path. You can add the directory to it via the UI:

image

image

@peter-hamilton-MOH
Copy link
Author

Hmm did a system wide search for the sspiauth.dll and can't find it anywhere - perhaps it's not included in SAS EG?

@tomweber-sas
Copy link
Contributor

That seems odd (though I don't know for sure about an EG only install). If EG is connecting to the server with IWA, I would think it would have to use this dll. But, I'm not positive. EG may use the .net IOM client instead of java (again, I'm not sure), but if so, I guess that could do something different that doesn't use that dll. Or, are you sure you're EG is using IWA and not just passing user/pw?

Can you get that file off the machine where you're workspace server is running? It should be there, as that's a real SAS install. Just copy it to your machine somewhere and put that directory in the PATH env var and see if you can connect.

@peter-hamilton-MOH
Copy link
Author

I was able to find the file - but unfortunately not download it in a reliable way - I couldn't actually see the server I needed in the explorer view, so I had to manually search for and find it using the SAS filename pipe "dir ..." etc. command. I eventually located the DLL and logged it out to the console manually using DOS's type command - I then copied it and pasted into a empty .dll on my local machine LOL silly i know. I couldn't get the bite sizes to match up, when i re-ran anyways (after adding to the system path) I got the same error as before.

@peter-hamilton-MOH
Copy link
Author

Someone's working on finding me some valid credentials as well, so maybe that'll work instead?

@peter-hamilton-MOH
Copy link
Author

Hey Tom! Finally logged in yay! Thanks for all the help, I really appreciate it 💯 🥇 This will hopefully help a bunch of people at my organization who use SAS.

-Peter

@tomweber-sas
Copy link
Contributor

That's great! Glad to hear it. I'm all about helping you guys (our customers)! :)
Let me know if there's anything else!
Thanks,
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants