TypeError: ">=" not supported between instances of NoneType and datetime
Categories
(Location :: General, defect, P2)
Tracking
(Not tracked)
People
(Reporter: willkg, Assigned: willkg)
Details
Attachments
(2 external files)
I was testing new prod today and hit this:
TypeError: '>=' not supported between instances of 'NoneType' and 'datetime.date'
File "ichnaea/log.py", line 168, in log_tween
response = handler(request)
File "ichnaea/db.py", line 102, in db_tween
response = handler(request)
File "pyramid/router.py", line 148, in handle_request
registry, request, context, context_iface, view_name
File "pyramid/view.py", line 667, in _call_view
response = view_callable(context, request)
File "pyramid/config/views.py", line 169, in __call__
return view(context, request)
File "pyramid/config/views.py", line 188, in attr_view
return view(context, request)
File "pyramid/config/views.py", line 214, in predicate_wrapper
return view(context, request)
File "pyramid/viewderivers.py", line 436, in rendered_view
result = view(context, request)
File "pyramid/viewderivers.py", line 114, in _class_requestonly_view
response = inst()
File "ichnaea/api/views.py", line 154, in __call__
return self.view(api_key)
File "ichnaea/api/locate/views.py", line 43, in view
result = self.locate(api_key)
File "ichnaea/api/locate/views.py", line 34, in locate
return searcher.search(query)
File "ichnaea/api/locate/searcher.py", line 127, in search
result = self._search(query)
File "ichnaea/api/locate/searcher.py", line 104, in _search
results.add(source.search(query))
File "ichnaea/api/locate/internal.py", line 90, in search
results = super(InternalPositionSource, self).search(query)
File "ichnaea/api/locate/internal.py", line 38, in search
results.add(search(query))
File "ichnaea/api/locate/cell.py", line 281, in search_cell
for cluster in cluster_cells(cells, query.cell):
File "ichnaea/api/locate/cell.py", line 85, in cluster_cells
for cell in area_cells
File "ichnaea/api/locate/cell.py", line 85, in <listcomp>
for cell in area_cells
With this curl:
#!/bin/bash
HOST=https://location.prod.mozaws.net
curl -v -X POST ${HOST}/v1/geolocate?key=test -d '
{
"considerIp": false,
"cellTowers": [{
"radioType": "wcdma",
"mobileCountryCode": 310,
"mobileNetworkCode": 410,
"locationAreaCode": 6982,
"cellId": 132480271,
"signalStrength": -60
}]
}
'
In this case, I'm pretty sure the station for that cell id has a last_seen of None and then the comparison fails.
Sentry issue: https://sentry.prod.mozaws.net/operations/location-prod/issues/6709610/
| Assignee | ||
Comment 1•6 years ago
|
||
I think we want to fix this, but after we migrate the infrastructure. It causes geolocate queries to get back an HTTP 500.
| Assignee | ||
Comment 2•6 years ago
|
||
Seeing this in prod now that we've shifted over:
https://sentry.prod.mozaws.net/operations/location-prod/issues/6742070/
Grabbing this to do a quick fix.
| Assignee | ||
Comment 3•6 years ago
|
||
| Assignee | ||
Comment 4•6 years ago
|
||
willkg merged PR #1002: "bug 1598325: fix None comparison error" in a7de5c9.
That should make the TypeError go away. I don't know if it gets the right value, though. On Monday, John can verify it--pretty sure he knows more about what that code is doing.
| Assignee | ||
Comment 5•6 years ago
|
||
| Assignee | ||
Comment 6•6 years ago
|
||
The first fix was deployed to stage and prod and the number of TypeErrors dropped off radically. I was still seeing some errors:
https://sentry.prod.mozaws.net/operations/location-prod/issues/6742094/
I found another comparison that I missed in the first pass. PR 1003 fixes that.
| Assignee | ||
Comment 7•6 years ago
|
||
| Assignee | ||
Comment 8•6 years ago
|
||
There aren't any more instances of this issue and John double-checked the fixes. We're good here! Marking as FIXED.
Description
•