cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XSA Node js startup issue in webide

1,548

Hi,

Node JS application is not starting after the build is completed successfully.

HANA version : 2.0 SPS 05.

XSA version : 1.0.130.519

Error :

2/1/21 2:41:24.883 PM [APP/2-0] ERR internal/modules/cjs/loader.js:638 2/1/21 2:41:24.883 PM [APP/2-0] ERR throw err; 2/1/21 2:41:24.883 PM [APP/2-0] ERR ^ 2/1/21 2:41:24.883 PM [APP/2-0] ERR 2/1/21 2:41:24.883 PM [APP/2-0] ERR Error: Cannot find module '/hana/shared/HDB/xs/app_working/imdbmaster/executionroot/c33352bd-2c7c-4eb9-a1f2-e896dc3cd737/app/init/initialize' 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Function.Module._load (internal/modules/cjs/loader.js:562:25) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Module.require (internal/modules/cjs/loader.js:692:17) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at require (internal/modules/cjs/helpers.js:25:18) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Object.<anonymous> (/hana/shared/HDB/xs/app_working/imdbmaster/executionroot/c33352bd-2c7c-4eb9-a1f2-e896dc3cd737/app/server.js:12:12) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Module._compile (internal/modules/cjs/loader.js:778:30) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Module.load (internal/modules/cjs/loader.js:653:32) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 2/1/21 2:41:24.883 PM [APP/2-0] ERR at Function.Module._load (internal/modules/cjs/loader.js:585:3) 2/1/21 2:41:24.888 PM [APP/2-0] ERR npm ERR! code ELIFECYCLE 2/1/21 2:41:24.888 PM [APP/2-0] ERR npm ERR! errno 1 2/1/21 2:41:24.890 PM [APP/2-0] ERR npm ERR! api@1.0.0 start: `node server.js` 2/1/21 2:41:24.890 PM [APP/2-0] ERR npm ERR! Exit status 1 2/1/21 2:41:24.890 PM [APP/2-0] ERR npm ERR! 2/1/21 2:41:24.890 PM [APP/2-0] ERR npm ERR! Failed at the api@1.0.0 start script. 2/1/21 2:41:24.890 PM [APP/2-0] ERR npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2/1/21 2:41:24.893 PM [APP/2-0] ERR 2/1/21 2:41:24.893 PM [APP/2-0] ERR npm ERR! A complete log of this run can be found in: 2/1/21 2:41:24.893 PM [APP/2-0] ERR npm ERR! /hana/shared/HDB/xs/app_working/imdbmaster/executionroot/c33352bd-2c7c-4eb9-a1f2-e896dc3cd737/app/.npm/_logs/2021-02-01T14_41_24_890Z-debug.log

Package.json Entries :

{

"dependencies": {

"express": "^4.17",

"@sap/xssec": "^2.2",

"@sap/xsjs": "^5.2.0",

"@sap/xsenv": "^2.2",

"@sap/hdbext": "~6.2",

"@sap/textbundle": "latest",

"@sap/logging": "~5.2",

"passport": "~0.4.0"

},

"description": "xyziot REST API",

"devDependencies": {

},

"files": [],

"main": "server.js",

"name": "api",

"scripts": {

"start": "node server.js"

},

"engines": {

"node": "10.x"

},

"version": "1.0.0"

}

Build was successful...

mta.yaml :

ID: xyziot

_schema-version: '2.1'

version: 0.0.1

modules:

- name: db

type: hdb

path: db

requires:

- name: hdi_db_2

properties:

TARGET_CONTAINER: '~{hdi-container-name_2}'

- name: cross-container-service-1

group: SERVICE_REPLACEMENTS

properties:

key: ServiceName_1

service: '~{the-service-name}'

- name: api

type: nodejs

path: api

provides:

- name: api_api

properties:

url: '${default-url}'

requires:

- name: hdi_db

- name: db

- name: XYZIOTUAA

- name: ui

type: html5

path: ui

requires:

- name: api_api

group: destinations

properties:

name: core-backend

url: '~{url}'

forwardAuthToken: true

- name: XYZIOTUAA

resources:

- name: hdi_db

properties:

hdi-container-name: '${service-name}'

type: com.sap.xs.hdi-container

- name: hdi_db_2

parameters:

config:

schema: XYZIOT

properties:

hdi-container-name_2: '${service-name}'

type: com.sap.xs.hdi-container

- name: cross-container-service-1

parameters:

service-name: XYZ_UPS

properties:

the-service-name: '${service-name}'

type: org.cloudfoundry.existing-service

- name: XYZIOTUAA

type: com.sap.xs.uaa-space

Note :

1. XYZIOTUAA service is bound with API and UI already.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Likes

Minjie,

This issue got fixed for me after tweaking parameter "default_domain" with absolute ip address of my box in xscontroller.ini

Parameter path : xscontroller.ini --> []communication --> default_domain

I assume you are basis admin. if not, contact them or if you have admin access, you may do it from hana studio.

Thanks
AV

minjie_lao
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Abarajith,

Thanks for your response, but seems my problem is something different, and i dont have such setting as you mentioned. I still looking for the solution.

Thanks,