mozilla / ichnaea

Mozilla Ichnaea
http://location.services.mozilla.com
Apache License 2.0
574 stars 139 forks source link

Mysql does not have any data. #1019

Closed HansonYip closed 4 years ago

HansonYip commented 4 years ago

Hi everyone. I bootstrap the service as follow:

make build
make runservices
make setup
make runcelery
make run

And I found that there were several dockers running.

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                NAMES
7fbebdccebfa        local/ichnaea_app   "/app/docker/app_ent…"   45 minutes ago      Up 45 minutes       0.0.0.0:8000->8000/tcp               ichnaea_web_1
cdafbe5c3905        local/ichnaea_app   "/app/docker/app_ent…"   45 minutes ago      Up 45 minutes       8000/tcp                             ichnaea_scheduler_1
6b9f53428524        local/ichnaea_app   "/app/docker/app_ent…"   45 minutes ago      Up 45 minutes       8000/tcp                             ichnaea_worker_1
0818cfffac16        redis:3.2           "docker-entrypoint.s…"   About an hour ago   Up About an hour    0.0.0.0:6379->6379/tcp               ichnaea_redis_1
9e1f9d1b2ba9        ichnaea_mysql       "docker-entrypoint.s…"   About an hour ago   Up About an hour    33060/tcp, 0.0.0.0:32768->3306/tcp   ichnaea_mysql_1

It seems that the service should work. But I tried to use TowerCollector to collect about 20 observations and uploaded to my own service. Statistics page shows there is no data at all. In fact, all observations were uploaded successfully.

redis:6379> lrange queue_export_internal 0 10
 1) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432203998, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 114762518, \"asu\": 60, \"serving\": 1, \"signalStrength\": -80, \"primaryScramblingCode\": 100}], \"position\": {\"latitude\": 23.12038497, \"longitude\": 113.32302167, \"accuracy\": 21.45, \"altitude\": 147.59, \"heading\": 146.7, \"speed\": 0.17}}}"
 2) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432251954, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 114762518, \"asu\": 59, \"serving\": 1, \"signalStrength\": -81, \"timingAdvance\": 0, \"primaryScramblingCode\": 100}], \"position\": {\"latitude\": 23.12032537, \"longitude\": 113.32229545, \"accuracy\": 23.99, \"altitude\": -63.88, \"heading\": 174.8, \"speed\": 0.65}}}"
 3) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432311372, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100949556, \"asu\": 50, \"serving\": 1, \"signalStrength\": -90, \"timingAdvance\": 2, \"primaryScramblingCode\": 241}], \"position\": {\"latitude\": 23.11971854, \"longitude\": 113.3221513, \"accuracy\": 20.37, \"altitude\": 27.76, \"heading\": 174.3, \"speed\": 0.99}}}"
 4) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432337456, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100949555, \"asu\": 60, \"serving\": 1, \"signalStrength\": -80, \"primaryScramblingCode\": 241}], \"position\": {\"latitude\": 23.11954719, \"longitude\": 113.32214119, \"accuracy\": 24.12, \"altitude\": 24.17, \"heading\": 174.7, \"speed\": 0.82}}}"
 5) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432381363, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100949555, \"asu\": 57, \"serving\": 1, \"signalStrength\": -83, \"timingAdvance\": 1, \"primaryScramblingCode\": 241}], \"position\": {\"latitude\": 23.11912037, \"longitude\": 113.32211472, \"accuracy\": 29.63, \"altitude\": 7.57, \"heading\": 197.1, \"speed\": 0.97}}}"
 6) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432408798, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100949556, \"asu\": 47, \"serving\": 1, \"signalStrength\": -93, \"primaryScramblingCode\": 241}], \"position\": {\"latitude\": 23.11891771, \"longitude\": 113.32203218, \"accuracy\": 36.64, \"altitude\": 31.13, \"heading\": 225.6, \"speed\": 1.21}}}"
 7) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432453615, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100949555, \"asu\": 40, \"serving\": 1, \"signalStrength\": -100, \"primaryScramblingCode\": 241}], \"position\": {\"latitude\": 23.11863453, \"longitude\": 113.3220064, \"accuracy\": 27.91, \"altitude\": 24.93, \"heading\": 280.3, \"speed\": 0.8}}}"
 8) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432481375, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100949555, \"asu\": 39, \"serving\": 1, \"signalStrength\": -101, \"primaryScramblingCode\": 241}], \"position\": {\"latitude\": 23.11867029, \"longitude\": 113.32154262, \"accuracy\": 28.55, \"altitude\": 23.9, \"heading\": 242.8, \"speed\": 0.88}}}"
 9) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432525649, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100801025, \"asu\": 48, \"serving\": 1, \"signalStrength\": -92, \"timingAdvance\": 5, \"primaryScramblingCode\": 317}], \"position\": {\"latitude\": 23.11864683, \"longitude\": 113.3214189, \"accuracy\": 14.83, \"altitude\": -2.21, \"heading\": 231.4, \"speed\": 0.79}}}"
10) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432529780, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100949555, \"asu\": 47, \"serving\": 1, \"signalStrength\": -93, \"timingAdvance\": 2, \"primaryScramblingCode\": 241}], \"position\": {\"latitude\": 23.11864683, \"longitude\": 113.3214189, \"accuracy\": 14.83, \"altitude\": -2.21, \"heading\": 231.4, \"speed\": 0.79}}}"
11) "{\"api_key\": \"2ca03da1-b77a-48e7-adb1-cab746f0025e\", \"report\": {\"timestamp\": 1577432533824, \"bluetoothBeacons\": [], \"wifiAccessPoints\": [], \"cellTowers\": [{\"radioType\": \"lte\", \"mobileCountryCode\": 460, \"mobileNetworkCode\": 1, \"locationAreaCode\": 9492, \"cellId\": 100801025, \"asu\": 51, \"serving\": 1, \"signalStrength\": -89, \"timingAdvance\": 5, \"primaryScramblingCode\": 317}], \"position\": {\"latitude\": 23.11856403, \"longitude\": 113.32132623, \"accuracy\": 17.09, \"altitude\": 1.54, \"heading\": 219.4, \"speed\": 0.71}}}"
willkg commented 4 years ago

The tasks don't run until there's enough stuff in the queue. If you look at the export_config table in mysql, it'll tell you what the batch size is for the "internal" export. You'll need to either lower that number or insert enough reports to exceed that number.

Hope that helps!

HansonYip commented 4 years ago

@willkg Thanks.