cancel
Showing results for 
Search instead for 
Did you mean: 

Deployed Analytical List Page app is blank and metadata failed to load

JWJ
Participant
0 Kudos

The ALP app works great in local environment but I'm having trouble getting the cloud deployed app to work.

I get a blank page with just the SAP header bar with app name and search box at the top. In the browser network tab, I found one error saying "Internal Server Error" when trying to load the metadata for the page. When I look at the service in BTP, I cannot find any logs related to the error. There are no service logs recorded when opening the app from the launchpad.

Request URL: https://########trial.launchpad.cfapps.us10.hana.ondemand.com/563fa2d7-ffff-cccc-9d8b-b1de2b279990.m...
Request Method: GET
Status Code: 500 Internal Server Error

The cap app has a `server.js` file that loads the `@sap/cds-odata-v2-adapter-proxy`.

const port = process.env.PORT || 4004;
const proxy = require('@sap/cds-odata-v2-adapter-proxy');
const cds = require('@sap/cds');
module.exports = cds.server;

cds.on('bootstrap', app => {
    app.use(proxy({ port: port })); //OData V2
});

I'm not sure how to troubleshoot this. I tried created the ALP from scratch a second time and had the same issue.

Technical Information Dialog

SAPUI5 Distribution: 1.106.0 (built at 07.09.2022 12:41:00)
OpenUI5 Version: 1.106.0 (built at 06.09.2022 13:42:00)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
App URL: https://########trial.launchpad.cfapps.us10.hana.ondemand.com/cp.portal/ui5appruntime.html?siteId=f9...
OliverKlemenz
Advisor
Advisor

Make sure, that your complete model is accessible for proxy, when deployed. Especially, if "db" folder contains your entities, those are not part of "srv" folder, from which the deployment is started. A "cds build --production" prepares a gen/srv/csn.json, which is used when running deployed.

JWJ
Participant
0 Kudos

Thanks Oliver. I checked the gen/srv/csn.json and it appears to be ok. Contains references to the entity service that I need.

    "EntityViewService": {
      "@source": "srv/EntityViewService/viewentities-service.cds",
      "kind": "service",
      "@requires": "business",
      "@path": "/entityservice"
    },

The mta.yaml file already includes the command you mentioned. It runs this command:

npx -p @sap/cds-dk cds build --production && npm run cleanup:ts && npm run build:ts
OliverKlemenz
Advisor
Advisor
0 Kudos

That’s strange, that proxy does not log an error. Normally errors are logged under component “cov2ap”. Does the OData v4 $metadata endpoint work, when deployed?


You can try enabling debug traces by setting environment variable CDS_LOG_LEVELS_COV2AP=debug

Maybe that give additional insights. Or maybe it’s possible to debug the proxy on CF. There is an express route registered on $metadata. That’s a good starting point…

JWJ
Participant
0 Kudos

The V2 and V4 links all work on the index page. I see both metadata files and both ListOfBooks output.

I added the additional logging like this. It appears to have produced more logging for "cds" but nothing around the ALP application. No logs for "cov2ap".

    "cds": {
        "hana": {...},
        "requires": {...},
        "log": {
            "levels": {
                "cds": "debug",
                "app": "debug",
                "cov2ap": "debug",
                "odata": "debug"
            }
        },
        "features": {
            "kibana_formatter": true
        }
    },<br>

I don't know how to "debug the proxy on CF" but I'll look into that.

Thank you for your time.

Accepted Solutions (1)

Accepted Solutions (1)

JWJ
Participant
0 Kudos

The problem was in the `xs-app.json` file. When generating the app, I entered the wrong "destination" value.

When running the application locally this does not cause an issue but when deployed I get the internal server error.

The first "destination" under "routes" needs to match the "Name" in the mta.yaml file under "destinations".

Answers (0)