sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Source code not shown in Sentry next to stack trace

Open AlbertoCortina opened this issue 1 year ago • 5 comments

Integration

sentry-spring-boot-starter-jakarta

Java Version

21

Version

7.13.0

Environment

self-hosted running version 23.4.0

Steps to Reproduce

  1. Configure Sentry in my Spring Boot project, this is my build.gradle.kts configuration
plugins {
    id("io.sentry.jvm.gradle") version "4.11.0"
}

dependencies {
    implementation("io.sentry:sentry-spring-boot-starter-jakarta:7.13.0")
}

sentry {
    includeSourceContext.set(true)
    includeDependenciesReport.set(true)
    autoUploadSourceContext.set(true)
    autoInstallation {
        enabled.set(true)
    }

    org.set("sentry")
    projectName.set("my-project-name")
    url.set("my-instance-url")
    authToken.set("my-token")
}
  1. Write some code to trigger the error
  2. Do ./gradlew assemble so the sources are uploaded to Sentry (I can see them uploaded with the proper debug_id)
  3. Run the application and force the error

Expected Result

  1. ✅ See the error in Sentry
  2. ❌ See the source code next to the stack trace as shown in https://docs.sentry.io/platforms/java/guides/spring-boot/source-context/

Image Example from the documentation mentioned above

Actual Result

After triggering an error, I only see the stack trace without any code around like in the example provided in the Sentry documentation

Image


More (hopefully useful) information

Running the project locally I can see that the debug_id sent in the Sentry envelope when the exception is triggered matches the one uploaded as a debug file (I can see it uploaded successfully after running ./gradlew assemble)

{
  "debug_meta": {
    "images": [
      {
        "type": "jvm",
        "debug_id": "8f6cf514-5aae-48d1-b99f-ad01df069460"
      }
    ]
  }
}

Debug file upload matching the debug_id Image

AlbertoCortina avatar Aug 07 '24 12:08 AlbertoCortina

Hey @AlbertoCortina thanks for the report, we'll take a look and follow up here. Would you be able to share a link to the issue on sentry.io, either here or via email to [email protected]?

kahest avatar Aug 09 '24 10:08 kahest

Hello @kahest, I can't provide a link on sentry.io because we are using a self-hosted instance. Just in case it matters, we're experiencing the issue while running Sentry version 24.7.1.

AlbertoCortina avatar Aug 09 '24 14:08 AlbertoCortina

Hello @kahest,

We downgraded our instance to version 24.6.0, and everything is working as expected -- I can see the code next to the stack trace again. It might be worth checking the changes introduced between versions 24.6.0 and 24.7.1 that could be causing this issue.

AlbertoCortina avatar Aug 09 '24 15:08 AlbertoCortina

@AlbertoCortina that's interesting, thanks for letting us know! We'll take a look. To clarify - do you repro the issue in 24.7.0 as well or only 24.7.1? Also in your original report you state self-hosted running version 23.4.0 - but that version is not affected?

kahest avatar Aug 12 '24 07:08 kahest

Hi @AlbertoCortina, Good to hear, that it works after downgrading. However, I was unable to reproduce your problem with either 24.7.0 or 24.7.1 on my own self-hosted instance.

I set-up a simple controller and a service that throws a runtime exception and here's my build.gradle.kts:

plugins {
    java
    id("org.springframework.boot") version "3.3.2"
    id("io.spring.dependency-management") version "1.1.5"
    id("io.sentry.jvm.gradle") version "4.11.0"
}

group = "org.example"
version = "0.0.1-SNAPSHOT"

dependencies {
    implementation("io.sentry:sentry-spring-boot-starter-jakarta:7.13.0")
    implementation("org.springframework.boot:spring-boot-starter-web")
}

sentry {
    includeSourceContext.set(true)
    includeDependenciesReport.set(true)
    autoUploadSourceContext.set(true)
    autoInstallation {
        enabled.set(true)
    }

    org.set("org")
    projectName.set("project")
    url.set("self-hosted-url")
    authToken.set("token")
}

Would you be able to provide a minimal reproducible sample?

lbloder avatar Aug 12 '24 09:08 lbloder

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Sep 03 '24 07:09 getsantry[bot]

+1, self hosted sentry v 24.7.1, source bundle is uploaded and debug id is sent, no source code is shown

"debug_meta": {
    "images": [
      {
        "debug_id": "b1235361-8d90-4533-b403-b6610202f5bb",
        "type": "jvm"
      }
    ]
  }

Image Image

madopew avatar Nov 04 '24 10:11 madopew