schollz / find3

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

Periodical error and when retrieving the locations data #154

Open msanzn opened 5 years ago

msanzn commented 5 years ago

I have the server installed in my computer and two raspberry monitoring passively the environment. I retrieve the data by the command line using the api commands as

http GET localhost:8005/api/v1/devices/p2
http GET localhost:8005/api/v1/locations/p2
http DELETE localhost:8005/api/v1/database/p2

When using the commands for device or database the behavior is normal, but when I want to retrieve the information from the locations of the whole family the the server crashes, with the error bellow, the thing is that the same command has been working the previous days and when trying to automate the retrieving of information were the error started to occur, even when I use the command line. I have not used go, reason I did not touch the code.

2019/04/04 17:13:56 [Recovery] 2019/04/04 - 17:13:56 panic recovered: interface conversion: interface {} is string, not []uint8 /usr/local/go/src/runtime/iface.go:248 (0x4149b5) panicdottypeE: panic(&TypeAssertionError{iface, have, want, ""}) /home/VICOMTECH/msanz/go/src/github.com/schollz/find3/server/main/src/database/db.go:1097 (0x81ba63) (Database).getRows: deviceID := string((arr[1].(interface{})).([]uint8)) /home/VICOMTECH/msanz/go/src/github.com/schollz/find3/server/main/src/database/db.go:1044 (0x81a97a) (Database).GetAllFromPreparedQuery: s, err = d.getRows(rows) /home/VICOMTECH/msanz/go/src/github.com/schollz/find3/server/main/src/database/db.go:641 (0x817329) (Database).GetLatest: sensors, err = d.GetAllFromPreparedQuery("SELECT FROM sensors WHERE deviceID=? ORDER BY timestamp DESC LIMIT 1", deviceID) /home/VICOMTECH/msanz/go/src/github.com/schollz/find3/server/main/src/server/server.go:643 (0xab9769) handlerApiV1Locations.func1: locations[i].Sensors, err = d.GetLatest(device) /home/VICOMTECH/msanz/go/src/github.com/schollz/find3/server/main/src/server/server.go:664 (0xaa924f) handlerApiV1Locations: }(c) /home/VICOMTECH/msanz/go/src/github.com/gin-gonic/gin/context.go:124 (0xa80779) (Context).Next: c.handlersc.index /home/VICOMTECH/msanz/go/src/github.com/gin-contrib/gzip/gzip.go:47 (0xa94795) Gzip.func2: c.Next() /home/VICOMTECH/msanz/go/src/github.com/gin-gonic/gin/context.go:124 (0xa80779) (Context).Next: c.handlersc.index /home/VICOMTECH/msanz/go/src/github.com/gin-gonic/gin/recovery.go:76 (0xa92319) RecoveryWithWriter.func1: c.Next() /home/VICOMTECH/msanz/go/src/github.com/gin-gonic/gin/context.go:124 (0xa80779) (Context).Next: c.handlersc.index /home/VICOMTECH/msanz/go/src/github.com/schollz/find3/server/main/src/server/server.go:1357 (0xabe246) middleWareHandler.func1: c.Next() /home/VICOMTECH/msanz/go/src/github.com/gin-gonic/gin/context.go:124 (0xa80779) (Context).Next: c.handlersc.index /home/VICOMTECH/msanz/go/src/github.com/gin-gonic/gin/gin.go:388 (0xa89d76) (Engine).handleHTTPRequest: c.Next() /home/VICOMTECH/msanz/go/src/github.com/gin-gonic/gin/gin.go:351 (0xa895c3) (Engine).ServeHTTP: engine.handleHTTPRequest(c) /usr/local/go/src/net/http/server.go:2774 (0x6fd4e7) serverHandler.ServeHTTP: handler.ServeHTTP(rw, req) /usr/local/go/src/net/http/server.go:1878 (0x6f90d0) (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req) /usr/local/go/src/runtime/asm_amd64.s:1337 (0x464f90) goexit: BYTE $0x90 // NOP

msanzn commented 5 years ago

I manage to solve the problem by uninstalling and installing all the server, including go, now the problem is that some of the analysis is not perform having the error

[PID-4661] analysis.go AnalyzeSensorData:222 unable to analyze: could not find '/home/VICOMTECH/msanz/prueba/src/github.com/schollz/find3/server/main/data/9YD.find3.ai'

It appears once every 10 passive scanning in the main server and when trying to retrieve the locations of all the devices in the family