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
375 stars 149 forks source link

How to config saspy on windows server 2019? #248

Closed junwansas closed 5 years ago

junwansas commented 5 years ago

Hi,

I try to user SASpy on a windows server to connect to a remote SAS grid using iomcom. I'd like to have some help on the config file.

The iomhost should be the metadata server or work nodes which the sas session will run? Where should I put the credential? We use ldap on the server to authenticate users. each user has a metadata profile too.

This is what the sascfg.py looks like after installation. I'd like to know how do I change this config file and do I need a config file for each users? or can I let config file using signal signon? iomcom = { 'iomhost': 'mynode.mycompany.org', 'iomport': 8591, 'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c', 'provider': 'sas.iomprovider', 'encoding': 'windows-1252'}

Thank you!

Jun

tomweber-sas commented 5 years ago

Hey, yes can help you with this. First, so we're clear on terminology let me identify a couple things. Ill use IOM access method to refer to the original access method in saspy that uses the IOM-Java client. I'll use COM access method to refer to the new access method that @hhubbell contributed that uses the Windows com IOM client. IOM itself refers to the interface that both these access methods use to interact with a workspace server.

You're looking at COM access method. In both cases, the host and port are the hostname (ip) of the Object Spawner, not the metadata server, and the port is the port number that object spawner is listening on for Workspace server requests - again, not the metataserver port.

FYI, this is documented in the configuration guide: https://sassoftware.github.io/saspy/install.html#configuration

Next, you're asking about credentials. This is where things vary. So, in the usual case, authenticating via IOM, uses userid/password. For both IOM and COM access methods, you can store these in an _authinfo file (in the above mentioned doc). The COM access method didn't support this in it's first incarnation. The support for the authinfo file is at master right now, Next time I build a new release it will be in that release. But you can pull master to get that now,

However, you mention ldap to authenticate users. I think this correlates to having your authentication mechanism use IWA (Integrated Windows Authentication) instead of user/pw? If that is what you mean, then you wouldn't use the authinfo file, as it's not using user/pw to authenticate. If IWA is what it's configured to use, then the IOM access method supports this by use of the sspi key in your configuration definition:

From the IOM Config doc: sspi - New in 2.17, there is support for IWA (Integrated Windows Authentication) from a Windows client to remote IOM server. This is only for when your Workspace server is configured to use IWA as the authentication method, which is not the default. This is simply a boolean, so to use it you specify ‘sspi’ : True. Also, to use this, you must have the path to the spiauth.dll file in your System Path variable, just like is required for Local IOM connections. See the second paragraph under Local IOM for more on the spiauth.dll file.

However, at this time, I don't believe the COM access method has support for IWA, though I imagine it could, as IWA support is implemented via the IOM client, so I suspect the COM version can do this, since the Java version does. Harry, do you think you could investigate this?

I'm not 100% sure that if your server is configured to use IWA that you cannot use a user/pw, but I suspect that's the case. Certainly you could try it and see. If not, then we could get you up and running with the IOM access method for now, and try out the COM one if IWA support is added.

Thanks! Tom

hhubbell commented 5 years ago

Hi Tom,

I will take a look. I'm out of town next week so it might be little while, however.

tomweber-sas commented 5 years ago

Thanks Harry, no problem. We can figure out if IWA is what we need here or not, and use IOM if so for now.

Thanks!

junwansas commented 5 years ago

I have SAS enterprise Guide installed on this server. So I plan to using the com way. The ldap is sync to AD on Linux but you will still need user name and password. The IWA is not implement currently and may implement in the future. The grid I try to connect to has 5 compute nodes. Is that possible I connect to LSF so that I can use it to distribute the work load or I have to connect to one of the working nodes?

Thank you!

Jun

From: Tom Weber notifications@github.com Sent: Thursday, July 25, 2019 12:05 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Hey, yes can help you with this. First, so we're clear on terminology let me identify a couple things. Ill use IOM access method to refer to the original access method in saspy that uses the IOM-Java client. I'll use COM access method to refer to the new access method that @hhubbellhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_hhubbell&d=DwMFaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=BDO3zTodQqnUR5u1GXP35bpKYF2k-XUjDeqWq_09m9M&s=3qlivEKY3YUGjAqE2Uu0qyAzoU4IyCELCoisENR1kVQ&e= contributed that uses the Windows com IOM client. IOM itself refers to the interface that both these access methods use to interact with a workspace server.

