Skip to content
Advertisement

Google Cloud Debugger can’t find Spring Boot web app deployed as Cloud Run service

I followed the guide (https://cloud.google.com/debugger/docs/setup/java#cloud-run) to setup the cloud debugger for my cloud run services. Everything looks like it should work. However the debugger UI tells me it can not find any application.

enter image description here

However I did everything that was suugested in the documentation

  • Source code is in Source Repositories
  • Cloud Build triggers on master push
  • I download the cdbg-java-agent.so
  • I run the java application with the -agentpath option
  • Cloud Run service is being deployed via cloudbuild.yaml
  • Cloud Run service starts healthy and works

However as you can see in the screenshot my application can not be found after successful deployment.

Here are some details of my configuration:

  • Spring Boot v2.4.2
  • Kotlin 1.4.21

This is my Dockerfile

JavaScript

Here is the docker build output

JavaScript

The container runs fine as already stated with the mentioned deployed cloud run service. So I am out of ideas on what to do to make this work. I hope anybody can help me out here


I also add my cloudbuild.yaml in case that is relevant

JavaScript

Advertisement

Answer

If you look what’s inside the zipped agent file, you’ll notice that there’s a few files in it called:

  1. cdbg_java_agent.so
  2. cdbg_java_agent_internals.jar
  3. version.txt

You’re getting this problem because you missed to copy the internals.jar file to /app dir. The shared object file has a dependency and that can explain why users are instructed to create a separate directory for the Debugger.

To fix it on this case, add the missing file on to your Dockerfile like this:

JavaScript

Then wait for approx. ~5 minutes until your service appears on the Debugger. Note that the source code will not appear automatically unless it’s located on a Git repo. For that you have to select the source code manually.

Advertisement