Skip to content

DSN is required. Use empty string to disable SDK when building Native in Spring Boot #2742

@JakobStadlhuber

Description

@JakobStadlhuber

Integration

sentry

Java Version

17

Spring Boot Version

3.0.7
and plugin with id("org.graalvm.buildtools.native") version "0.9.20"

I tried it on an M1 with this additional option:
kotlin tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootBuildImage> { if (org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentArchitecture().isArm) { builder.set("dashaun/builder-arm:tiny") } }

Version

6.20.0 (logback, sentry-jdbc, sentry-spring-boot-starter-jakarta)

Steps to Reproduce

  1. Configure Sentry with application.properties (sentry.dsn=xxxx)
  2. gradle bootBuildImage

Expected Result

No error when building the native image

Actual Result

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sentryTransactionAdvice' defined in class path resource [io/sentry/spring/jakarta/tracing/SentryAdviceConfiguration.class]: Unsatisfied dependency expressed through method 'sentryTransactionAdvice' parameter 0: Error creating bean with name 'sentryHub' defined in class path resource [io/sentry/spring/boot/jakarta/SentryAutoConfiguration$HubConfiguration.class]: Failed to instantiate [io.sentry.IHub]: Factory method 'sentryHub' threw exception with message: DSN is required. Use empty string to disable SDK.

Metadata

Metadata

Assignees

Labels

BugIssue type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions