cancel
Showing results for 
Search instead for 
Did you mean: 

Error while deploying SAP Fiori and CAPM application in SAP BTP Trial Account

0 Kudos

I created a basic SAP CAP/Fiori application using BAS of SAP BTP, with HANA DB Instance created. It's working fine when I run it locally. However, during deployment to SAP BTP Trial Account, I encountered the issue/error below.

After deployment was completed with errors, the SAP CAP Service is working fine, only the SAP Fiori which is not working since an error was encountered during deployment.

Error encountered during deployment

Error starting application "Bookshop2": Some instances have crashed. Check the logs of your application for more information.
Download the application logs via the dmol command and check them for more information.
A step of the process has failed. Retrying it may solve the issue.
Proceeding with automatic retry... (3 of 3 attempts left)

Content of dmol(Logs)

Inside dmol, an error Cannot open: No space left on device was encountered.

######org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-8326###
[PollStageAppStatusExecution] [Bookshop2] 238506b3-8a7f-415f-bcab-7c8de217ee09 [2023-04-19T16:44:37.035921] Copying droplet into the container failed: stream-in: nstar: error streaming in: exit status 2. Output: tar: ./app/bookshop/node_modules/@sap/di.code-validation.xml/src/fioriAnalysis/ui5Versions/1.60.13/_sap.m.json: Wrote only 512 of 10240 bytes (STDERR, CELL)#

#2.0#2023 04 19 17:15:28.108#Z#DEBUG#com.sap.cloud.lm.sl.xs2.783edf34-ded5-11ed-8416-eeee0a9a8355.Bookshop2.stageAppTask#
######org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-8326###
[PollStageAppStatusExecution] [Bookshop2] 238506b3-8a7f-415f-bcab-7c8de217ee09 [2023-04-19T16:44:37.035939] tar: ./app/bookshop/node_modules/@sap/di.code-validation.xml/src/fioriAnalysis/ui5Versions/1.60.13/_sap.ui.commons.json: Cannot open: No space left on device (STDERR, CELL)#

Steps for deployment

Cds add hana --for production
Cds add xsuaa –for production
Cds add mta (Optional in case you don’t have it yet.)
Cds add approuter –for production
It will generate xs-app and default-env.json inside /app folder. 
Npm install

Cds build –production
Mbt build -t gen –mtar mta.tar

cf login
cf deploy gen/mta.tar

Code Snippet

A code snippet use for creating a basic Fiori/CAP application.

mta.yaml

ID: Bookshop2
description: A simple CAP project.
version: 1.0.0
modules:
  - name: Bookshop2-srv
    type: nodejs
    path: gen/srv
    provides:
      - name: srv-api
        properties:
          srv-url: ${default-url}
    parameters:
      buildpack: nodejs_buildpack
    build-parameters:
      builder: npm-ci
    requires:
      - name: Bookshop2-db
      - name: Bookshop2-auth
  - name: Bookshop2-app-content
    type: com.sap.application.content
    path: .
    requires:
      - name: Bookshop2-repo-host
        parameters:
          content-target: true
    build-parameters:
      build-result: resources
      requires:
        - artifacts:
            - combookshopfioribookshop.zip
          name: combookshopfioribookshop
          target-path: resources/
  - name: combookshopfioribookshop
    type: html5
    path: app/bookshop
    build-parameters:
      build-result: dist
      builder: custom
      commands:
        - npm install
        - npm run build:cf
      supported-platforms:
        []

  - name: Bookshop2-db-deployer
    type: hdb
    path: gen/db
    parameters:
      buildpack: nodejs_buildpack
    requires:
      - name: Bookshop2-db

  - name: Bookshop2
    type: approuter.nodejs
    path: app/ # from cds.env.folders. Consider also cds.env.build.target -> gen/app
    parameters:
      keep-existing-routes: true
      disk-quota: 256M
      memory: 256M
    requires:
      - name: srv-api
        group: destinations
        properties:
          name: srv-api # must be used in xs-app.json as well
          url: ~{srv-url}
          forwardAuthToken: true
      - name: Bookshop2-auth
resources:
  - name: Bookshop2-repo-host
    type: org.cloudfoundry.managed-service
    parameters:
      service: html5-apps-repo
      service-name: Bookshop2-html5-srv
      service-plan: app-host
  - name: Bookshop2-destination-service
    type: org.cloudfoundry.managed-service
    parameters:
      config:
        HTML5Runtime_enabled: false
        init_data:
          instance:
            destinations:
              - Authentication: NoAuthentication
                Name: ui5
                ProxyType: Internet
                Type: HTTP
                URL: https://ui5.sap.com
            existing_destinations_policy: update
        version: 1.0.0
      service: destination
      service-name: Bookshop2-destination-service
      service-plan: lite
  - name: Bookshop2-db
    type: com.sap.xs.hdi-container
    parameters:
      service: hana
      service-plan: hdi-shared
  - name: Bookshop2-auth
    type: org.cloudfoundry.managed-service
    parameters:
      service: xsuaa
      service-plan: application
      path: ./xs-security.json
      config:
        xsappname: Bookshop2-${org}-${space}
        tenant-mode: dedicated
