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

How to solve key=RFC_COMMUNICATION_FAILURE issue?! #364

Open
IT-HONGREAT opened this issue Mar 15, 2024 · 1 comment
Open

How to solve key=RFC_COMMUNICATION_FAILURE issue?! #364

IT-HONGREAT opened this issue Mar 15, 2024 · 1 comment
Assignees
Labels

Comments

@IT-HONGREAT
Copy link

I met key=RFC_COMMUNICATION_FAILURE error, and study documents&git issues.
But i didn't solve this error. I ask for your help.

Environment

  • OS: MacOs m1
  • Running in local(mac), python3.9 (from pycharm - miniconda)
  • PyRFC version : 3.3.1

I installed sapnwrfc pkg. and export envs.

envs

DYLD_LIBRARY_PATH=/usr/local/sap/nwrfcsdk/lib
SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk
SAPNWRFC_INI_FILE=/Users/myname/PycharmProjects/myproject/src/app/sap_rfc/sapnwrfc.ini

This is my sapnwrfc.ini file.

DEST=TEST
ASHOST=some_ip
CLIENT=100
LANG=KO
SYSNR=20
USER=something
PASSWD=something
RFC_TRACE=3

This is my connection code from some examples.

import os

from pyrfc import Connection

print(os.getenv("SAPNWRFC_INI_FILE"))
client = Connection(dest="TEST")
print(client)

result = client.call("STFC_CONNECTION", REQUTEXT="Hello SAP!")
print(result)

And comes this error.

pyrfc._exception.CommunicationError: 1 (rc=1): key=RFC_COMMUNICATION_FAILURE, message=
LOCATION    CPIC (TCP/IP) on local host with Unicode
ERROR       partner 'some_ip:some_port' not reached
TIME        Fri Mar 15 15:33:27 2024
RELEASE     753
COMPONENT   NI (network interface)
VERSION     40
RC          -10
MODULE      /bas/753_REL/src/base/ni/nibuf.cpp
LINE        4593
DETAIL      NiBufIConnect: connection pending after 60000ms
SYSTEM CALL connect
ERRNO       36
ERRNO TEXT  Operation now in progress
COUNTER     2
 [MSG: class=, type=, number=, v1-4:=;;;]

Thanks

@bsrdjan
Copy link
Member

bsrdjan commented Mar 15, 2024

Setting DYLD_LIBRARY_PATH has no effect for PyRFC on MacOS because of System Integrity Runtime Protections. No need to use it. SAPNWRFC_HOME also has no effect on runtime.

The error message is about network issue, which means the RFC SDK libraries are loaded and PyRFC could not reach the ABAP system. The cause are usually wrong connection parameters or network connectivity issues.

Could you please check connection parameters and sapnwrfc.ini file location?

sapnwrfc.ini default location is current working directory. The full path to sapnwrfc.ini (including file name) can be configured using RFC_INI env variable (not SAPNWRFC_INI_FILE). Alternatively, sapnwrfc.ini directory (without file name) can be set using PyRFC function set_ini_file_directory. More info are in this comment #275 (comment)

If the issue still persist, you set the global RFC trace level and remove it from destination connection parameters, like this

DEFAULT
RFC_TRACE=3 # 'global' trace level

Then run the test and send the trace. If the trace contains sensitive info, you can create SAP customer incident for BC-MID-RFC-SDK component and post the trace there, with reference to this issue.

@bsrdjan bsrdjan self-assigned this Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants