How are streets loaded into `cou_server.db`?
I'm attempting to debug my server installation. The first result of that was working through the weather issues, as seen in #11 (closed). However, the next error I'm debugging is the following:
[ERROR] [2021-08-26 06:21:22] [cou_server.endpoints.street_update] Could not load street GCR13KDF9MK1QJK
Traceback (most recent call last):
File "/code/ur-server/cou_server/endpoints/street_update.py", line 71, in load_street
street.street_name = street_name
AttributeError: 'NoneType' object has no attribute 'street_name'
Looking through the codebase, I see that I can fix this error pretty easily by adding GCR13KDF9MK1QJK
to cou_server.db
. But, when I dig a bit deeper, I can't find anywhere that streets actually get loaded into cou_server.db
. In mapdata.py
they seem to be added to memory, with (in my local environment) all 3180 found:
[DEBUG] [2021-08-26 06:23:33] [cou_server.endpoints.mapdata] [MapData] Created street lookup table with 3180 entries
So... how are streets added to cou_server.db
, in the streets table? Should mapdata.py
be adding all streets to the streets
table? There does not appear to be any code that would do that.
While I'm here, there are three interrelated questions:
- The streets table includes a
uid
column (created instreet.py
). Why? Isuid
used anywhere? I can't seem to find it used or referenced by the server or client. - What is the expected format of the
items
column in thestreets
table? I can "fill it" with the default[]
for testing purposes, but it would be nice to have items in my local environment. :) - How are other tables loaded? While I'm explicitly debugging the streets error, the only db table I can get loaded is
users
. (And... myusers
table is expectedly loaded with very minimal data as I'm not running my own authserver.)