You're looking at COM access method. In both cases, the host and port are the hostname (ip) of the Object Spawner, not the metadata server, and the port is the port number that object spawner is listening on for Workspace server requests - again, not the metataserver port.

FYI, this is documented in the configuration guide: https://sassoftware.github.io/saspy/install.html#configurationhttps://urldefense.proofpoint.com/v2/url?u=https-3A__sassoftware.github.io_saspy_install.html-23configuration&d=DwMFaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=BDO3zTodQqnUR5u1GXP35bpKYF2k-XUjDeqWq_09m9M&s=Tb9olCNHuUS9OxoyvRGfHm4xjB9VFAB2bhXIP1n_4f8&e=

Next, you're asking about credentials. This is where things vary. So, in the usual case, authenticating via IOM, uses userid/password. For both IOM and COM access methods, you can store these in an _authinfo file (in the above mentioned doc). The COM access method didn't support this in it's first incarnation. The support for the authinfo file is at master right now, Next time I build a new release it will be in that release. But you can pull master to get that now,

However, you mention ldap to authenticate users. I think this correlates to having your authentication mechanism use IWA (Integrated Windows Authentication) instead of user/pw? If that is what you mean, then you wouldn't use the authinfo file, as it's not using user/pw to authenticate. If IWA is what it's configured to use, then the IOM access method supports this by use of the sspi key in your configuration definition:

From the IOM Config doc: sspi - New in 2.17, there is support for IWA (Integrated Windows Authentication) from a Windows client to remote IOM server. This is only for when your Workspace server is configured to use IWA as the authentication method, which is not the default. This is simply a boolean, so to use it you specify ‘sspi’ : True. Also, to use this, you must have the path to the spiauth.dll file in your System Path variable, just like is required for Local IOM connections. See the second paragraph under Local IOM for more on the spiauth.dll file.

However, at this time, I don't believe the COM access method has support for IWA, though I imagine it could, as IWA support is implemented via the IOM client, so I suspect the COM version can do this, since the Java version does. Harry, do you think you could investigate this?

I'm not 100% sure that if your server is configured to use IWA that you cannot use a user/pw, but I suspect that's the case. Certainly you could try it and see. If not, then we could get you up and running with the IOM access method for now, and try out the COM one if IWA support is added.

Thanks! Tom

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVOZH4IYUMJCMIWBQYDQBHFLFA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2Z6AWI-23issuecomment-2D515104857&d=DwMFaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=BDO3zTodQqnUR5u1GXP35bpKYF2k-XUjDeqWq_09m9M&s=OCYR39jjJS5QqssQqbdn_xXu6cK1BFV1vD_uREDhl8U&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVL5X7XY6VGKZOYJUGTQBHFLFANCNFSM4IG3XVLA&d=DwMFaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=BDO3zTodQqnUR5u1GXP35bpKYF2k-XUjDeqWq_09m9M&s=1hDMNoNVtYUbfXbu7ByOs88qEnszoNcj-E497XX6Oh8&e=.

tomweber-sas commented 5 years ago

Ah, yes as it's Linux (SAS servers), then it can't be IWA, as that's not supported that way. So, ok, you can use authinfo to store your credentials.

The IOM access method supports SAS/Grid and LSF queues via Grid Option Sets. See: https://sassoftware.github.io/saspy/advanced-topics.html#configuring-grid-option-sets-to-have-saspy-run-on-a-specific-queue

However, again, I'm not sure the support for that has been added to the COM access method yet either. In the IOM access method, I set the appname so that you can set up the grid option set, by that name, to route work to specific queues or whatever you want to do with LSF for the saspy work:

server.setOption(SASURI.applicationNameKey, "SASPy");

Harry, that's one more thing, and also this next one too.

If you have more than AppServer defined, which the object spawner you're connecting to can spawn, then you need to specify the 'appserver' key in your configuration definition so you connect to the correct one (again see the Configuration doc for this). COM doesn't have that key implemented yet either. If there's only one appserver, then that's not needed and you're set.

Tom

junwansas commented 5 years ago

Tom,

I can not get saspy on windows to work.

This is the error.