parameters:
  deploy_mode: html5-repo
  enable-parallel-deployments: true
build-parameters:
  before-all:
    - builder: custom
      commands:
        - npx -p @sap/cds-dk cds build --production

package.json

"name": "Bookshop2",
  "version": "1.0.0",
  "description": "A simple CAP project.",
  "repository": "<Add your repository here>",
  "license": "UNLICENSED",
  "private": true,
  "dependencies": {
    "@sap/cds": "^6",
    "express": "^4",
    "hdb": "^0.19.0",
    "@sap/xssec": "^3",
    "passport": "^0"
  },
  "devDependencies": {
    "@sap/ux-specification": "^1.108.3",
    "sqlite3": "^5",
    "rimraf": "^3.0.2"
  },
  "engines": {
    "node": "^16"
  },
  "scripts": {
    "start": "cds-serve",
    "watch-bookshop": "cds watch --open bookshop/webapp/index.html?sap-ui-xx-viewCache=false",
    "undeploy": "cf undeploy Bookshop2 --delete-services --delete-service-keys --delete-service-brokers",
    "build": "rimraf resources mta_archives && mbt build --mtar archive",
    "deploy": "cf deploy mta_archives/archive.mtar --retries 1"
  },
  "sapux": [
    "app/bookshop"
  ],
  "cds": {
    "requires": {
      "[production]": {
        "db": {
          "kind": "hana-cloud"
        },
        "auth": {
          "kind": "xsuaa"
        },
        "approuter": {
          "kind": "cloudfoundry"
        }
      },
      "db": {
        "kind": "sql"
      }
    }
  }
}

db/domain-model.cds

namespace com.bookshop2;

entity Books {
    key ID  : Integer;
    title   : String(100);
    stock   : Integer;
    price   : Decimal(9,2);
    author  : Association to Authors;
}

entity Authors {
    key ID  : Integer;
    name    : String(100);
    books   : Composition of many Books on books.author = $self;
}

SAP UI5 / Fiori App

Basic Freestyle or Any Fiori Element Template.

SAPUI5 ui5.yaml

metadata:
  name: com.bookshop.fiori.bookshop
type: application

SAPUI5 ui5-deploy.yaml

specVersion: '2.4'
metadata:
  name: com.bookshop.fiori.bookshop
type: application
resources:
  configuration:
    propertiesFileSourceEncoding: UTF-8
builder:
  resources:
    excludes:
      - "/test/**"
      - "/localService/**"
  customTasks:
  - name: webide-extension-task-updateManifestJson
    afterTask: replaceVersion
    configuration:
      appFolder: webapp
      destDir: dist
  - name: ui5-task-zipper
    afterTask: generateCachebusterInfo
    configuration:
      archiveName: combookshopfioribookshop
      additionalFiles:
      - xs-app.json

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi SAP Experts,

In case you encounter this issue during deployment, as suggested by antal.perger , you need to change your disk_quota and memory from 256M to at least 1024MB.

Answers (1)

Answers (1)

AntalP
Product and Topic Expert
Product and Topic Expert

Hi Takao,

It seems there is no free space remaining to extract all the npm packages:

[PollStageAppStatusExecution] [Bookshop2] 238506b3-8a7f-415f-bcab-7c8de217ee09 [2023-04-19T16:44:37.035939] tar: ./app/bookshop/node_modules/@sap/di.code-validation.xml/src/fioriAnalysis/ui5Versions/1.60.13/_sap.ui.commons.json: Cannot open: No space left on device (STDERR, CELL)

Could you try to remove some other applications from the trial subaccount and start the deployment again?

Best regards,

Antal

0 Kudos

Hi antal.perger , Currently in my trial subaccount only 1 application is deployed. It has a capacity of 4GB with 5 services deployed.

manjunath_ks1
Employee
Employee

Not an answer, but I want to point out that the screenshot refers to the "RAM" as "Memory", npm needs disk storage space.

former_member852776
Discoverer
0 Kudos

Hi manjunath_ks , Thanks for the response. Are you referring to the space remaining into my BAS? Currently, I have only 2 application in my workspace.

AntalP
Product and Topic Expert
Product and Topic Expert

Hi Takao,

Maybe the deployed files and the dependent packages need more disk space then the CF quota:

https://help.sap.com/docs/btp/sap-business-technology-platform/cloud-foundry-environment

"
When pushing or scaling your application, you can define a disk_quota that can be up to 4 GB. For more information, see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#disk-quotaInformation published on non-SAP site.

When deploying applications on SAP BTP, the maximum application package size is 1.5 GB. If your application is larger than that, the deployment fails. For more information, see https://docs.cloudfoundry.org/devguide/deploy-apps/large-app-deploy.htmlInformation published on non-SAP site

"

What is the size of the MTAR file?

Best regards,

Antal

0 Kudos

Hi antal.perger ,

The size of MTAR file was only 95.70MB. I tried to follow your instruction to change the disk_quota from 256M to 1024MB on my mta.yaml file, and IT WORKS! 🙂 My deployment to SAP BTP is now successful.