在SAP BTP试用帐户部署SAP Fiori和CAPM应用程序时出现错误。

huangapple go评论109阅读模式
英文:

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

问题

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

  1. Error starting application "Bookshop2": Some instances have crashed. Check the logs of your application for more information.
  2. Download the application logs via the dmol command and check them for more information.
  3. A step of the process has failed. Retrying it may solve the issue.
  4. 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.

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

  1. _schema-version: "3.1"
  2. ID: Bookshop2
  3. description: A simple CAP project.
  4. version: 1.0.0
  5. modules:
  6. - name: Bookshop2-srv
  7. type: nodejs
  8. path: gen/srv
  9. provides:
  10. - name: srv-api
  11. properties:
  12. srv-url: ${default-url}
  13. parameters:
  14. buildpack: nodejs_buildpack
  15. build-parameters:
  16. builder: npm-ci
  17. requires:
  18. - name: Bookshop2-db
  19. - name: Bookshop2-auth
  20. - name: Bookshop2-app-content
  21. type: com.sap.application.content
  22. path: .
  23. requires:
  24. - name: Bookshop2-repo-host
  25. parameters:
  26. content-target: true
  27. build-parameters:
  28. build-result: resources
  29. requires:
  30. - artifacts:
  31. - combookshopfioribookshop.zip
  32. name: combookshopfioribookshop
  33. target-path: resources/
  34. - name: combookshopfioribookshop
  35. type: html5
  36. path: app/bookshop
  37. build-parameters:
  38. build-result: dist
  39. builder: custom
  40. commands:
  41. - npm install
  42. - npm run build:cf
  43. supported-platforms:
  44. []
  45. - name: Bookshop2-db-deployer
  46. type: hdb
  47. path: gen/db
  48. parameters:
  49. buildpack: nodejs_buildpack
  50. requires:
  51. - name: Bookshop2-db
  52. - name: Bookshop2
  53. type: approuter.nodejs
  54. path: app/ # from cds.env.folders. Consider also cds.env.build.target -> gen/app
  55. parameters:
  56. keep-existing-routes: true
  57. disk-quota: 256M
  58. memory: 256M
  59. requires:
  60. - name: srv-api
  61. group: destinations
  62. properties:
  63. name: srv-api # must be used in xs-app.json as well
  64. url: ~{srv-url}
  65. forwardAuthToken: true
  66. - name: Bookshop2-auth
  67. resources:
  68. - name: Bookshop2-repo-host
  69. type: org.cloudfoundry.managed-service
  70. parameters:
  71. service: html5-apps-repo
  72. service-name: Bookshop2-html5-srv
  73. service-plan: app-host
  74. - name: Bookshop2-destination-service
  75. type: org.cloudfoundry.managed-service
  76. parameters:
  77. config:
  78. HTML5Runtime_enabled: false
  79. init_data:
  80. instance:
  81. destinations:
  82. - Authentication: NoAuthentication
  83. Name: ui5
  84. ProxyType: Internet
  85. Type: HTTP
  86. URL: https://ui5.sap.com
  87. existing_destinations_policy: update
  88. version: 1.0.0
  89. service: destination
  90. service-name: Bookshop2-destination-service
  91. service-plan: lite
  92. - name: Bookshop2-db
  93. type: com.sap.xs.hdi-container
  94. parameters:
  95. service: hana
  96. service-plan: hdi-shared
  97. - name: Bookshop2-auth
  98. type: org.cloudfoundry.managed-service
  99. parameters:
  100. service: xsuaa
  101. service-plan: application
  102. path: ./xs-security.json
  103. config:
  104. xsappname: Bookshop2-${org}-${space}
  105. tenant-mode: dedicated
  106. parameters:
  107. deploy_mode: html5-repo
  108. enable-parallel-deployments: true
  109. build-parameters:
  110. before-all:
  111. - builder: custom
  112. commands:
  113. - npx -p @sap/cds-dk cds build --production

package.json

  1. {
  2. "name": "Bookshop2",
  3. "version": "1.0.0",
  4. "description": "A simple CAP project.",
  5. "repository": "<Add your repository here>",
  6. "license": "UNLICENSED",
  7. "private": true,
  8. "dependencies": {
  9. "@sap/cds": "^6",
  10. "express": "^4",
  11. "hdb": "^0.19.0",
  12. "@sap/xssec": "^3",
  13. "passport": "^0"
  14. },
  15. "devDependencies": {
  16. "@sap/ux-specification": "^1.108.3",
  17. "sqlite3": "^5",
  18. "rimraf": "^3.0.2"
  19. },
  20. "engines": {
  21. "node": "^16"
  22. },
  23. "scripts": {
  24. "start": "cds-serve",
  25. "watch-bookshop": "cds watch --open bookshop/webapp/index.html?sap-ui-xx-viewCache=false",
  26. "undeploy": "cf undeploy Bookshop2 --delete-services --delete-service-keys --delete-service-brokers",
  27. "build": "rimraf resources mta_archives && mbt build --mtar archive",
  28. "deploy": "cf deploy mta_archives/archive.mtar --retries 1"
  29. },
  30. "sapux": [
  31. "app/bookshop"
  32. ],
  33. "cds": {
  34. "requires": {
  35. "[production]": {
  36. "db": {
  37. "kind": "hana-cloud"
  38. },
  39. "auth": {
  40. "kind": "xsuaa"
  41. },
  42. "approuter": {
  43. "kind": "cloudfoundry"
  44. }
  45. },
  46. "db": {
  47. "kind": "sql"
  48. }
  49. }
  50. }
  51. }

