3

I am trying to integrate dynatrace with my s4sdk-based application following the steps mentioned here:

https://www.dynatrace.com/support/help/cloud-platforms/cloud-foundry/application-only/deploy-oneagent-on-sap-cloud-platform-for-application-only-monitoring/

Only exception: I am using a trial account of dynatrace instead of setting up an account via SAP marketplace.

When trying to push my application I receive the following error during the staging phase:

Staging app and tracing logs...
   [...]
   Downloaded 'PostgreSQL JDBC Driver', version '42.2.5' in 0.2 s.
   Downloaded 'SAP JVM Memory Calculator', version '1.8.0' in 0.1 s.
   SEVERE: Unhandled exception in Buildpack main method: https://[envId].live.dynatrace.com/api/v1/deployment/installer/agent/unix/paas/latest?include=java&bitness=64&Api-Token=[apiToken] returned '404', download failed.Failed to compile droplet: Failed to compile droplet: exit status 9
   Exit status 223

EDIT: Accessing the link from my PC or after connecting to the container via ssh works without any problem.

So the question to me is whether I am required to use the SAP app center for aquiring dynatrace, or if the error lies somewhere else?

Configuration for user-provided service named dynatrace-service:

{
    "apitoken": "[apiToken]",
    "environmentid": "[envId]",
    "tag:SAP CP": "",
    "tag:Region": "Frankfurt"
}

Setup in manifest.yml of my application:

---
applications:

- name: address-manager
  memory: 1024M
  timeout: 300
  random-route: true
  path: application/target/address-manager-application.jar
  buildpacks:
    - sap_java_buildpack
  env:
    TARGET_RUNTIME: main
    SPRING_PROFILES_ACTIVE: 'cloud'
    JBP_CONFIG_DEBUG: '{enabled: true}'
  services:
    - my-xsuaa
    - my-destination
    - my-logging-service
    - dynatrace-service
Tim L.
  • 224
  • 2
  • 11

1 Answers1

2

First, to answer your question:

So the question to me is whether I am required to use the SAP app center for aquiring dynatrace, or if the error lies somewhere else?

To validate that I also registered for a trial account on Dynatrace and successfully could connect a to an SAP S/4HANA Cloud SDK based application running in my SAP Cloud Platform trial account on hanatrial.ondemand.com. Thus it should work and the error lies somewhere else.

My guess is that your environment id might not be correct. Thus, I did the following experiment: I changed the environment id to an invalid one in the user provided service and pushed again. I got the same error message as you have experienced:

SEVERE: Unhandled exception in Buildpack main method: https://[envid].live.dynatrace.com/api/v1/deployment/installer/agent/unix/paas/latest?include=java&bitness=64&Api-Token=[token] returned '404', download failed.Failed to compile droplet: Failed to compile droplet: exit status 9

I also clicked on the link in the log which returns 404. It shows an error message in addition to the 404 status code.

In my case it showed:

{
  error: {
    code: 404,
    message: "failed to resolve tenant <abcdef>"
  }
}

Please check again if the environment id is correct and open the link in the log to get more information.

  • Hi, first of all thanks for trying that out, good to know that it should work. I actually forgot to mention, that I tried the link manually as well from my local PC and it worked. I now also logged into the container via ssh and tried a wget on the link as well and that worked as well. So I am kind of at a loss, why it gets a 404 during staging... I am also using a trial account for the SCP, but I guess that shouldn't be a problem either, right? – Tim L. Jan 24 '19 at 13:13
  • Yes. Have you just tried to deploy it again? Maybe just a temporary issue? Maybe there is also an hidden character in your json configuration. Maybe you could also reconfigure it. – Daniel Kurzynski Jan 24 '19 at 14:05
  • 1
    Ok, that actually did work! It seems that the first character of the envID was for some reason uppercase in the configuration - although I just copied it. Didn't seem to make a difference when accessing the link via the browser or wget, but for the SDK... Reconfiguring the service did the trick. Thanks a lot for your help! – Tim L. Jan 24 '19 at 14:15
  • 2
    Hello Tim, I'm happy the issue could be resolved. To convey this to other users, please mark Daniel's answer as "accepted". Thank you. – Florian Wilhelm Jan 24 '19 at 14:32