on 01-15-2020 2:53 PM
Hello community,
I have the following issue when i deploy with Cli in CF. I defined the following yaml file definition in my project: (i added a little part of my yaml file)
As you check in the image, I'm selecting the host name with ${space}. My space called "MY_SPACE_1". So when I deploy the application router inside Cloud Foundry account, host is converted to: "my-space-1-server_out"
The issue is, when you try to navigate to router to "server_out" is appearing at 404 not found, The reason is, app router is trying to access to "MY_SPACE_1"
How can i fix this? My app router version is 6.4.1
Hi,
I have a (long) answer for you 🙂
- name: bookshop-srv
type: nodejs
path: srv
parameters:
memory: 512M
disk-quota: 256M
routes:
- route: ${space}-bookshop-server.${default-domain}
provides:
- name: srv_api
properties:
url: "https://${routes/0/route}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many thanks,
Working for me 🙂
Hi Javier,
I just tried to modify one of my projects and everything worked fine. I don't see a logical difference between my MTA.yaml and yours:
_schema-version: 2.0.0
ID: bookshop
version: 1.0.0
modules:
- name: bookshop-db
type: hdb
path: db
parameters:
memory: 256M
disk-quota: 256M
requires:
- name: bookshop-db-hdi-container
- name: bookshop-srv
type: nodejs
path: srv
parameters:
memory: 512M
disk-quota: 256M
host: ${space}-bookshop-server
provides:
- name: srv_api
properties:
url: ${default-url}
requires:
- name: bookshop-db-hdi-container
- name: bookshop-ui
type: nodejs
path: app
parameters:
memory: 256M
disk-quota: 256M
host: ${space}-bookshop-ui
requires:
- name: srv_api
group: destinations
properties:
forwardAuthToken: true
strictSSL: true
name: srv_api
url: ~{url}
resources:
- name: bookshop-db-hdi-container
type: com.sap.xs.hdi-container
properties:
hdi-container-name: ${service-name}
parameters:
service: hanatrial
Are you also deploying your MTA to the trial landscape or to a production landscape?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marius,
I'm deploying in a production landscape and my example is working without host parameter or even with host parameter without space variable added.
My suspicious is when you have a name in your "space name" which contain the character "_" is when is falling because is not possible to convert it. Did you try in a space which contain this character?. Let me show you a definition of my production app:
My space name is: DEV_CF_SPACE_OPEX_DS. And when you deploy convert the name as following:
and when you navigate says:
Many thanks 🙂
Hi Javier,
It's strange that you see this error message. I would have expected that the app router might fail because it seems that the intention of the line "-name: approuter_in" seems incorrect.
I've never used the ${space} variable (I actually didn't event know there is one) but the rest looks fine to me.
Is it a requirement to define the host for the server module for you? I usually use dynamic host names and that works out great (here's an example).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Marius for your response.
For me your example is working, because i have the project similar that you have and is working perfectly, but please let me explain why i need this
The reason is because i need to generate a different url access per application in each environment and those environments contain different name of spaces. And i want to avoid autogeneration of urls, because if you don't define "host" parameter the url is autogenerated.
Maybe other solution is using an extension file, but the problem is in the way of transport in SCP, we're using TMS for SCP and with this method is not possible to add extension file in the moment of deploy.
Anyway, according to following documentation MTA, is possible to add ${space} to MTA in "host" parameter, because this is one of examples. But the behavior is strange because when you deploy with host name: ${space}-server_out, in CF is converted to my-space-server_out. However when you navigate with app router is not converting with same format, I think app router should change name with same name my-space-server_out, however is adding name of space directly MY_SPACE-server_out.
Please correct me, if i'm wrong and appreciate your help.
User | Count |
---|---|
76 | |
11 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.