Skip to content

AttributeError for 'NoneType' Object has no attribute 'url' #2728

Closed
@kevinchai0

Description

@kevinchai0

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.27.0

Steps to Reproduce

After upgrading our Sentry SDK from 1.5.11 to 1.28.1, we're noticing a bug that was introduced in version 1.27.0.

This is the PR that added the code that we're encountering errors on : 0245011#diff-fcd5f0e16a3c89f23d45675191f19d41ae8bbc0c24f1c414e854cefbd6e87ef3

Expected Result

No errors when running when attempting to access url.

Actual Result

AttributeError for 'NoneType' Object has no attribute 'url' with the following stack trace:

File "/var/lib/conda/envs/nextdoor3/lib/python3.11/site-packages/ddtrace/contrib/aiohttp/patch.py", line 112, in _traced_clientsession_request
    resp = await func(*args, **kwargs)  # type: aiohttp.ClientResponse


           
^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
File "/var/lib/conda/envs/nextdoor3/lib/python3.11/site-packages/aiohttp/client.py", line 500, in _request
    await trace.send_request_start(method, url.update_query(params), headers)
  
File "/var/lib/conda/envs/nextdoor3/lib/python3.11/site-packages/aiohttp/tracing.py", line 356, in send_request_start
    return await self._trace_config.on_request_start.send(
           
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
File "/var/lib/conda/envs/nextdoor3/lib/python3.11/site-packages/aiosignal/__init__.py", line 36, in send
    await receiver(*args, **kwargs)  # type: ignore
    
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
File "/var/lib/conda/envs/nextdoor3/lib/python3.11/site-packages/sentry_sdk/integrations/aiohttp.py", line 216, in on_request_start
    span.set_data("url", parsed_url.url)
                         
^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'url'

Metadata

Metadata

Assignees

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions