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

SAP NWRFC SDK on Darwin works for single processes only #143

Closed
bsrdjan opened this issue May 7, 2020 · 13 comments
Closed

SAP NWRFC SDK on Darwin works for single processes only #143

bsrdjan opened this issue May 7, 2020 · 13 comments
Labels

Comments

@bsrdjan
Copy link
Contributor

bsrdjan commented May 7, 2020

After Apple security policy elevated, patched SAP NWRFC SDK does not work any more on Darwin 10.15.4, see #140.

Un-patched SDK, from SAP Support Portal, can be used with DYLD_FALLBACK_LIBRARY_PATH env variable set to SDK binaries path ($SAPNWRFC_HOME/lib folder) and it works for single process only.

Possible solutions are investigated with SAP NWRFC SDK experts.

Existing users

If your SAP NWRFC SDK and node-rfc already work on Darwin, you can upgrade Darwin and node-rfc, keeping the full functionality. If you upgrade SAP NWRFC SDK, it works in single process apps only.

New users

Install the SAP NWRFC SDK and set DYLD variable, like described in README. It works in single process apps only until this issue closed.

@geekhunger
Copy link

geekhunger commented May 8, 2020

@bsrdjan I installed the nwrfcsdk, then set the paths as you've stated. I now no longer get the codesign error but somethings still not right, because I get this error "Could not open the ICU common library". Could you explain what's missing, please?
Bildschirmfoto 2020-05-08 um 12 57 36

EDIT: actually got this working, when I set
export SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk and also export DYLD_LIBRARY_PATH=$SAPNWRFC_HOME/lib:$DYLD_LIBRARY_PATH

PS: If someone comes across this - if you have troubles to set these variables permanently then put the above export commands into sudo nano ~/.zprofile. As stated here https://stackoverflow.com/questions/56784894/macos-catalina-10-15beta-why-is-bash-profile-not-sourced-by-my-shell apple changed the default shell (before that file was ~/.profile)

@bsrdjan
Copy link
Contributor Author

bsrdjan commented May 11, 2020

Thank you @jack0088. Please consider that DYLD* variables are purged in child processes, no matter if set in shell, node app etc. I came across that after having a simple node script working stand-alone with DYLD* and failing when executed by jest test framework. Setting the DYLD* variables in the node app itself, just before loading the lib, did not help.

@bsrdjan
Copy link
Contributor Author

bsrdjan commented May 27, 2020

Did you try using previous, PL5 NWRFC SDK version, with the patch, until this issue solved?

@PaulWieland
Copy link

to people affected by this, I would recommend using Docker as it specifically addresses issues like this.

@bsrdjan I'm working on getting a light docker container working with node and node-rfc, if there is interest in SAP including or publishing this dockerfile I will share.

@bsrdjan
Copy link
Contributor Author

bsrdjan commented Jun 12, 2020

Yes. that would be another nice workaround for users affected with Darwin/PL6 issue, we still work on. Would you publish here, inside the new docker folder for example, as a contributor, or on docker hub?

@PaulWieland
Copy link

PaulWieland commented Jun 12, 2020

I would suggest publishing the dockerfile here on github and the built docker image on dockerhub.
It's not something I would publish directly with my user account as technically I would be redistributing the precompiled nwsdk libraries. I'm sure that violates a EULA somewhere...

@guptar85
Copy link

@bsrdjan @PaulWieland - I am using below Docker File. My use-case was different as I want to call SAP from Pivotal Cloud Foundry so I hosted container on PKS. I guess below DockerFile will work for any scenario.

Dockerfile

#Create a layer from the node:lts Docker image.
FROM node:lts

#Copying SDK from local to the desired location
ADD nwrfcsdk /usr/local/sap/nwrfcsdk

#Settign environment variable as mentioned in the document
ENV SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk

RUN echo /usr/local/sap/nwrfcsdk/lib > /etc/ld.so.conf.d/nwrfcsdk.conf && ldconfig

#Changing the Working directory
WORKDIR /usr/app

#Copying the source code to /usr/app/src from current directory
COPY src/ .

#Running NPM install
RUN npm i

#Exposing the PORT
EXPOSE 3000

#Running the application
CMD [ "node", "index.js" ]

.dockerignore

.git
.gitignore
**/node_modules

Thanks!

@PaulWieland
Copy link

Thanks for sharing your dockerfile @guptar85. The node:lts base image is quite large at nearly 1GB.

I'm trying to reduce the image size by building off of one of the really small base images for node (Alpine Linux is 5mb, and alpine + node is ~40mb for example). It's proving to be a challenge because the NWRFCSDK doesn't work in MUSL based linux environments. I am making progress with some of the other "slim" glibc based images.

I still think it should be possible to get a working node + node-rfc base image that is in the 200mb or less range, but we will see :)

@guptar85
Copy link

@PaulWieland - Yes initially I tried with Alpine but it didn't work with NWRFCSDK. If you change the version of Node from lts to lts-slim in Dockerfile and size will reduce to 377MB (where lts-slim is 142 MB and NWRFCK folder is 50MB and remaining is my src folder along with node_modules)

Below screenshot is few comparisons with different tag's I tried with the dockerfile

image

Thanks!

@stesap
Copy link

stesap commented Jul 9, 2020

just to be mentioned, there is also a official Dockerfile avail. by SAP https://github.com/SAP/devops-docker-images/tree/master/node-rfc

@ankri
Copy link

ankri commented Jul 20, 2020

Is there a recommended way to get the PL 5 Version of the NWRFCSDK for Catalina? I am only able to download the PL6 from the Launchpad.

@bsrdjan
Copy link
Contributor Author

bsrdjan commented Aug 18, 2020

Sorry, the PL5 is not available on SAP Support Portal.

@bsrdjan
Copy link
Contributor Author

bsrdjan commented Oct 13, 2020

The release 2.2.0 with PL7 fixes this issue

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

6 participants