schollz / find3

High-precision indoor positioning framework, version 3.
https://www.internalpositioning.com/doc
MIT License
4.65k stars 366 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #67

Closed hit0ri closed 6 years ago

hit0ri commented 6 years ago

Once in a day or two I'm getting this find3 server crash.

...
2018-04-18 04:52:34 [INFO] [PID-5268] server.go func1:978 192.168.1.140:50470 POST /passive 981.303591ms
2018-04-18 04:52:35 [INFO] [PID-5268] server.go func1:978 192.168.0.1:59900 POST /passive 284.261849ms
2018-04-18 04:52:45 [INFO] [PID-5268] server.go func1:978 192.168.0.1:59900 POST /passive 120.364359ms
2018-04-18 04:52:54 [WARN] [PID-5268] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 04:52:54 [WARN] [PID-5268] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 04:52:55 [INFO] [PID-5268] server.go func1:978 192.168.1.140:50470 POST /passive 9.402019684s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7071ce]

goroutine 841905 [running]:
database/sql.(*Stmt).Close(0x0, 0x0, 0x0)
        /home/find/.go/go1.10.1/src/database/sql/sql.go:2493 +0x2e
github.com/schollz/find3/server/main/src/database.(*Database).GetID(0xc420279880, 0xc2e850, 0x7, 0xc420929de0, 0x16, 0x0, 0xc420ed1101, 0xcbeec0, 0xc42103bc80)
        /home/find/go/src/github.com/schollz/find3/server/main/src/database/db.go:731 +0x180
github.com/schollz/find3/server/main/src/database.(*Database).AddName(0xc420279880, 0xc2e850, 0x7, 0xc420929de0, 0x16, 0x0, 0x0, 0x0, 0x0)
        /home/find/go/src/github.com/schollz/find3/server/main/src/database/db.go:740 +0x87
github.com/schollz/find3/server/main/src/database.(*Database).AddSensor(0xc420279880, 0x162d674401d, 0xc420ec9f48, 0x2, 0xc420929de0, 0x16, 0x0, 0x0, 0xc42107c4b0, 0x0, ...)
        /home/find/go/src/github.com/schollz/find3/server/main/src/database/db.go:267 +0x32a
github.com/schollz/find3/server/main/src/api.SaveSensorData(0x162d674401d, 0xc420ec9f48, 0x2, 0xc420929de0, 0x16, 0x0, 0x0, 0xc42107c4b0, 0x0, 0x0, ...)
        /home/find/go/src/github.com/schollz/find3/server/main/src/api/fingerprints.go:35 +0xdd
github.com/schollz/find3/server/main/src/server.processSensorData(0x162d674401d, 0xc420ec9f48, 0x2, 0xc420929de0, 0x16, 0x0, 0x0, 0xc42107c4b0, 0x0, 0x0, ...)
        /home/find/go/src/github.com/schollz/find3/server/main/src/server/server.go:923 +0x60
github.com/schollz/find3/server/main/src/server.parseRollingData(0xc420ec9f48, 0x2, 0x0, 0x0)
        /home/find/go/src/github.com/schollz/find3/server/main/src/server/server.go:888 +0x7e1
created by github.com/schollz/find3/server/main/src/server.handlerReverse.func1
        /home/find/go/src/github.com/schollz/find3/server/main/src/server/server.go:813 +0x59a

This server has location with ~4500 devices and 3 passive scanners

Server version: c787ee8 Go version: go1.10.1 linux/amd64

hit0ri commented 6 years ago

Here's another one with debug info:

...
2018-04-18 12:42:51 [INFO] [PID-15690] server.go func1:978 192.168.0.1:43818 POST /passive 1.195388789s
2018-04-18 12:42:59 [INFO] [PID-15690] server.go func1:978 192.168.0.107:54744 POST /passive 253.081316ms
2018-04-18 12:42:59 [INFO] [PID-15690] server.go func1:978 192.168.1.140:41936 POST /passive 252.753263ms
2018-04-18 12:43:02 [INFO] [PID-15690] server.go func1:978 192.168.0.1:43818 POST /passive 227.407382ms
2018-04-18 12:43:10 [INFO] [PID-15690] server.go func1:978 192.168.0.107:54744 POST /passive 450.205946ms
2018-04-18 12:43:12 [INFO] [PID-15690] server.go func1:978 192.168.1.140:41936 POST /passive 2.585037935s
2018-04-18 12:43:14 [INFO] [PID-15690] server.go func1:978 192.168.0.1:43818 POST /passive 1.317506646s
2018-04-18 12:43:29 [INFO] [PID-15690] server.go func1:978 192.168.0.107:54744 POST /passive 7.90976386s
2018-04-18 12:43:29 [DEBUG] [PID-15690] server.go parseRollingData:841 [qg] New data arrived 1m39.738883601s
2018-04-18 12:43:29 [INFO] [PID-15690] server.go func1:978 192.168.1.140:41936 POST /passive 6.247640695s
2018-04-18 12:43:29 [DEBUG] [PID-15690] server.go parseRollingData:841 [qg] New data arrived 1m40.017697382s
2018-04-18 12:43:29 [INFO] [PID-15690] server.go func1:978 192.168.0.1:43818 POST /passive 4.196180812s
2018-04-18 12:43:29 [DEBUG] [PID-15690] server.go parseRollingData:841 [qg] New data arrived 1m40.176044464s
2018-04-18 12:43:30 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609532 Family:qg Device:wifi-00:00:00:00:b3:e8 Location: Sensors:map[wifi:map[pavilion-wifi:-75 server-wifi:-81]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:30 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:b3:e8
2018-04-18 12:43:30 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609614 Family:qg Device:wifi-00:00:00:00:61:49 Location: Sensors:map[wifi:map[dell40-wifi:-66 pavilion-wifi:-63 server-wifi:-75]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:30 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 217.016042ms
2018-04-18 12:43:30 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 333.823153ms
2018-04-18 12:43:30 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:61:49
2018-04-18 12:43:30 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609746 Family:qg Device:wifi-00:00:00:00:e5:86 Location: Sensors:map[wifi:map[server-wifi:-91]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:31 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 739.639365ms
2018-04-18 12:43:31 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:e5:86
2018-04-18 12:43:31 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609391 Family:qg Device:wifi-00:00:00:00:c8:25 Location: Sensors:map[wifi:map[pavilion-wifi:-65 server-wifi:-66]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:31 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 176.288989ms
2018-04-18 12:43:31 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:c8:25
2018-04-18 12:43:31 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609482 Family:qg Device:wifi-00:00:00:00:18:4c Location: Sensors:map[wifi:map[server-wifi:-88]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:32 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 1.124292092s
2018-04-18 12:43:32 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:18:4c
2018-04-18 12:43:32 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609553 Family:qg Device:wifi-00:00:00:00:73:88 Location: Sensors:map[wifi:map[server-wifi:-88]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:32 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 312.309687ms
2018-04-18 12:43:32 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:73:88
2018-04-18 12:43:32 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609573 Family:qg Device:wifi-00:00:00:00:ce:64 Location: Sensors:map[wifi:map[pavilion-wifi:-61 server-wifi:-78 dell40-wifi:-62]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:33 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044610030 Family:qg Device:wifi-00:00:00:00:73:88 Location: Sensors:map[wifi:map[server-wifi:-88]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:33 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 193.397471ms
2018-04-18 12:43:33 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:73:88
2018-04-18 12:43:33 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609899 Family:qg Device:wifi-00:00:00:00:d1:0d Location: Sensors:map[wifi:map[server-wifi:-89]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:34 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 1.078664904s
2018-04-18 12:43:34 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:d1:0d
2018-04-18 12:43:34 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044610010 Family:qg Device:wifi-00:00:00:00:2e:6a Location: Sensors:map[wifi:map[server-wifi:-75]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:34 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 255.359944ms
2018-04-18 12:43:34 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:2e:6a
2018-04-18 12:43:34 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044610335 Family:qg Device:wifi-00:00:00:00:27:3f Location: Sensors:map[wifi:map[dell40-wifi:-63 server-wifi:-83]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:34 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 278.542312ms
2018-04-18 12:43:34 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:27:3f
2018-04-18 12:43:34 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044610294 Family:qg Device:wifi-00:00:00:00:37:e5 Location: Sensors:map[wifi:map[server-wifi:-91]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609619 Family:qg Device:wifi-00:00:00:00:8d:09 Location: Sensors:map[wifi:map[dell40-wifi:-76 pavilion-wifi:-55 server-wifi:-77]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:35 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 131.814358ms
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:8d:09
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609832 Family:qg Device:wifi-00:00:00:00:92:96 Location: Sensors:map[wifi:map[server-wifi:-86]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:35 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 245.031931ms
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:92:96
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609649 Family:qg Device:wifi-00:00:00:00:89:a8 Location: Sensors:map[wifi:map[pavilion-wifi:-61 dell40-wifi:-64 server-wifi:-68]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:35 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 153.12873ms
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:89:a8
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609690 Family:qg Device:wifi-00:00:00:00:c8:25 Location: Sensors:map[wifi:map[server-wifi:-66 pavilion-wifi:-67]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:35 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 12:43:35 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 160.903282ms
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:c8:25
2018-04-18 12:43:35 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609720 Family:qg Device:wifi-00:00:00:00:06:d2 Location: Sensors:map[wifi:map[pavilion-wifi:-69]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:36 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 241.69551ms
2018-04-18 12:43:36 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:06:d2
2018-04-18 12:43:36 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609761 Family:qg Device:wifi-00:00:00:00:d1:0d Location: Sensors:map[wifi:map[server-wifi:-89]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:36 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 190.175225ms
2018-04-18 12:43:36 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:d1:0d
2018-04-18 12:43:36 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609842 Family:qg Device:wifi-00:00:00:00:73:88 Location: Sensors:map[wifi:map[server-wifi:-88]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:36 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 12:43:36 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 188.796961ms
2018-04-18 12:43:36 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:73:88
2018-04-18 12:43:36 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609669 Family:qg Device:wifi-00:00:00:00:08:90 Location: Sensors:map[wifi:map[pavilion-wifi:-79 server-wifi:-61]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:36 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 12:43:37 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 4.406500244s
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:ce:64
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609725 Family:qg Device:wifi-00:00:00:00:30:1b Location: Sensors:map[wifi:map[dell40-wifi:-63 server-wifi:-79 pavilion-wifi:-65]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:37 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 173.722411ms
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:30:1b
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609766 Family:qg Device:wifi-00:00:00:00:53:02 Location: Sensors:map[wifi:map[server-wifi:-87 dell40-wifi:-68 pavilion-wifi:-69]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:37 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 12:43:37 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 135.217056ms
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:53:02
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609796 Family:qg Device:wifi-00:00:00:00:36:9f Location: Sensors:map[wifi:map[server-wifi:-82]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:37 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 141.355771ms
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:36:9f
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609816 Family:qg Device:wifi-00:00:00:00:14:4a Location: Sensors:map[wifi:map[pavilion-wifi:-73]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:37 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 131.644967ms
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:14:4a
2018-04-18 12:43:37 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609806 Family:qg Device:wifi-00:00:00:00:73:65 Location: Sensors:map[wifi:map[server-wifi:-86]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:38 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:08:90
2018-04-18 12:43:38 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044610166 Family:qg Device:wifi-00:00:00:00:55:c4 Location: Sensors:map[wifi:map[server-wifi:-79]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:38 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 1.865037447s
2018-04-18 12:43:38 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 148.935041ms
2018-04-18 12:43:38 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:55:c4
2018-04-18 12:43:38 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609822 Family:qg Device:wifi-00:00:00:00:b3:e8 Location: Sensors:map[wifi:map[pavilion-wifi:-75 server-wifi:-81]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:38 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 137.541036ms
2018-04-18 12:43:38 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:b3:e8
2018-04-18 12:43:38 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609933 Family:qg Device:wifi-00:00:00:00:52:78 Location: Sensors:map[wifi:map[pavilion-wifi:-59 dell40-wifi:-58]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:39 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem getting key: database is locked
2018-04-18 12:43:39 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem getting key: database is locked
2018-04-18 12:43:40 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 12:43:40 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 2.126172383s
2018-04-18 12:43:40 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:52:78
2018-04-18 12:43:40 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044609943 Family:qg Device:wifi-00:00:00:00:2e:38 Location: Sensors:map[wifi:map[server-wifi:-88]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:41 [DEBUG] [PID-15690] db.go AddSensor:350 [qg] inserted sensor data, 320.277359ms
2018-04-18 12:43:41 [DEBUG] [PID-15690] server.go parseRollingData:892 [qg] saved reverse sensor data for wifi-00:00:00:00:2e:38
2018-04-18 12:43:41 [DEBUG] [PID-15690] server.go parseRollingData:881 [qg] reverse sensor data: {Timestamp:1524044610024 Family:qg Device:wifi-00:00:00:00:e5:86 Location: Sensors:map[wifi:map[server-wifi:-91]] GPS:{Latitude:0 Longitude:0 Altitude:0}}
2018-04-18 12:43:41 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 12:43:41 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem getting key: database is locked
2018-04-18 12:43:42 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
2018-04-18 12:43:42 [WARN] [PID-15690] analysis.go AnalyzeSensorData:117 [qg] nb1 classify: problem preparing SQL: database is locked
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7071ce]

goroutine 142389 [running]:
database/sql.(*Stmt).Close(0x0, 0x0, 0x0)
        /home/find/.go/go1.10.1/src/database/sql/sql.go:2493 +0x2e
github.com/schollz/find3/server/main/src/database.(*Database).GetID(0xc4201d7280, 0xc2e850, 0x7, 0xc42051ea60, 0x16, 0x0, 0xc420c5b101, 0xcbeec0, 0xc420a8f120)
        /home/find/go/src/github.com/schollz/find3/server/main/src/database/db.go:731 +0x180
github.com/schollz/find3/server/main/src/database.(*Database).AddName(0xc4201d7280, 0xc2e850, 0x7, 0xc42051ea60, 0x16, 0x0, 0x0, 0x0, 0x0)
        /home/find/go/src/github.com/schollz/find3/server/main/src/database/db.go:740 +0x87
github.com/schollz/find3/server/main/src/database.(*Database).AddSensor(0xc4201d7280, 0x162d823390e, 0xc420cad378, 0x2, 0xc42051ea60, 0x16, 0x0, 0x0, 0xc4201c96b0, 0x0, ...)
        /home/find/go/src/github.com/schollz/find3/server/main/src/database/db.go:267 +0x32a
github.com/schollz/find3/server/main/src/api.SaveSensorData(0x162d823390e, 0xc420cad378, 0x2, 0xc42051ea60, 0x16, 0x0, 0x0, 0xc4201c96b0, 0x0, 0x0, ...)
        /home/find/go/src/github.com/schollz/find3/server/main/src/api/fingerprints.go:35 +0xdd
github.com/schollz/find3/server/main/src/server.processSensorData(0x162d823390e, 0xc420cad378, 0x2, 0xc42051ea60, 0x16, 0x0, 0x0, 0xc4201c96b0, 0x0, 0x0, ...)
        /home/find/go/src/github.com/schollz/find3/server/main/src/server/server.go:923 +0x60
github.com/schollz/find3/server/main/src/server.parseRollingData(0xc420cad378, 0x2, 0x0, 0x0)
        /home/find/go/src/github.com/schollz/find3/server/main/src/server/server.go:888 +0x7e1
created by github.com/schollz/find3/server/main/src/server.handlerReverse.func1
        /home/find/go/src/github.com/schollz/find3/server/main/src/server/server.go:813 +0x59a
schollz commented 6 years ago

Can you share your database with me? The locked database should never happen and I bet that is causing the problem.

schollz commented 6 years ago

Closed until I receive more information

hit0ri commented 6 years ago

Unfortunately I'n not allowed to share the database with MACs unless there is a way to anonymize them.

schollz commented 6 years ago

@hit0ri I understand.