sas=saspy.SASsession(cfgfile='C:\Program Files\Python37\Lib\site-packages\saspy\sascfg_personal.py') Using SAS Config named: winiomlinux Traceback (most recent call last): File "<pyshell#2>", line 1, in sas=saspy.SASsession(cfgfile='C:\Program Files\Python37\Lib\site-packages\saspy\sascfg_personal.py') File "C:\Program Files\Python37\lib\site-packages\saspy\sasbase.py", line 312, in init self.sascfg = SASconfig(**kwargs) File "C:\Program Files\Python37\lib\site-packages\saspy\sasbase.py", line 162, in init cfg = getattr(SAScfg, cfgname) AttributeError: module 'sascfgfile' has no attribute 'winiomlinux'

This is the sascfg_personal.py

SAS_config_names=['winiomlinux'] iomcom = { 'iomhost': 'dukesapc12', 'iomport': 8591, 'class_id': '0e3b1810-6646-11d5-8863-00c04f48bc53', 'provider': 'sas.iomprovider', 'encoding': 'Latin1'}

This is the output of proc iomoperate

SAS Object Spawner Short type name : ObjectSpawner Class identifier : 0e3b1810-6646-11d5-8863-00c04f48bc53

Foundation repository (A0000001.A5DVU6OC)

Object Spawner - dukesapc12 (A5DVU6OC.AY000003)
    Server class : IOM Spawner
    Spawnable server component : Operating System Services - dukesapc12
    Spawnable server component : SASApp - Stored Process Server
    Spawnable server component : SASApp - Workspace Server
    Operator port : 8581
    PortBank port : 8801
    PortBank port : 8811
    PortBank port : 8821
    Machine name : dukesapc12.corp.cox.com
    Machine name : dukesapc13.corp.cox.com
    Machine name : dukesapc14.corp.cox.com
    Machine name : dukesapc15.corp.cox.com
   Machine name : dukesapc16.corp.cox.com

NOTE: The LIST DEFINED SERVERS command completed.

Am I missing something?

This is my python version.

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32

Thank you!

Jun

From: Tom Weber notifications@github.com Sent: Thursday, July 25, 2019 1:32 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Ah, yes as it's Linux (SAS servers), then it can't be IWA, as that's not supported that way. So, ok, you can use authinfo to store your credentials.

The IOM access method supports SAS/Grid and LSF queues via Grid Option Sets. See: https://sassoftware.github.io/saspy/advanced-topics.html#configuring-grid-option-sets-to-have-saspy-run-on-a-specific-queuehttps://urldefense.proofpoint.com/v2/url?u=https-3A__sassoftware.github.io_saspy_advanced-2Dtopics.html-23configuring-2Dgrid-2Doption-2Dsets-2Dto-2Dhave-2Dsaspy-2Drun-2Don-2Da-2Dspecific-2Dqueue&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=mCQkdetd2U2KdfvvDu7TXc-w820TiKThsoOWUwlh7bc&s=O2ER6uDZjHrlZ0ESMBoHXtVrzRh0JQLs3mytxiNpgUc&e=

However, again, I'm not sure the support for that has been added to the COM access method yet either. In the IOM access method, I set the appname so that you can set up the grid option set, by that name, to route work to specific queues or whatever you want to do with LSF for the saspy work:

server.setOption(SASURI.applicationNameKey, "SASPy");

Harry, that's one more thing, and also this next one too.

If you have more than AppServer defined, which the object spawner you're connecting to can spawn, then you need to specify the 'appserver' key in your configuration definition so you connect to the correct one (again see the Configuration doc for this). COM doesn't have that key implemented yet either. If there's only one appserver, then that's not needed and you're set.

Tom

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVOY2AOSBNP2U7IJOUTQBHPQXA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD22GE5I-23issuecomment-2D515138165&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=mCQkdetd2U2KdfvvDu7TXc-w820TiKThsoOWUwlh7bc&s=N2nSaNWKFXIWUlBmJuG5Xz3ahYmQ9lsWwH5GOJE9-DA&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVPD6XVPBN23E6SSGC3QBHPQXANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=mCQkdetd2U2KdfvvDu7TXc-w820TiKThsoOWUwlh7bc&s=XJLtS2rpC3Mi7iYRwRwbkbAs1gWLQvbmCPpyjDvwdrE&e=.

tomweber-sas commented 5 years ago

Hey, well, I think this is a minor problem with the name of your configuration definition, that's all. The config file info you showed:

SAS_config_names=['winiomlinux']
iomcom = {
    'iomhost': 'dukesapc12',
    'iomport': 8591,
    'class_id': '0e3b1810-6646-11d5-8863-00c04f48bc53',
    'provider': 'sas.iomprovider',
    'encoding': 'Latin1'}

says that there only one definition, named winiomlinux, but the actual definition is named iomcom. So, to solve this error, just make both of those names be the same. Then you will see if the connection actually gets established.

Hey, BTW, yesterday I built a new release, 3.1.2, and that has the fixes for COM to use the authinfo file, and to prompt for is/pw if needed. So, you can easily get that new version without having to pull from master, as it's out on pypi already. Either way, lets see if you can connect :)

Thanks, Tom

junwansas commented 5 years ago

I do not understand.

sas=saspy.SASsession(cfgfile='C:\Program Files\Python37\Lib\site-packages\saspy\sascfg_personal.py') SyntaxError: unexpected indent

I just copied everything from the sascfg.py

SAS_config_names=['iomcom'] iomcom = { 'iomhost': 'dukesapc12', 'iomport': 8591, 'class_id': '0e3b1810-6646-11d5-8863-00c04f48bc53', 'provider': 'sas.iomprovider', 'encoding': 'Latin1'}

Jun

From: Tom Weber notifications@github.com Sent: Tuesday, July 30, 2019 12:56 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Hey, well, I think this is a minor problem with the name of your configuration definition, that's all. The config file info you showed:

SAS_config_names=['winiomlinux']

iomcom = {

'iomhost': 'dukesapc12',

'iomport': 8591,

'class_id': '0e3b1810-6646-11d5-8863-00c04f48bc53',

'provider': 'sas.iomprovider',

'encoding': 'Latin1'}

says that there only one definition, named winiomlinux, but the actual definition is named iomcom. So, to solve this error, just make both of those names be the same. Then you will see if the connection actually gets established.

Hey, BTW, yesterday I built a new release, 3.1.2, and that has the fixes for COM to use the authinfo file, and to prompt for is/pw if needed. So, you can easily get that new version without having to pull from master, as it's out on pypi already. Either way, lets see if you can connect :)

Thanks, Tom

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVP2JC2YAZAKD7EYCCLQCBXBNA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3ETVII-23issuecomment-2D516504225&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=KR_WYxMQpeCLczmqkzteUPgficKXAu3s0tjleWZ7uK8&s=cG-0n8ylD4Y1N4LtzsA51RQnWK129fbnPdrxw0fEeOk&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVIUW7SMLCDDGX3T72DQCBXBNANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=KR_WYxMQpeCLczmqkzteUPgficKXAu3s0tjleWZ7uK8&s=qNo5xzPPrhyIV2WtvdJgpSnGq6uAOXhYFzlVFFnZ6ys&e=.

tomweber-sas commented 5 years ago

Well, fixing the name got past that. Python has syntax rules about indentation. I can't tell, from what you've cut-n-pasted here, where there's some indentation that's off that python is complaining about. Did you edit that file with some windows editor? Sometimes those don't present the data byte for byte. If you have embedded Tabs, you may not see the true formatting (indentation ) of the text. Tabs, especially you should never use in python code, certainly not on windows where you don't always see the true formatting. Can you check to see if you have something like that going on? I can't tell from here, unfortunately.

junwansas commented 5 years ago

So your point is that the sascfg_personal has indentation issue. I will check the file on Linux editor and let you know. Do you have an working iom config file that I can borrow?

Thank you!

Jun

From: Tom Weber notifications@github.com Sent: Tuesday, July 30, 2019 1:25 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Well, fixing the name got past that. Python has syntax rules about indentation. I can't tell, from what you've cut-n-pasted here, where there's some indentation that's off that python is complaining about. Did you edit that file with some windows editor? Sometimes those don't present the data byte for byte. If you have embedded Tabs, you may not see the true formatting (indentation ) of the text. Tabs, especially you should never use in python code, certainly not on windows where you don't always see the true formatting. Can you check to see if you have something like that going on? I can't tell from here, unfortunately.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVNDJT34BXTK35QJPLDQCB2ONA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3EWF5Y-23issuecomment-2D516514551&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=4OjcBLFhNSOxbGZHOP8ZT-l4tRn2_OfbiwAmbKFtTxY&s=UZitQiKO3jrhdLUQVivNHoH8Cp06ZtTBiHknE_c_KKk&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVLOCL35OIZSAA4DNQLQCB2ONANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=4OjcBLFhNSOxbGZHOP8ZT-l4tRn2_OfbiwAmbKFtTxY&s=QIQMl1yfb8c6ru5cO3AX9zvX5zSJZuniNCQI3LQsebc&e=.

tomweber-sas commented 5 years ago

That's the guess, but i can't see what that error is referring to. if the sas=saspy... has one extra blank in front of it, it would get an error like this. I can't tell anything from what's pasted into this issue, because things get formatted. So I don't have the exact bytes that python is processing to see where the indentation is off. for instance:

>>>  sas=saspy.SASsession()
  File "<stdin>", line 1
    sas=saspy.SASsession()
    ^
IndentationError: unexpected indent
>>>

submitting the iomcom sample from the sascfg.py file in the repo doesn't cause any problems:

>>> iomcom = {
...     'iomhost': 'mynode.mycompany.org',
...     'iomport': 8591,
...     'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c',
...     'provider': 'sas.iomprovider',
...     'encoding': 'windows-1252'}
>>>
>>>
>>> iomcom
{'iomport': 8591, 'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c', 'encoding': 'windows-1252', 'iomhost': 'mynode.mycompany.org', 'provider': 'sas.iomprovider'}
>>>

So, I'm just guessing at likely possibilities for you to have some indentation error. Editing a file is the most likely guess. That's all. The error didn't identify where the indentation error was.

junwansas commented 5 years ago

It is the leading space! I have new error now.

import saspy sas=saspy.SASsession() Using SAS Config named: iomcom Param 'sascfgname' was ignored due to configuration restriction Traceback (most recent call last): File "<pyshell#1>", line 1, in sas=saspy.SASsession() File "C:\Program Files\Python37\lib\site-packages\saspy\sasbase.py", line 344, in init self._io = SASSessionCOM(sascfgname=self.sascfg.name, sb=self, **kwargs) File "C:\Program Files\Python37\lib\site-packages\saspy\sasiocom.py", line 155, in init self.pid = self._startsas() File "C:\Program Files\Python37\lib\site-packages\saspy\sasiocom.py", line 170, in _startsas factory = dynamic.Dispatch('SASObjectManager.ObjectFactoryMulti2') NameError: name 'dynamic' is not defined

It did not prompt me for user name and password.

Jun

From: Tom Weber notifications@github.com Sent: Tuesday, July 30, 2019 1:37 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

That's the guess, but i can't see what that error is referring to. if the sas=saspy... has one extra blank in front of it, it would get an error like this. I can't tell anything from what's pasted into this issue, because things get formatted. So I don't have the exact bytes that python is processing to see where the indentation is off. for instance:

sas=saspy.SASsession()

File "", line 1

sas=saspy.SASsession()

^

IndentationError: unexpected indent

submitting the iomcom sample from the sascfg.py file in the repo doesn't cause any problems:

iomcom = {

... 'iomhost': 'mynode.mycompany.org',

... 'iomport': 8591,

... 'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c',

... 'provider': 'sas.iomprovider',

... 'encoding': 'windows-1252'}

iomcom

{'iomport': 8591, 'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c', 'encoding': 'windows-1252', 'iomhost': 'mynode.mycompany.org', 'provider': 'sas.iomprovider'}

So, I'm just guessing at likely possibilities for you to have some indentation error. Editing a file is the most likely guess. That's all. The error didn't identify where the indentation error was.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVOHHHRV4CMES3X6R3DQCB3Z7A5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3EXGOY-23issuecomment-2D516518715&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=7navTBPaqAdOHzQ-iIiMQ1qC2o03i58YmWM3KH-c9Xk&s=JoJlTGPz8UZOxK4wIhGvbvUnDdAsyxqHsb-k3PZUnjE&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVOMJCW5UCWSHYTDW63QCB3Z7ANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=7navTBPaqAdOHzQ-iIiMQ1qC2o03i58YmWM3KH-c9Xk&s=dOF3x1Cll-XHtYwzkPJDP6A3DZOWsqwH4Ld93GBIikQ&e=.

tomweber-sas commented 5 years ago

Well, that's still progress :) I think that this error is because of a missing module that the COM access method requires, but saspy in general does not: pypiwin32 Can you check to see if you have that module installed (I'm guessing not) and install it so COM can work.

tomweber-sas commented 5 years ago

I see that this is not explicitly doc'ed in the COM configurations section of the doc. I will update that so it's explicit.

