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

Docker container hung if sap does not respond to RFM call #306

Closed
sajjanhubale opened this issue Oct 22, 2023 · 1 comment
Closed

Docker container hung if sap does not respond to RFM call #306

sajjanhubale opened this issue Oct 22, 2023 · 1 comment

Comments

@sajjanhubale
Copy link

Hi Team,

We are encountering a critical problem with the node-rfc package (version 2.7.1) when making calls to ABAP Remote Function Modules (RFMs) in SAP. When calling an ABAP RFM and SAP does not respond, our Docker container gets hung, rendering it unable to perform any other operations within the container. No other REST APIs or operations can be executed until the workprocess responsible for the operation is manually terminated. We have to kill the workprocess to bring the Docker service back online and enable it to perform the same or any other operations.

Details:
node-rfc Version: 2.7.1
SAP System Details: [Provide information about your SAP system, such as version, configuration, etc.]
Node.js Version: 18
Operating System: Linux SUSE

Could you please help to identify the issue? You can find below code that we use tho connect to sap and invoke the RFMs. Please let me know if you need more details?

`const { Client } = require('node-rfc');
const { logger } = require('../../../config/logger');

const getSAPConnection = async (connectionParameters) => {
try {
const client = new Client(connectionParameters);
await client.connect();
return client;
} catch (error) {
throw new Error(Failed to create a SAP connection: ${error.message});
}
};

const invokeSAPRFC = async (client, funtionModule, params) => {
try {
logger.info(Invoking ${funtionModule}, params);
const data = await client.call(funtionModule, params);
return JSON.parse(JSON.stringify(data));
} catch (error) {
throw new Error(
Failed to invoke RFC call for module ${funtionModule}: ${error.message}
);
}
};
const formatConnectionParams = (connection) => {
const connParams = {
user: connection.userId,
passwd: connection.sapPassword,
ashost: connection.hostname,
sysnr: connection.instanceNo,
client: connection.clientNo,
lang: 'EN',
};
return connParams;
};`

@bsrdjan it would be great if you can also check this issue from your end and help on this.

Thanks,
Sajjan

@bsrdjan
Copy link
Member

bsrdjan commented Oct 23, 2023

Hello @sajjanhubale,

which SAP NW RFC SDK version is used? Could you please upgrade and test with the latest node-rfc and SAP NW RFC SDK.

Does it hang when opening connection or after connection is opened, during RFC call execution?

Please note that client.connect() is callback, not async method. Try with await client.open() instead.

Regards,
Srdjan

@bsrdjan bsrdjan closed this as completed Jan 3, 2024
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