Skip to content

Processing error due to invalid IP but an IP is shown in the event information #5701

Closed

Description

@rodolfoBee

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Configure the Python SDK in a Django project with eventScrubber:
entry_sdk.init(
    dsn="...", 
    send_default_pii=True,
    event_scrubber=EventScrubber()
)
  1. Add user IP via set_user, it can also be added by the SDK via send_default_pii=True,
  2. Disable the option "Prevent storing IP address" in the project settings
  3. Sent a test error event

Expected Result

The UI shows the user IP as [Filtered].

Actual Result

The UI shows an error due to invalid IP but the event has a valid IP address:
Image

The error is showing because the IP received by the server is invalid(from the event's JSON):

ip_address": {
"": {
"rem": [
[
"!config",
"s"
]
],
"err": [
[
"invalid_data",
{
"reason": "expected an ip address"
}
]
],
"val": "[Filtered]"
}
}

However, the server also infers the IP address for the event based on the HTTP request sending the event:

"user": {
"ip_address": "127.0.0.1",
"sentry_user": "ip:127.0.0.1"
},

This is what it seems to happen:

  1. An IP address is added via set_user or default_PII true
  2. The SDK's event scrubber removes it and replaces with [Filtered]
  3. The server sees the ip address value as Filtered and mark it as an invalid field in the event
  4. The server infers the IP address from the HTTP request and add it to the user info
  5. The UI shows an error (step 3), but also an IP address (Step4).

Product Area

Ingestion and Filtering

Link

https://dev-curumas.sentry.io/issues/7343757920/events/8184ab9875ca46aeafac1a9a53e16f0d/

DSN

No response

Version

No response

Activity

  1. linear-code commented on Mar 18, 2026

    @linear-code
  2. getsantry commented on Mar 18, 2026

    @getsantry

    Assigning to @getsentry/support for routing ⏲️

  3. moved this to Waiting for: Support in GitHub Issues with 👀 3on Mar 18, 2026
  4. getsantry commented on Mar 18, 2026

    @getsantry

    Routing to @getsentry/product-owners-ingestion-and-filtering for triage ⏲️

  5. moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3on Mar 18, 2026
  6. jjbayer commented on Mar 19, 2026

    @jjbayer
    Member

    The SDK should not set the IP address at all in this case, because it is a protocol violation.

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Mar 19, 2026
  8. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Mar 19, 2026
  9. transferred this issue fromgetsentry/sentryon Mar 19, 2026
  10. rodolfoBee commented on Mar 19, 2026

    @rodolfoBee
    MemberAuthor

    From what I see this needs to be changed: https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/scrubber.py#L102

    add an option that removes the IP address from the event instead of replacing it with [Filtered]

  11. added a commit that references this issue on Mar 23, 2026
    768820c
  12. added a commit that references this issue on May 12, 2026
    7a303dc
  13. added a commit that references this issue on Aug 9, 2026
    00d93c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions