cancel
Showing results for 
Search instead for 
Did you mean: 

Deployed app not working - $metadata - File not found

Dogan
Participant

Hey guys,

i have been following this tutorial: https://developers.sap.com/group.dsag-cloud-dev-day-cf.html

I did every step and deployed the app to the btp.

I tested it after deployment and got the same result on the metadata:

After that i went to the HTML5 Applications like in the tutorial and found my managed app router.

There i clicked on it and and saw my tile

But when i click on it i get this error message:

In the F12 console it says:

GET fragebogenservice/$metadata - File not found sap.ui.model.odata.v4.lib._MetadataRequestor

And

The following error occurred while displaying routing target with name 'EigenfremdList': Error: File not found -

The app itself is working in the business application studio.

Also in the chapter "Deploy your application with access control" you adjust the mta.yaml file and add this section:

But after the deployment i went to the destinations in my BTP an saw, that no destination was created. Shouldn't it have been created automatically?

I thought this was what gave me the error, so i created it manually. But i still get the file not found screen.

Can anyone help?

Regards
Cemre

david_kunz2
Advisor
Advisor
0 Kudos

Hi thomas.jung ,

Can you help out?

Thanks and best regards,
David

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>But after the deployment i went to the destinations in my BTP an saw, that no destination was created. Shouldn't it have been created automatically?

So in this tutorial Deploy Your Application with Access Control (SAP HANA Cloud) | Tutorials for SAP Developers

At the end of Step 5 you didn't see the destination? Yes it should have been created for you by the deployment. Do you think you could perhaps post your complete mta.yaml? Perhaps there is some error in there causing the destination to not be created. Sometimes with YAML a simple indentation error makes a huge difference.

Dogan
Participant
0 Kudos

Hello Thomas,

sure thing. Here is my mta.yaml file.

_schema-version: "3.1"
ID: EigenFremd_0_1
description: A simple CAP project.
version: 1.0.0
modules:
- name: EigenFremd_0_1-srv
  type: nodejs
  path: srv
  requires:
  - name: EigenFremd_0_1-db
  - name: uaa_EigenFremd_0_1
  parameters:
    host: ${appname}
  build-parameters:
    ignore: [".env", "./node_modules"]
- name: EigenFremd_0_1-db-deployer
  type: hdb
  path: db
  requires:
  - name: EigenFremd_0_1-db
  parameters:
    buildpack: nodejs_buildpack
  build-parameters:
    ignore: [".env", "./node_modules"]
- name: EigenFremd_0_1-destination-content
  type: com.sap.application.content
  requires:
  - name: EigenFremd_0_1-destination-service
    parameters:
      content-target: true
  - name: EigenFremd_0_1_html_repo_host
    parameters:
      service-key:
        name: EigenFremd_0_1_html_repo_host-key
  - name: uaa_EigenFremd_0_1
    parameters:
      service-key:
        name: uaa_EigenFremd_0_1-key
  parameters:
    content:
      instance:
        destinations:
        - Name: eigenfremd_0_1_app_EigenFremd_0_1_html_repo_host
          ServiceInstanceName: EigenFremd_0_1-html5-app-host-service
          ServiceKeyName: EigenFremd_0_1_html_repo_host-key
          sap.cloud.service: eigenfremd_0_1.app
        - Authentication: OAuth2UserTokenExchange
          Name: eigenfremd_0_1_app_uaa_EigenFremd_0_1
          ServiceInstanceName: EigenFremd_0_1-xsuaa-service
          ServiceKeyName: uaa_EigenFremd_0_1-key
          sap.cloud.service: eigenfremd_0_1.app
        existing_destinations_policy: ignore
  build-parameters:
    no-source: true
- name: EigenFremd_0_1-app-content
  type: com.sap.application.content
  path: .
  requires:
  - name: EigenFremd_0_1_html_repo_host
    parameters:
      content-target: true
  build-parameters:
    build-result: resources
    requires:
    - artifacts:
      - eigenfremd01.zip
      name: eigenfremd01
      target-path: resources/
- name: eigenfremd01
  type: html5
  path: app/eigenfremd_0_1
  build-parameters:
    build-result: dist
    builder: custom
    commands:
    - npm install
    - npm run build:cf
    supported-platforms: []
resources:
- name: EigenFremd_0_1-db
  type: com.sap.xs.hdi-container
  parameters:
    service: hana
    service-plan: hdi-shared
  properties:
    hdi-service-name: ${service-name}
- name: EigenFremd_0_1-destination-service
  type: org.cloudfoundry.managed-service
  parameters:
    config:
      HTML5Runtime_enabled: true
      init_data:
        instance:
          destinations:
          - Authentication: NoAuthentication
            Name: ui5
            ProxyType: Internet
            Type: HTTP
            URL: https://ui5.sap.com
          - Name: eigenfremd_0_1-app-api
            Authentication: NoAuthentication
            ProxyType: Internet
            HTML5.ForwardAuthToken: true
            HTML5.DynamicDestination: true
            Type: HTTP
            URL: https://${appname}.${default-domain}
          existing_destinations_policy: update
      version: 1.0.0
    service: destination
    service-name: EigenFremd_0_1-destination-service
    service-plan: lite