db/domain-model.cds

  1. namespace com.bookshop2;
  2. entity Books {
  3. key ID : Integer;
  4. title : String(100);
  5. stock :
  6. <details>
  7. <summary>英文:</summary>
  8. I created a basic **SAP CAP/Fiori application** using BAS of SAP BTP, with HANA DB Instance created. It&#39;s working fine when I run it locally. However, during deployment to SAP BTP Trial Account, I encountered the issue/error below.
  9. 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.
  10. **Error encountered during deployment**
  11. ---------------------------------------
  12. ```Starting application &quot;Bookshop2&quot;...
  13. Error starting application &quot;Bookshop2&quot;: Some instances have crashed. Check the logs of your application for more information.
  14. Download the application logs via the dmol command and check them for more information.
  15. A step of the process has failed. Retrying it may solve the issue.
  16. 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.

  1. ######org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-8326###
  2. [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)#
  3. #2.0#2023 04 19 17:15:28.108#Z#DEBUG#com.sap.cloud.lm.sl.xs2.783edf34-ded5-11ed-8416-eeee0a9a8355.Bookshop2.stageAppTask#
  4. ######org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-8326###
  5. [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

  1. Cds add hana for production
  2. Cds add xsuaa for production
  3. Cds add mta (Optional in case you dont have it yet.)
  4. Cds add approuter for production
  5. It will generate xs-app and default-env.json inside /app folder.
  6. Npm install
  7. Cds build production
  8. Mbt build -t gen mtar mta.tar
  9. cf login
  10. cf deploy gen/mta.tar

Code Snippet

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

mta.yaml

  1. ID: Bookshop2
  2. description: A simple CAP project.
  3. version: 1.0.0
  4. modules:
  5. - name: Bookshop2-srv
  6. type: nodejs
  7. path: gen/srv
  8. provides:
  9. - name: srv-api
  10. properties:
  11. srv-url: ${default-url}
  12. parameters:
  13. buildpack: nodejs_buildpack
  14. build-parameters:
  15. builder: npm-ci
  16. requires:
  17. - name: Bookshop2-db
  18. - name: Bookshop2-auth
  19. - name: Bookshop2-app-content
  20. type: com.sap.application.content
  21. path: .
  22. requires:
  23. - name: Bookshop2-repo-host
  24. parameters:
  25. content-target: true
  26. build-parameters:
  27. build-result: resources
  28. requires:
  29. - artifacts:
  30. - combookshopfioribookshop.zip
  31. name: combookshopfioribookshop
  32. target-path: resources/
  33. - name: combookshopfioribookshop
  34. type: html5
  35. path: app/bookshop
  36. build-parameters:
  37. build-result: dist
  38. builder: custom
  39. commands:
  40. - npm install
  41. - npm run build:cf
  42. supported-platforms:
  43. []
  44. - name: Bookshop2-db-deployer
  45. type: hdb
  46. path: gen/db
  47. parameters:
  48. buildpack: nodejs_buildpack
  49. requires:
  50. - name: Bookshop2-db
  51. - name: Bookshop2
  52. type: approuter.nodejs
  53. path: app/ # from cds.env.folders. Consider also cds.env.build.target -&gt; gen/app
  54. parameters:
  55. keep-existing-routes: true
  56. disk-quota: 256M
  57. memory: 256M
  58. requires:
  59. - name: srv-api
  60. group: destinations
  61. properties:
  62. name: srv-api # must be used in xs-app.json as well
  63. url: ~{srv-url}
  64. forwardAuthToken: true
  65. - name: Bookshop2-auth
  66. resources:
  67. - name: Bookshop2-repo-host
  68. type: org.cloudfoundry.managed-service
  69. parameters:
  70. service: html5-apps-repo
  71. service-name: Bookshop2-html5-srv
  72. service-plan: app-host
  73. - name: Bookshop2-destination-service
  74. type: org.cloudfoundry.managed-service
  75. parameters:
  76. config:
  77. HTML5Runtime_enabled: false
  78. init_data:
  79. instance:
  80. destinations:
  81. - Authentication: NoAuthentication
  82. Name: ui5
  83. ProxyType: Internet
  84. Type: HTTP
  85. URL: https://ui5.sap.com
  86. existing_destinations_policy: update
  87. version: 1.0.0
  88. service: destination
  89. service-name: Bookshop2-destination-service
  90. service-plan: lite
  91. - name: Bookshop2-db
  92. type: com.sap.xs.hdi-container
  93. parameters:
  94. service: hana
  95. service-plan: hdi-shared
  96. - name: Bookshop2-auth
  97. type: org.cloudfoundry.managed-service
  98. parameters:
  99. service: xsuaa
  100. service-plan: application
  101. path: ./xs-security.json
  102. config:
  103. xsappname: Bookshop2-${org}-${space}
  104. tenant-mode: dedicated
  105. parameters:
  106. deploy_mode: html5-repo
  107. enable-parallel-deployments: true
  108. build-parameters:
  109. before-all:
  110. - builder: custom
  111. commands:
  112. - npx -p @sap/cds-dk cds build --production

package.json

  1. &quot;name&quot;: &quot;Bookshop2&quot;,
  2. &quot;version&quot;: &quot;1.0.0&quot;,
  3. &quot;description&quot;: &quot;A simple CAP project.&quot;,
  4. &quot;repository&quot;: &quot;&lt;Add your repository here&gt;&quot;,
  5. &quot;license&quot;: &quot;UNLICENSED&quot;,
  6. &quot;private&quot;: true,
  7. &quot;dependencies&quot;: {
  8. &quot;@sap/cds&quot;: &quot;^6&quot;,
  9. &quot;express&quot;: &quot;^4&quot;,
  10. &quot;hdb&quot;: &quot;^0.19.0&quot;,
  11. &quot;@sap/xssec&quot;: &quot;^3&quot;,
  12. &quot;passport&quot;: &quot;^0&quot;
  13. },
  14. &quot;devDependencies&quot;: {
  15. &quot;@sap/ux-specification&quot;: &quot;^1.108.3&quot;,
  16. &quot;sqlite3&quot;: &quot;^5&quot;,
  17. &quot;rimraf&quot;: &quot;^3.0.2&quot;
  18. },
  19. &quot;engines&quot;: {
  20. &quot;node&quot;: &quot;^16&quot;
  21. },
  22. &quot;scripts&quot;: {
  23. &quot;start&quot;: &quot;cds-serve&quot;,
  24. &quot;watch-bookshop&quot;: &quot;cds watch --open bookshop/webapp/index.html?sap-ui-xx-viewCache=false&quot;,
  25. &quot;undeploy&quot;: &quot;cf undeploy Bookshop2 --delete-services --delete-service-keys --delete-service-brokers&quot;,
  26. &quot;build&quot;: &quot;rimraf resources mta_archives &amp;&amp; mbt build --mtar archive&quot;,
  27. &quot;deploy&quot;: &quot;cf deploy mta_archives/archive.mtar --retries 1&quot;
  28. },
  29. &quot;sapux&quot;: [
  30. &quot;app/bookshop&quot;
  31. ],
  32. &quot;cds&quot;: {
  33. &quot;requires&quot;: {
  34. &quot;[production]&quot;: {
  35. &quot;db&quot;: {
  36. &quot;kind&quot;: &quot;hana-cloud&quot;
  37. },
  38. &quot;auth&quot;: {
  39. &quot;kind&quot;: &quot;xsuaa&quot;
  40. },
  41. &quot;approuter&quot;: {
  42. &quot;kind&quot;: &quot;cloudfoundry&quot;
  43. }
  44. },
  45. &quot;db&quot;: {
  46. &quot;kind&quot;: &quot;sql&quot;
  47. }
  48. }
  49. }
  50. }

db/domain-model.cds

  1. namespace com.bookshop2;
  2. entity Books {
  3. key ID : Integer;
  4. title : String(100);
  5. stock : Integer;
  6. price : Decimal(9,2);
  7. author : Association to Authors;
  8. }
  9. entity Authors {
  10. key ID : Integer;
  11. name : String(100);
  12. books : Composition of many Books on books.author = $self;
  13. }

srv/service.cds

  1. using { com.bookshop2 as bookshop } from &#39;../db/domain-model&#39;;
  2. service AdminService {
  3. entity Books as projection on bookshop.Books;
  4. entity Authors as projection on bookshop.Authors;
  5. }

SAP UI5 / Fiori App

Basic Freestyle or Any Fiori Element Template.

SAUI5 ui5.yaml

  1. metadata:
  2. name: com.bookshop.fiori.bookshop
  3. type: application

SAPUI5 ui5-deploy.yaml

  1. specVersion: &#39;2.4&#39;
  2. metadata:
  3. name: com.bookshop.fiori.bookshop
  4. type: application
  5. resources:
  6. configuration:
  7. propertiesFileSourceEncoding: UTF-8
  8. builder:
  9. resources:
  10. excludes:
  11. - &quot;/test/**&quot;
  12. - &quot;/localService/**&quot;
  13. customTasks:
  14. - name: webide-extension-task-updateManifestJson
  15. afterTask: replaceVersion
  16. configuration:
  17. appFolder: webapp
  18. destDir: dist
  19. - name: ui5-task-zipper
  20. afterTask: generateCachebusterInfo
  21. configuration:
  22. archiveName: combookshopfioribookshop
  23. additionalFiles:
  24. - xs-app.json

Update: Solution to the Deployment Issue.

You need to change the disk-quota and memory of your Fiori/SAUI5 app from 256M to at least 1024MB.
在SAP BTP试用帐户部署SAP Fiori和CAPM应用程序时出现错误。

答案1

得分: 2

我已经通过SAP专家的帮助成功解决了部署问题,通过将mta.yaml文件中SAPUI5/Fiori应用的disk-quotamemory256M更改为1024MB

英文:

I have managed to solve the deployment issue with the help of SAP Experts by changing the disk-quota and memory of SAPUI5/Fiori App of mta.yaml file from 256M to 1024MB.

在SAP BTP试用帐户部署SAP Fiori和CAPM应用程序时出现错误。

huangapple
  • 本文由 发表于 2023年4月20日 01:46:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76057448.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定