Skip to content

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

@rodolfoBee

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

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions