0

I have been playing with pyRFC for a while now, and was trying to see if it would be possible to use the SNC information as the connection parameters.

I tried with user and password and that's working fine.

I also verified that I have the sncgss32.dll file in the path (the path is in the SNC_LIB). This is working with SAP Logon (I don't need to use 'user and password' in SAP Logon), and also I saw another development in Excel that I assume connects through SNC because it doesn't require user and password, so I'm not sure if there's something wrong on my end or is it in SAP.

But found this error:

Traceback (most recent call last):
 File "<pyshell#18>", line 1, in <module>
   conn = Connection(ashost="server.com", sysnr="00", client="540", user="user", snc_partnername="p:domain\user")
 File "src/pyrfc/_pyrfc.pyx", line 181, in pyrfc._pyrfc.Connection.__init__
 File "src/pyrfc/_pyrfc.pyx", line 239, in pyrfc._pyrfc.Connection._open
 File "src/pyrfc/_pyrfc.pyx", line 269, in pyrfc._pyrfc.Connection._error
pyrfc._exception.CommunicationError: RFC_COMMUNICATION_FAILURE (rc=1): key=RFC_COMMUNICATION_FAILURE, message=
LOCATION    CPIC (TCP/IP) on local host with Unicode
ERROR       GSS-API(maj): An invalid name was supplied
           Import of a name failed
           name="p:domain\user"
TIME        Fri Sep 06 15:39:30 2019
RELEASE     753
COMPONENT   SNC (Secure Network Communication)
VERSION     6
RC          -4
MODULE      D:/depot/bas/753_REL/src/krn/snc/sncxxall.c
LINE        2738
DETAIL      SncPGSSImportName
SYSTEM CALL gss_import_name
COUNTER     3
[MSG: class=, type=, number=, v1-4:=;;;]

I reviewed part of the documentation, but couldn't find if there's an issue in my configuration, or if it's related to a SAP Configuration that is missing.

Thanks.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
AlbertoRR
  • 1
  • 1
  • Two things to consider: 1) Here is a guide with steps to follow: https://sap.github.io/PyRFC/authentication.html 2) sncgss.dll may be out of date if your SAP is on the cryptolib 3.0. You need to request the latest SNC DLL from your SAP team and test again (using 3.0). – AecorSoft Sep 07 '19 at 15:35
  • You say that SNC logon works ok with SAPLogon. So I suggest the following: 1. Add environment variables "CPIC_TRACE=3" and "CPIC_TRACE_DIR=C:\temp" (Or a similar directory that is easy to find and where your Windows user has write permission) 2. Logon once with SAPLogon In the resulting trace file you will see two interesting things: A) Which SNC_LIB SAPLogon is using. (As AecorSoft said, sncgss.dll does not look right nowadays.) B) Which kind of SNC parameters SAPLogon is using. (The error message indicates, that something is wrong with your value of SNC_PARTNERNAME) – Lanzelot Sep 17 '19 at 12:12
  • I was able to setup and get the trace file output but it did not provide any information about SNC parameters – smartexpert Nov 05 '19 at 18:02

0 Answers0