cancel
Showing results for 
Search instead for 
Did you mean: 

XSA Node Module Crashes when left idle for some time?

0 Kudos

Hello All,

I have Created XSA Application(Node Module) to load/access data in HDB Container. It runs fine but if I try to access application after some time (next day), I get this error (An error occurred. Please open the SAP Web IDE Run console to view more information about the error.)

Log from SAP Web IDE

3/7/18 1:00:54.518 PM [APP/5-2] ERR    events.js:160
3/7/18 1:00:54.519 PM [APP/5-2] ERR          throw er; // Unhandled 'error' event
3/7/18 1:00:54.519 PM [APP/5-2] ERR          ^
3/7/18 1:00:54.519 PM [APP/5-2] ERR
3/7/18 1:00:54.519 PM [APP/5-2] ERR    Error: read ECONNRESET
3/7/18 1:00:54.519 PM [APP/5-2] ERR        at exports._errnoException (util.js:1018:11)
3/7/18 1:00:54.519 PM [APP/5-2] ERR        at TCP.onread (net.js:568:26)
3/7/18 2:01:44.000 PM [APP/5-2] TRC    /appcontroller.xUbWa9K2pf/AppController/node_modules/applicationcontroller/controller/proxyRequests.js:17 [] ERROR: Error occurred, Cannot proxy application requests...Error: connect ECONNREFUSED 127.0.0.1:64615

Server.js File

/*eslint no-console: 0, no-unused-vars: 0*/
"use strict";

var xsenv = require("@sap/xsenv"),
	port = process.env.PORT || 3000,
	server = require("http").createServer(),
	express = require("express"),
	app = express(),
	xsHDBConn = require("@sap/hdbext");

function initRouter() {
	return require("./router")(app, server);
}
var options = {
	anonymous: true // remove to authenticate calls
};

// configure HANA
try {
	options = Object.assign(options, xsenv.getServices({
		hana: {
			tag: "hana"
		}
	}));
} catch (err) {
	console.log("[WARN]", err.message);
}

app.use(xsHDBConn.middleware(options.hana));
// start server
var router = initRouter(app);
server.on("request", app);
server.listen(port, function() {
	console.info("HTTP Server: " + server.address().port);
});

How can I make the XSA application to be accessible all the time..??

Thanks in Advance.

Regards

Talha

lsubatin
Active Contributor
0 Kudos

Hi, what version of HXE is this?

0 Kudos

Hi

SAP HANA Express Edition 2.0 SPS 02

Regards

Talha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

Hi Talha,

Thanks for reaching out to us for this issue. We have contacted a colleague from XSA team to investigate on it. Will get back to you as soon as we hear from them.

Thanks,

Vidya

Former Member
0 Kudos

hi Vidhya,

You got any update. Moreover i also noticed that this error comes only if u are running app through WEB ide. If you have deployed your app in PROD space(using xs deploy) this error will not come.

Moreover i have a query:

If an app crashes in prod env (app deployed using xs deploy) will it get auto restarted?

regards,

Himanshu

christoph_pohl
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Talha,

Obviously, the AppContoller has lost its connection to your actual app. AppController is a proxy that WebIDE injects in front of any node.js app started from WebIDE. It is used for exchanging source code deltas so that it can be quickly restarted within seconds instead of minutes.

You should look in the logs of your app via "xs logs" command line interface or xsa-admin UI. I would expect that you find some hint there why your app has crashed.

Best,

Christoph

0 Kudos

Hello

Thank you for the answer. As you can see in the question I have added the log file. xs logs file shows the same error as displayed above. I cant find any other reason for the connection lost.

Regards

Talha

shimon_tal
Explorer
0 Kudos

Hi Talha,

Which version of XSA and SAP WebIDE are you using?

I want to reproduce the issue on my end.

Regards,

Shimon

0 Kudos

Hi

SAP HANA Express Edition 2.0 SPS 02 (2.00.021.00.1507025078)

Regards

Talha

0 Kudos

Hello

Do you have any solution for this..??

Regards

Talha