cancel
Showing results for 
Search instead for 
Did you mean: 

mta.yaml is missing the xsuaa resource even though package.json has the required code

former_member124169
Discoverer
0 Kudos

Hello All,

I am on the learning journey CLD200 Manual Deployment , on task 7 when I run the cds add mta , the generated mta.yaml file is missing the risk-management-xsuaa resource. Although my package.json has the required code for xsuaa. I have tried to delete and recreate the MTA but somehow this resource does not get automatically created. Can someone please share some ideas on what I am doing wrong? SAP BTP, Cloud Foundry runtime and environment  @MarL  Screenshot 2023-02-16 161945.png

 

my Package.json code is below

{
  "name": "risk-management",
  "version": "2.0.0",
  "description": "Template for the Learning Journey Building side-by-side extensions on SAP BTP",
  "author": "m.haug@sap.com",
  "license": "SAP SAMPLE CODE LICENSE",
  "engines": {
    "node": ">=14"
  },
  "private": true,
  "dependencies": {
    "@sap-cloud-sdk/http-client": "^2.5.0",
    "@sap/cds": "^6",
    "@sap/cds-dk": "^6.5.2",
    "express": "^4",
    "hdb": "^0.19.0",
    "passport": "^0.6.0"
  },
  "devDependencies": {
    "@sap/ux-specification": "^1.102.16",
    "sqlite3": "^5.0.4"
  },
  "scripts": {
    "start": "cds run",
    "watch-risks": "cds watch --open risks/webapp/index.html?sap-ui-xx-viewCache=false"
  },
  "eslintConfig": {
    "extends": "eslint:recommended",
    "env": {
      "es2020": true,
      "node": true,
      "jest": true,
      "mocha": true
    },
    "globals": {
      "SELECT": true,
      "INSERT": true,
      "UPDATE": true,
      "DELETE": true,
      "CREATE": true,
      "DROP": true,
      "CDL": true,
      "CQL": true,
      "CXL": true,
      "cds": true
    },
    "rules": {
      "no-console": "off",
      "require-atomic-updates": "off"
    }
  },
  "cds": {
    "requires": {
      "API_BUSINESS_PARTNER": {
        "kind": "odata-v2",
        "model": "srv\\external\\API_BUSINESS_PARTNER",
        "[development]": {
          "credentials": {
          }
        },
        "[production]": {
          "credentials": {
            "destination": "API_BUSINESS_PARTNER"
          }
        }
      },
      "db": {
        "kind": "hana-cloud"
      },
      "xsuaa": {
        "kind": "xsuaa"
      }
    }
  },
  "sapux": [
    "app/risks"
  ]
}

 

 

 

Margit_Wagner
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @former_member124169

We have received your request and are in the process of evaluating the problem.
Please allow for a delay in our response.
Kind regards
Margit
 

View Entire Topic
jannes_schofeld
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @dhrubajyoti @Jarmo_Tuominen ,

unfortunately I cannot reproduce the issue. I have adjusted the instructions, can you try to execute these adjusted instructions?

  • remove package-lock.json file from your project

  • create a file .npmrc in the directory where the package.json resides
  • add following line into the .npmrc file 
    registry=https://registry.npmjs.com/
  • run command npm install in the terminal within the root directory of your project (where the package.json file resides)
  • try to do the cf push again
  • let us know the results

I took inspiration from the following question in the community https://answers.sap.com/questions/13544661/how-to-avoid-changes-in-package-lockjson-when-usin.html , but unfortunately as said cannot reproduce the issue myself.

Thanks and best regards,

Jannes

Tiwari
Explorer
0 Kudos
deleted package-lock.json and then created file .npmrc in the same directory where package.json resides. then ran npm install and then CF PUSH.. but again same error..
Tiwari
Explorer
0 Kudos
I had even tried replacing content http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/ from package-lock.json with this URL. but, still it did'nt work.
Tiwari
Explorer
0 Kudos
someone has suggested on stackoverflow - npm config set proxy http://domain:8080 but, I am not sure as how to try this 😞
Tiwari
Explorer
0 Kudos

I may be wrong but the URL ( http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/) may be causing this. this may be locally accessible from SAP network but not from outside. This is just a vague thought. I tried opening this link and it says that it is not reachable. this URL is generated in package-lock.json file.

Tiwari
Explorer
0 Kudos
i also added "engines": { "node": "16.11.1", "npm": "8.0.0" } in package.json but no luck 😞
Tiwari
Explorer
0 Kudos
Sorry Jannes .. I know it would be difficult for you as you are not able to reproduce this issue. I am also trying different options to check and let you know so that something can trigger some thoughts which could be helpful for us facing this issue. Thanks
Tiwari
Explorer
0 Kudos

i tried command- "npm help config"    result --- npm ERR! code ENOENT npm ERR! syscall spawn man npm ERR! path man npm ERR! errno -2 npm ERR! enoent spawn man ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /home/user/.npm/_logs/2022-03-30T16_44_12_569Z-debug-0.log

jannes_schofeld
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Tiwari,

thanks for your efforts and for keeping us informed. Could you please try to run command

npm ci

instead of the npm i or npm install? npm ci is doing a clean install of all dependencies, e.g. removing all existing node modules before installing them again.

Best regards,

Jannes

Tiwari
Explorer
0 Kudos
Hi Jannes.. npm ci is throwing error if we remove package-lock.json. i ran npm install first and the ran npm ci. after that, i ran cf push but i am still getting the same error.
Tiwari
Explorer
0 Kudos
@Jannes - I tried npm help config command --- getting below error - npm help config npm ERR! code ENOENT npm ERR! syscall spawn man npm ERR! path man npm ERR! errno -2 npm ERR! enoent spawn man ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in.. I am not sure if you can get any clue with this error. Thanks for your help!