junwansas commented 5 years ago

I get more error this time.

sas=saspy.SASsession() Using SAS Config named: iomcom Param 'sascfgname' was ignored due to configuration restriction Traceback (most recent call last): File "<pyshell#2>", line 1, in sas=saspy.SASsession() File "C:\Program Files\Python37\lib\site-packages\saspy\sasbase.py", line 344, in init self._io = SASSessionCOM(sascfgname=self.sascfg.name, sb=self, **kwargs) File "C:\Program Files\Python37\lib\site-packages\saspy\sasiocom.py", line 155, in init self.pid = self._startsas() File "C:\Program Files\Python37\lib\site-packages\saspy\sasiocom.py", line 198, in _startsas server, user, password) File "", line 4, in CreateObjectByServer pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'SASObjectManager', '\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tThe client has connected to a SAS Workspace Server when it intended to connect to a SAS Object Spawner.\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t0x80041001\r\n\t\tsas\r\n\t\tdukesapc12\r\n\t\t8591\r\n\t\t0e3b1810-6646-11d5-8863-00c04f48bc53\r\n\t\tObjectSpawner.ObjectSpawner.1.0\r\n\t\t1720\r\n\t\tSASApp\r\n\t\r\n', None, 0, -2147213310), None)

Am I connected to wrong port? We have a grid control server too. Is this matter?

Jun

From: Tom Weber notifications@github.com Sent: Tuesday, July 30, 2019 1:59 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

I see that this is not explicitly doc'ed in the COM configurations section of the doc. I will update that so it's explicit.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVPPQAVF3FUZFGPDNJDQCB6NLA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3EZGQA-23issuecomment-2D516526912&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=u3h16uYtGR1giceZYpGZf5QpqnjxbdT9nGhkprWhJio&s=RDuQEXz26ktPXoYVpScowxNcfQ9kbS9fH56OjKQ3eKs&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVKZH6I4IPZTADPN5FDQCB6NLANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=u3h16uYtGR1giceZYpGZf5QpqnjxbdT9nGhkprWhJio&s=uLl8VItHQ1LS8iCjILV2o4PYPNmbcqmQwQfFMZSdvCs&e=.

tomweber-sas commented 5 years ago

Ok, so this is still progress. installing that module got us past that error. And, I've added that to the doc so others don't hit this too. The error appears to be:

The client has connected to a SAS Workspace Server when it intended to connect to a SAS Object Spawner.

This seems as though it has to do with the class_id you provided in your configuration definition. It appears that that class id is of the object server. I'm guessing that your host and port are correct, but that classid is the problem.

Can you run the other proc iomoperate to see the workspace server definitions so we can see what they have. I'm thinking that if the host is correct, which it seems to be (host of object spawner). and if the port is right (port for workspace server), which, given the error, seems like that's right, then you need to classid associated w/ that workspace server, not the object spawner.

See the iomoperate listed in the COM config doc, that may show is: https://sassoftware.github.io/saspy/install.html#iom-using-com Thought the one documented here for the workspace server seems to match up with what you ran for the object spawner. try both https://sassoftware.github.io/saspy/advanced-topics.html#using-proc-iomoperate-to-find-object-spawner-hosts-and-workspace-server-ports

But, it looks to me like this may be the last thing and you will get connected. We'll see :) good chance though!

Tom

junwansas commented 5 years ago

Yes, I got it! It is working now. I just have last question. Do saspy support sas encoded password?

Thank you!

Jun

From: Tom Weber notifications@github.com Sent: Tuesday, July 30, 2019 2:57 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Ok, so this is still progress. installing that module got us past that error. And, I've added that to the doc so others don't hit this too. The error appears to be:

The client has connected to a SAS Workspace Server when it intended to connect to a SAS Object Spawner.

This seems as though it has to do with the class_id you provided in your configuration definition. It appears that that class id is of the object server. I'm guessing that your host and port are correct, but that classid is the problem.

Can you run the other proc iomoperate to see the workspace server definitions so we can see what they have. I'm thinking that if the host is correct, which it seems to be (host of object spawner). and if the port is right (port for workspace server), which, given the error, seems like that's right, then you need to classid associated w/ that workspace server, not the object spawner.

