-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Server 2.7.4, Server 2.7.5
Debug log messages in the third party S2 Geometry Library (typically triggered by bad user input) are now visible in the server logs by setting the verbosity of the S2 log component to 5.
2 ways to enable S2 debug log messages:
- raising logLevel to 5 for all server components
./mongod -vvvvv"
- Using the new logComponentVerbosity server parameter introduced in
SERVER-14116:./mongod --setParameter=logComponentVerbosity="{s2: {verbosity: 5}}"
Sample logs in 2.7.5 at log level 5 generated from running jstests/core/geo_invalid_polygon.js:
% buildscripts/smoke.py --set-parameters=logLevel=5 --mode=files jstests/core/geo_invalid_polygon.js 2014-08-13T11:15:42.317-0400 I [initandlisten] MongoDB starting : pid=21518 port=27999 dbpath=/data/db/sconsTests/ 64-bit host=myhost.local ... 2014-08-13T11:16:01.090-0400 D S2 [conn3] Edges 0 and 2 cross 2014-08-13T11:16:01.090-0400 D S2 [conn3] Edge locations in degrees: -1.000000,-2.000000-1.000000,1.000000 and 1.000000,0.000000-0.000000,0.000000 2014-08-13T11:16:01.090-0400 D [conn3] User Assertion: 16755:Can't extract geo keys from object, malformed geometry?: { _id: 42.0, geometry: { type: "Polygon", coordinates: [ [ [ 0.0, 0.0 ], [ 0.0, 1.0 ], [ 1.0, 1.0 ], [ -2.0, -1.0 ], [ 0.0, 0.0 ] ] ] } } ... 2014-08-13T11:16:01.169-0400 I STORAGE [signalProcessingThread] shutdown: closing all files... 2014-08-13T11:16:01.169-0400 I STORAGE [signalProcessingThread] closeAllFiles() finished
---------
Original description:
It is non-trivial to debug issues with Geo queries that fail due to invalid polygons.
There are a number of very good error messages that occur within S2 that make these problems significantly easier to debug.
Can we find a way to capture these S2 logs and have them pushed over to our logfiles?
Example log line: https://github.com/mongodb/mongo/blob/master/src/third_party/s2/s2loop.cc#L110
- depends on
-
SERVER-5092 Better named logging with tracing
- Closed
-
SERVER-9751 Make S2 geometry library to use Mongo's LOG instead of writing to std::cerr.
- Closed
- is depended on by
-
SERVER-14894 modify S2 debug log message about intersecting edges to use GeoJSON format
- Closed
- is related to
-
SERVER-14508 Better error messages from GeoJSON parsing
- Closed
-
SERVER-15550 Change "S2" log component to "Geo"
- Closed
- related to
-
SERVER-13735 “Malformed geometry” error when creating a geosphere index for a valid MultiPolygon
- Closed