Skip to content

Commit d924ce3

Browse files
committed
Update Troubleshooting Guide
1 parent e39ddf6 commit d924ce3

File tree

1 file changed

+47
-54
lines changed

1 file changed

+47
-54
lines changed

TROUBLESHOOTING.md

Lines changed: 47 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Dear Learner,
44

55
due to dependecies or product updates, you could potentially run into some issues from time to time.
66

7-
Before posting a question in our [SAP BTP Learning Group](https://groups.community.sap.com/t5/sap-btp-learning/gh-p/SAP-BTP-Learning), please go through this troubleshooting guide carefully.
7+
Before posting a question in our [SAP Learning Group](https://groups.community.sap.com/t5/sap-learning-groups/ct-p/SAP-Learning), please **read** this troubleshooting guide **carefully**.
88

99
First and foremost, make sure to check your cds version:
1010

@@ -14,20 +14,22 @@ cds -v
1414

1515
It should print something similair like this:
1616
```bash
17-
@sap/cds: 6.1.3
18-
@sap/cds-compiler: 3.1.2
19-
@sap/cds-dk: 6.1.5
20-
@sap/cds-dk (global): 6.1.5
21-
@sap/cds-foss: 4.0.0
22-
@sap/cds-mtx: -- missing --
23-
@sap/eslint-plugin-cds: 2.5.0
17+
@cap-js/sqlite: 1.3.0
18+
@sap/cds: 7.3.0
19+
@sap/cds-compiler: 4.3.0
20+
@sap/cds-dk: 7.3.0
21+
@sap/cds-fiori: 1.1.0
22+
@sap/cds-foss: 4.0.2
23+
@sap/cds-mtxs: 1.12.0
24+
@sap/eslint-plugin-cds: 2.6.3
25+
Node.js: v18.14.2
2426
...
2527
```
2628

27-
If your ```@sap/cds``` dependency is lower than 5.9.x, then please make sure to upgrade your cds packages:
29+
If your ```@sap/cds``` dependency is lower than 7.0.0, then please make sure to upgrade your cds packages:
2830

2931
```bash
30-
npm i @sap/cds-dk && npm i @sap/cds && npm update
32+
npm i @sap/cds-dk@7.3.0 && npm i @sap/cds@7.3.0 && npm update
3133
```
3234

3335
Verify your cds version again with ```cds -v```.
@@ -80,53 +82,44 @@ npm config set registry http://registry.npmjs.org/
8082
npm install
8183
```
8284

83-
## Issue: Approuter invalid redirect_uri:
85+
## Issue: CICD Build fails
8486

85-
**SAP NOTE**: https://launchpad.support.sap.com/#/notes/2864831
87+
If your build fails with the following reason, then you have to adjust your `mta.yaml` file.
8688

87-
Some learners also reported that there is currently an issue with the approuter:
88-
89-
Error Message: ```The redirect_uri has an invalid domain.```.
90-
91-
### Solution:
92-
93-
If you face this issue, you have add the ```oauth2-configuration``` to your ```uaa-service``` definition in the ```mta.yaml``` file:
89+
```
90+
[2023-10-10T12:47:53.139Z] info mtaBuild - [2023-10-10 12:47:52] INFO Cloud MTA Build Tool version 1.2.23
91+
[2023-10-10T12:47:53.172Z] info mtaBuild - [2023-10-10 12:47:52] INFO generating the "Makefile_20231010124752.mta" file...
92+
[2023-10-10T12:47:53.209Z] info mtaBuild - [2023-10-10 12:47:52] INFO done
93+
[2023-10-10T12:47:53.245Z] info mtaBuild - [2023-10-10 12:47:52] INFO executing the "make -f Makefile_20231010124752.mta p=CF mtar=risk-management.mtar strict=true mode= t=\"/home/jenkins/agent/workspace/risk-management-job\"" command...
94+
[2023-10-10T12:47:53.283Z] info mtaBuild - [2023-10-10 12:47:52] INFO validating the MTA project
95+
[2023-10-10T12:47:53.319Z] info mtaBuild - [2023-10-10 12:47:52] INFO running the "before-all" build...
96+
[2023-10-10T12:47:53.354Z] info mtaBuild - [2023-10-10 12:47:52] INFO executing the "npx cds build --production" command...
97+
[2023-10-10T12:47:54.321Z] error mtaBuild - npm ERR! could not determine executable to run
98+
[2023-10-10T12:47:54.357Z] info mtaBuild -
99+
[2023-10-10T12:47:54.394Z] error mtaBuild - npm ERR! A complete log of this run can be found in:
100+
[2023-10-10T12:47:54.428Z] error mtaBuild - npm ERR! /home/mta/.npm/_logs/2023-10-10T12_47_52_982Z-debug-0.log
101+
[2023-10-10T12:47:54.463Z] error mtaBuild - .[2023-10-10 12:47:54] ERROR the "before-all"" build failed: could not execute the "npx cds build --production" command: exit status 1
102+
[2023-10-10T12:47:54.498Z] info mtaBuild - make: *** [Makefile_20231010124752.mta:28: pre_build] Error 1
103+
[2023-10-10T12:47:54.533Z] info mtaBuild - Error: could not build the MTA project: could not execute the "make -f Makefile_20231010124752.mta p=CF mtar=risk-management.mtar strict=true mode= t=\"/home/jenkins/agent/workspace/risk-management-job\"" command: exit status 2
104+
```
94105

95-
```NOTE: Please change the oauth2-configuration redirect-uri to your approuter's url!```
106+
## Solution:
96107

97-
```yaml
98-
oauth2-configuration: # <-- add this
99-
redirect-uris:
100-
# example: - https://risk-management-approuter.cfapps.eu10-004.hana.ondemand.com/login/callback
101-
- https://<approuter-route>/login/callback
102-
```
108+
In your `mta.yaml` file, add the `npm ci` command to your `before-all` commands. It should look like the following:
103109

104-
The ```uaa``` or nowadays ```auth``` resource should like like this:
105-
106-
```yaml
107-
---
108-
resources:
109-
110-
- name: risk-management-auth
111-
type: org.cloudfoundry.managed-service
112-
parameters:
113-
service: xsuaa
114-
service-plan: application
115-
path: ./xs-security.json
116-
config:
117-
xsappname: risk-management-${org}-${space}
118-
tenant-mode: dedicated
119-
role-collections:
120-
- name: 'RiskManager-${space}'
121-
description: Manage Risks
122-
role-template-references:
123-
- $XSAPPNAME.RiskManager
124-
- name: 'RiskViewer-${space}'
125-
description: View Risks
126-
role-template-references:
127-
- $XSAPPNAME.RiskViewer
128-
oauth2-configuration: # <-- add this
129-
redirect-uris:
130-
# example: - https://risk-management-approuter.cfapps.eu10-004.hana.ondemand.com/login/callback
131-
- https://<approuter-route>/login/callback
132110
```
111+
_schema-version: '3.1'
112+
ID: risk-management
113+
version: 3.0.0
114+
description: "Template for the Learning Journey Building side-by-side extensions on SAP BTP"
115+
parameters:
116+
enable-parallel-deployments: true
117+
build-parameters:
118+
before-all:
119+
- builder: custom
120+
commands:
121+
- npm ci
122+
- npx cds build --production
123+
modules:
124+
[...]
125+
```

0 commit comments

Comments
 (0)