See the iomoperate listed in the COM config doc, that may show is: https://sassoftware.github.io/saspy/install.html#iom-using-comhttps://urldefense.proofpoint.com/v2/url?u=https-3A__sassoftware.github.io_saspy_install.html-23iom-2Dusing-2Dcom&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=AaEYxJ0heBjiMtola14DFEg4i6FnOv-IfG3wGB2-Gx0&s=lDgFjzlMAUAnMCw35r_D9u8kpQ6H-XwAUDzuWAp7kGk&e= Thought the one documented here for the workspace server seems to match up with what you ran for the object spawner. try both https://sassoftware.github.io/saspy/advanced-topics.html#using-proc-iomoperate-to-find-object-spawner-hosts-and-workspace-server-portshttps://urldefense.proofpoint.com/v2/url?u=https-3A__sassoftware.github.io_saspy_advanced-2Dtopics.html-23using-2Dproc-2Diomoperate-2Dto-2Dfind-2Dobject-2Dspawner-2Dhosts-2Dand-2Dworkspace-2Dserver-2Dports&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=AaEYxJ0heBjiMtola14DFEg4i6FnOv-IfG3wGB2-Gx0&s=zph343gv2bOs_aQm1gFUJskwWUWk5xqpR4cgid_sOaM&e=

But, it looks to me like this may be the last thing and you will get connected. We'll see :) good chance though!

Tom

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVIUKVPADLTULKFOK6DQCCFGTA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3E6TCA-23issuecomment-2D516549000&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=AaEYxJ0heBjiMtola14DFEg4i6FnOv-IfG3wGB2-Gx0&s=97BDx32VyFRQHzNRFuXKNkX7rwqXLCPHKRCIAiQCyAk&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVM4ZBVPB4GOI25B4XDQCCFGTANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=AaEYxJ0heBjiMtola14DFEg4i6FnOv-IfG3wGB2-Gx0&s=xktRUMO0zDEqEIW_QlX44KyxC3A3sZTKid24uTkZIcw&e=.

tomweber-sas commented 5 years ago

That's great! Good job. Well, you'd think I would know the answer to that off the top of my head, yet I don't. I'll have to try it and see. But, I'll have to set that up for me to try out. I will do that and get back with you. Of course, if you have one you can just try and see too; but I need to verify that with the IOM access method too, so I'll investigate that and let you know what I find also.

Thanks! Tom

tomweber-sas commented 5 years ago

Well, that was easier than I thought to try. I have:

{SAS002}71837301186428AE515ABBED27B0EF3A

as a encoded pw and I tried both IOM and COM going to the same server (same credentialls). This worked with IOM but failed with COM. Looks like one more thing to investigate with COM.

Tom

tomweber-sas commented 5 years ago

Hold on. I must have cut-n-pasted the wrong thing. I see this does work with both. I've tried it with both prompting for the pw (that's the one I must have messed up) and I put it in the config file. Then I also tried it in the _authinfo file too. Seems to work in all cases.

Have you tried it to see?

thanks, Tom

junwansas commented 5 years ago

I will try it tomorrow. Do you know where I should put _authinfo fiile. I put my username and password in sascfg_personal.py. It is a test system. I am thinking about if we can do this on each user’s appdata location.

Thank you!

Jun

From: Tom Weber notifications@github.com Sent: Tuesday, July 30, 2019 3:52 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Hold on. I must have cut-n-pasted the wrong thing. I see this does work with both. I've tried it with both prompting for the pw (that's the one I must have messed up) and I put it in the config file. Then I also tried it in the _authinfo file too. Seems to work in all cases.

Have you tried it to see?

thanks, Tom

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVIJWFUAHXWTWTXCHMTQCCLXPA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3FD2EI-23issuecomment-2D516570385&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=WPP5-dTc9H8pPrZ5Q516YcOTRpsVoFjJPhdLNuxZsp0&s=anrM_1qTQtQx9cN_VJLB_-fozfi_9i7AA8zjGVNE7FY&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVKY3PHPMWLJVYY24L3QCCLXPANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=WPP5-dTc9H8pPrZ5Q516YcOTRpsVoFjJPhdLNuxZsp0&s=gjH6gcNhMVeLc2GuizG9B8MwTL_T2lWV3Mec7gTqlFQ&e=.

tomweber-sas commented 5 years ago

Yes, it goes in you user directory. So on Windows it would normally be C:\users\yourid\_authinfo On Windows it's underscore while on Linux it's dot. You should set there permissions so only you have access. Again, this is in the saspy config doc with examples of the format to use. https://sassoftware.github.io/saspy/install.html#iom-using-java Just scroll down till you see authinfo. Tom

I updated (trying to) this, the last slash between 'yourid' and '_authinfo' didn't display; again, this formats things so you can't trust it for bytewise data.

junwansas commented 5 years ago

I can get it to work both plant or encoded password if the user name and password was in sascfg_personal

But I can not get the _authinfo to work.

This is what in my sascfg_personal.py

SAS_config_names=['iomcom'] iomcom = { 'iomhost': 'dukesapc12', 'iomport': 8591, 'class_id': '440196D4-90F0-11D0-9F41-00A024BB830C', 'provider': 'sas.iomprovider', 'encoding': 'Latin1', 'authkey' : 'iom_sas'}

This is in c:\Users\jwan_authinfo file.

iom_sas user 'sas' password 'password'

I tried both with quote and without. Neither worked.

Any suggestion?

Jun

From: Tom Weber notifications@github.com Sent: Tuesday, July 30, 2019 5:43 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Yes, it goes in you user directory. So on Windows it would normally be C:\users\yourid_authinfo On Windows it's underscore while on Linux it's dot. You should set there permissions so only you have access. Again, this is in the saspy config doc with examples of the format to use. https://sassoftware.github.io/saspy/install.html#iom-using-javahttps://urldefense.proofpoint.com/v2/url?u=https-3A__sassoftware.github.io_saspy_install.html-23iom-2Dusing-2Djava&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=ecshx-JGseN7VyK8VgNTvQFa43TAZ2XVEHGUjGaAxrI&s=MtPuqgVfaILX6uj9BT1aoGRMXsDsIR2CukoybeAQPpQ&e= Just scroll down till you see authinfo. Tom

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVNTU325OJFW63KZGA3QCCYXFA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3FM3WY-23issuecomment-2D516607451&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=ecshx-JGseN7VyK8VgNTvQFa43TAZ2XVEHGUjGaAxrI&s=KzIO9KB2-6vfanjIUtRr1zExWD8G5vymh6LO3rUKuwo&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVK3N526IPZCD5HAXEDQCCYXFANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=ecshx-JGseN7VyK8VgNTvQFa43TAZ2XVEHGUjGaAxrI&s=_Hn89ygD3cJbHlMQoaBLImsr3R26umOL0DfkUFk_EDo&e=.

tomweber-sas commented 5 years ago

Ok, no quotes. I'm thinking you don't have the latest version that supports the authinfo file. If you submit your SASsession object you'll see the version. I believe 3.1.2 is the new version number with this support.

junwansas commented 5 years ago

Yes. The upgrade of saspy resolve the issue.

Thank you!

Jun

From: Tom Weber notifications@github.com Sent: Thursday, August 1, 2019 3:07 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Wan, Jun (CCI-Atlanta) Jun.Wan@cox.com; Author author@noreply.github.com Subject: [EXTERNAL] Re: [sassoftware/saspy] How to config saspy on windows server 2019? (#248)

Ok, no quotes. I'm thinking you don't have the latest version that supports the authinfo file. If you submit your SASsession object you'll see the version. I believe 3.1.2 is the new version number with this support.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sassoftware_saspy_issues_248-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMWWYVNGZP5GLO2X76PMI33QCMX3ZA5CNFSM4IG3XVLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3LSYTQ-23issuecomment-2D517418062&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=iK1o-sEizY8QuWnXHWkUP_OiSJ-MKk4OVaN2T46_o3Y&s=hjgU53ILbSUnz7u-dGExuysQhLKscD7cIbAzcRMcdVk&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMWWYVK3EB3OZZGUTGE5ZFTQCMX3ZANCNFSM4IG3XVLA&d=DwMCaQ&c=7rU_TrP7-Aj2T1siDr9tKQ&r=AtbLFNaMC0rr_Z2fkqS6HA&m=iK1o-sEizY8QuWnXHWkUP_OiSJ-MKk4OVaN2T46_o3Y&s=qjKlO1Zk-eoRtC12Ku3H34PaWYX81ddqg_yQsWWSCqw&e=.

tomweber-sas commented 5 years ago

Hey, great! Glad you're up and running!

Thanks, Tom

tomweber-sas commented 5 years ago

Cleaning up issues. This seems fixed, so I'll close this. If you need anything else just open up another one!

Thanks! Tom