- name: EigenFremd_0_1_html_repo_host
  type: org.cloudfoundry.managed-service
  parameters:
    service: html5-apps-repo
    service-name: EigenFremd_0_1-html5-app-host-service
    service-plan: app-host
- name: uaa_EigenFremd_0_1
  type: org.cloudfoundry.managed-service
  parameters:
    path: ./xs-security.json
    service: xsuaa
    service-name: EigenFremd_0_1-xsuaa-service
    service-plan: application

parameters:
  deploy_mode: html5-repo
  enable-parallel-deployments: true
  appname: eigenfremd_0_1-16082021_0

build-parameters:
  before-all:
  - builder: custom
    commands:
    - npm install --production
    - npx -p @sap/cds-dk cds build --production



Thank you for the help.

Regards

Cemre

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

The file looks alright to me. Can you confirm that you don't see any instance-level destinations It's a common error to look for destinations on the subaccount-level instead of clicking on the destination service instance.

If you don't see the destinations there either, I'd recommend to redeploy the app and to have a close look at the deployment logs to see if anything went wrong there.

Dogan
Participant
0 Kudos

Hi mariusobert ,

you were right.

It wasn't under Trial Account -> Subaccount -> Destinations, because i can't find the destination there:

It was pretty tricky to find, but in the end i found it and there is my destination eigenfremd_0_1-app-api:

But now there is another problem. If i check the connection, i get this error message:

Is there a step i missed or do i have to do some additional configurations?

Regards

Cemre

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

I'm glad you found the destinations. This error might be the reason why something is going wrong here.


Can you doublecheck that the URL displayed for the ...-api destination is working as expected? Something might be broken here because you used different names than the ones mentioned in the tutorial. Maybe it makes sense to follow the entire tutorial once to make sure it works with the original names.

Dogan
Participant

I think you are right. There is probably some tiypo or something.

I will do the entire tutorial with the original names.

If something comes up, i know who to ask 🙂

Thanks for the help

Regards

Dogan
Participant
0 Kudos

Hi mariusobert,

sry for posting an answer before, but this time i will do it right and add a comment 🙂

I followed your tutorial and did everything exactly as described in the tutorial.

There, i had no problems at all.

After that i tried it with a new app, with a different datamodel/name, etc.

You can find it in my repo

After the deployment, when accessing the metadata, i get the unauthorized message as described before.

When accessing the app via approuter i get the error:

Here is the link from the approuter

And here the app itself link to my app

Could you please look into it?

Besides from the namechanges i did everything as described in the tutorial.

Looking forward to your response.

Regards

Cemre

Accepted Solutions (0)

Answers (1)

Answers (1)

Dogan
Participant
0 Kudos

Hi mariusobert,

i know a few months has passed but i was doing different things and now wanted to share my results.

I followed your advice and did the entire tutorial with the original names. In the end everything worked fine.

After that i tried to do it again, but this time with custom names. I actually tried it a few times, with different apps but in the end i always got the same result.

After the deployment i want to test the app, just like the tutorial suggests Step 8: Test the HTML5 app

If i try to access one of the service endpoints or metadata, i also recieve an Unauthorized error

I also checked the destinations and checked the connection

and it returned a successfull connection

Now i did the next thing and tried to access the web application via the managed approuter.

I can see the tile in my Launchpad Sandbox.

If i click on it i get a technical error message

and if i check the console, i get this error

The deployment works fine, but after that i can't access the app or the metadata.

In the tutorial i should be able to see the List Report and choose the columns, but i never get to this point.

Did i do something wrong?

What can i do to fix the problem?

Thanks in advance

Best regards

Cemre

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

It's natural that you can't select columns when the $metadata request failed.

Can you add a screenshot of this request in the network trace where I can see the full URL that you try to access. And can you also add a screenshot of the xs-app.json file as well?

PS: It seems that you changed the names from the tutorial again and didn't follow my original advice: "Maybe it makes sense to follow the entire tutorial once to make sure it works with the original names."

Dogan
Participant
0 Kudos

I did the tutorial with the original names and it worked. But now i wanted to do a different app with a different datamodel and with custom names.

Here is the screenshot of the xs-app.json

and the URLs

https://d3be9a3dtrial.launchpad.cfapps.eu10.hana.ondemand.com/5b36a1b3-79c0-4068-a1b4-2e0b57e85f21.e...

https://d3be9a3dtrial.launchpad.cfapps.eu10.hana.ondemand.com/5b36a1b3-79c0-4068-a1b4-2e0b57e85f21.e...