Я создал базовое приложение SAP CAP/Fiori, используя BAS SAP BTP, с созданным экземпляром HANA DB. Он работает нормально, когда я запускаю его локально. Однако во время развертывания пробной учетной записи SAP BTP я столкнулся с проблемой/ошибкой, описанной ниже.
После завершения развертывания с ошибками служба SAP CAP работает нормально, только SAP Fiori не работает, так как во время развертывания возникла ошибка.
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)
Внутри dmol ошибка Не удается открыть: на устройстве не осталось свободного места.
######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)#
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
Фрагмент кода для создания базового приложения Fiori/CAP.
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
пакет.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;
}
srv/service.cds
using { com.bookshop2 as bookshop } from '../db/domain-model';
service AdminService {
entity Books as projection on bookshop.Books;
entity Authors as projection on bookshop.Authors;
}
Приложение SAP UI5 / Фиори
Базовый фристайл или любой шаблон элемента Fiori.
SAUI5 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
Вам необходимо изменить дисковую квоту и объем памяти вашего приложения Fiori/SAUI5 с 256 МБ как минимум до 1024 МБ.
Привет @Jorg, я обновил свой вопрос соответствующими файлами ui5.yaml и процессом развертывания. Спасибо.
Для тех, кто столкнулся с этой проблемой развертывания в SAP BTP, я обновил свой вопрос, чтобы решить эту проблему. Пожалуйста, ознакомьтесь с последней деталью вопроса, чтобы получить ответ.
Мне удалось решить проблему развертывания с помощью экспертов SAP, изменив дисковую квоту и память приложения SAPUI5/Fiori файла mta.yaml с 256 МБ до 1024 МБ.
Что находится в вашем fiori ui5.yaml и других соответствующих файлах? Какая команда сборки? Есть ли шанс найти
combookshopfioribookshop.zip
и посмотреть, что там происходит?