Spring Cloud /actuator/refresh corrupts live SentryOptions
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 42/100
Rechercherichtung
Start by reading SentryProperties and SentryAutoConfiguration$HubConfiguration.sentryHub, where the issue says the bound properties bean is passed to Sentry.init as the live options object. Then trace how Spring Cloud's ConfigurationPropertiesRebinder handles EnvironmentChangeEvent and inspect the reported refresh failure. Done means /actuator/refresh no longer corrupts live options, with environment and server name preserved on subsequent events.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Integration
sentry-spring-boot-4
Java Version
JVM 21 (OpenJ9)
Other Error Monitoring Solution
No
Other Error Monitoring Solution Name
No response
Version
8.61.1
Steps to Reproduce
Environment
- io.sentry:sentry-spring-boot-4-starter 8.61.1 (sentry + sentry-spring-7 + sentry-logback 8.61.1)
- Spring Boot 4.1.2, Spring Cloud 2025.1.x (config client + refresh endpoint enabled)
Summary
SentryProperties extends SentryOptions, and
SentryAutoConfiguration$HubConfiguration.sentryHub passes the bound
@ConfigurationProperties bean itself to Sentry.init(options). The bean
therefore is the live SentryOptions held by the initialized scopes.
When Spring Cloud's /actuator/refresh fires EnvironmentChangeEvent,
ConfigurationPropertiesRebinder rebinds all @ConfigurationProperties
beans — including SentryProperties. Because the bean is the live options
object, the rebind corrupts the running SDK:
Repro
- Spring Boot 4 app with
sentry-spring-boot-4-starter, Spring Cloud Config
client,management.endpoints.web.exposure.includecoveringrefresh. - Configure
sentry.dsn,sentry.environment,sentry.servernamevia a
remote property source (spring-cloud-config). - Start → events arrive with correct
environment/server_name. POST /actuator/refresh(even with no config change).- Subsequent events carry
environment: production,
server_name: <hostname>— and the refresh request itself throws the
retrieveParsedDsnNPE.
Expected Result
sentry.* should be resilient to configuration rebinding. Either:
sentryHubcopies the bound values into a freshSentryOptionsbefore
Sentry.init— the live options then stay immutable after init, and a
refresh simply doesn't apply new values (no corruption), or- the autoconfiguration listens for
EnvironmentChangeEvent/
RefreshScopeRefreshedEventand performs a properSentry.initwith a
fully-boundSentryProperties— making refresh actually work.
Actual Result
After POST /actuator/refresh — reproducible even with no config change:
-
The request handling
/actuator/refreshitself crashes during
SentryTracer.finish— the liveSentryOptions.dsnis transiently
nullwhileConfigurationPropertiesRebinderrebinds the
SentryPropertiesbean:java.lang.NullPointerException / IllegalArgumentException at io.sentry.util.Objects.requireNonNull(Objects.java:13) at io.sentry.Dsn.<init>(Dsn.java:54) at io.sentry.SentryOptions.lambda$new$0(SentryOptions.java:113) at io.sentry.util.LazyEvaluator.getValue(LazyEvaluator.java:39) at io.sentry.SentryOptions.retrieveParsedDsn(SentryOptions.java:831) at io.sentry.Baggage.setValuesFromTransaction(Baggage.java:529) at io.sentry.SentryTracer.finish(SentryTracer.java:292) at io.sentry.spring7.tracing.SentryTracingFilter.doFilterWithTransaction(SentryTracingFilter.java:172) -
dsnrecovers after rebind, so telemetry keeps flowing to the correct
project — butenvironmentandserverNamestaynullon the live
options. All subsequent events are emitted withenvironment = null
(Sentry server assigns the defaultproduction) andserver_name = <container hostname>(auto-detection fallback) — while
/actuator/configpropsstill showssentry.environment/sentry.servername
correctly bound on the (new)SentryPropertiesbean. -
Only a JVM restart restores correct
environment/server_name.
- Vorherrschende Sprache
- Kotlin
- Sterne
- 1.4k
- Forks
- 483
- Ø Merge
- 2 T. 54 Min.
- Gemergte PRs (30 T.)
- 207
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus getsentry/sentry-java
-
Test the `sentry wizard` Android portEvtl. vergeben @antonis hat das vor 1 Tag übernommen. OffenPlatform: Java
getsentry/sentry-java#6797 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Narrow and clean up Android consumer keep rulesEvtl. vergeben @runningcode hat das vor 3 Tagen übernommen. OffenAndroid Platform: Java
getsentry/sentry-java#6771 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Android Bug Platform: Java Waiting for: Product Owner
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
getsentry/sentry-java#6758 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Android Bug Platform: Java Replays
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
getsentry/sentry-java#6741 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Android Bug Platform: Java Replays
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 50/100
getsentry/sentry-java#6740 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in getsentry/sentry-java
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
IacobIonut01/ReFra#1515 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 4 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
openwatersio/slackwater-android#162 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 72/100
developmentwithyash/yaan#184 ·
Maintainer antworten meist innerhalb von 1 Tag
-
analytics
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
yeliqin666/xjtu-toolbox-android#623 · 1 Kommentar ·