osm-fr / osmose-backend

Part of osmose that runs the analysis, and send the results to the frontend.
GNU General Public License v3.0
93 stars 114 forks source link

analyser_osmosis_highway_deadend : UndefinedTable: relation "highway_ends" does not exist #1559

Closed frodrigo closed 2 years ago

frodrigo commented 2 years ago

All analysers failling with https://buildbot.osmose.openstreetmap.fr/#/builders/572/builds/673/steps/1/logs/stdio

2022-09-14 04:00:14   analyser_osmosis_highway_deadend.py:284 xml generation
2022-09-14 04:00:14   error: sql=
SELECT
  drivethroughs.id,
  nid,
  ST_AsText(nodes.geom)
FROM
  highways AS drivethroughs
  JOIN highway_ends ON
    drivethroughs.linestring && highway_ends.geom AND
    highway_ends.nid = ANY(drivethroughs.nodes)
  LEFT JOIN highways AS other_highways ON
    other_highways.linestring && highway_ends.geom AND
    highway_ends.nid = ANY(other_highways.nodes) AND
    other_highways.id != drivethroughs.id
  JOIN nodes ON
    nodes.id = highway_ends.nid AND
    (NOT nodes.tags?'highway' OR (
      nodes.tags->'highway' != 'turning_circle' AND
      nodes.tags->'highway' != 'turning_loop' AND
      nodes.tags->'highway' != 'mini_roundabout'
    )) AND
    (NOT nodes.tags?'entrance' OR nodes.tags->'entrance' = 'no') -- i.e. indoor part not drawn
WHERE
  drivethroughs.highway = 'service' AND
  drivethroughs.tags?'service' AND
  drivethroughs.tags->'service' = 'drive-through' AND
  NOT drivethroughs.is_oneway AND
  other_highways.id IS NULL
2022-09-14 04:00:14   error: error on analyse osmosis_highway_deadend...
2022-09-14 04:00:14     Traceback (most recent call last):
2022-09-14 04:00:14       File "/data/project/osmose/backend/./osmose_run.py", line 253, in execc
2022-09-14 04:00:14         analyser_obj.analyser_resume(remote_timestamp, already_issued_objects)
2022-09-14 04:00:14       File "/data/project/osmose/backend/analysers/Analyser_Osmosis.py", line 245, in analyser_resume
2022-09-14 04:00:14         self.analyser_change()
2022-09-14 04:00:14       File "/data/project/osmose/backend/analysers/Analyser_Osmosis.py", line 215, in analyser_change
2022-09-14 04:00:14         self.analyser_osmosis_common()
2022-09-14 04:00:14       File "/data/project/osmose/backend/analysers/analyser_osmosis_highway_deadend.py", line 284, in analyser_osmosis_common
2022-09-14 04:00:14         self.run(sql40, lambda res: {"class":5, "data":[self.way_full, self.node, self.positionAsText]})
2022-09-14 04:00:14       File "/data/project/osmose/backend/analysers/Analyser_Osmosis.py", line 480, in run
2022-09-14 04:00:14         self.run00(sql, callback_package)
2022-09-14 04:00:14       File "/data/project/osmose/backend/analysers/Analyser_Osmosis.py", line 432, in run00
2022-09-14 04:00:14         self.giscurs.execute(sql)
2022-09-14 04:00:14       File "/data/project/osmose/.local/lib/python3.9/site-packages/psycopg2/extras.py", line 146, in execute
2022-09-14 04:00:14         return super().execute(query, vars)
2022-09-14 04:00:14     psycopg2.errors.UndefinedTable: relation "highway_ends" does not exist
2022-09-14 04:00:14     LINE 8:   JOIN highway_ends ON

cc @Famlam

Famlam commented 2 years ago

Ow shit, I guess this happens when the analyser runs in diff mode? Because it seems the results produced so far work neatly? (And also debugging goes well)

I think I forgot to include highway_ends in requires_tables_common, and it probably worked because I only tested it in "full" mode.

Famlam commented 2 years ago

1560 is untested, I'm at work until late in the evening. May I please ask you if you could test it's fixed with that?

Also, I apologize for (again) breaking an analyser, sorry for the disturbance...

Famlam commented 2 years ago

Meanwhile tested #1560, seems to work fine (but not sure if I tested diff mode properly)

frodrigo commented 2 years ago

Ok, Thank you.

Famlam commented 2 years ago

Seems it's now running fine in diff mode too:

2022-09-15 04:26:36   run osmosis base analyser Analyser_Osmosis_Highway_DeadEnd
2022-09-15 04:26:36   analyser_osmosis_highway_deadend.py:278 sql
2022-09-15 04:26:51   analyser_osmosis_highway_deadend.py:279 sql
2022-09-15 04:26:51   analyser_osmosis_highway_deadend.py:280 sql
2022-09-15 04:26:51   analyser_osmosis_highway_deadend.py:281 sql
2022-09-15 04:27:13   analyser_osmosis_highway_deadend.py:282 sql
2022-09-15 04:27:26   analyser_osmosis_highway_deadend.py:283 xml generation
2022-09-15 04:27:28   analyser_osmosis_highway_deadend.py:284 xml generation
2022-09-15 04:28:20   run osmosis change analyser Analyser_Osmosis_Highway_DeadEnd
2022-09-15 04:28:20   requires table touched_highway_ends
2022-09-15 04:28:20   analyser_osmosis_highway_deadend.py:290 xml generation
2022-09-15 04:28:22   update
2022-09-15 04:28:22     iteration=1
2022-09-15 04:28:23     OK

The remaining errors are from merge_milestone_FR_metropole in the builds of France, but I assume you're already aware of those

2022-09-15 13:25:49   error: error on analyse merge_milestone_FR_metropole...
2022-09-15 13:25:49     Traceback (most recent call last):
2022-09-15 13:25:49       File "/data/project/osmose/backend/./osmose_run.py", line 263, in execc
2022-09-15 13:25:49         analyser_obj.analyser()
2022-09-15 13:25:49       File "/data/project/osmose/backend/analysers/Analyser_Osmosis.py", line 193, in analyser
2022-09-15 13:25:49         self.analyser_osmosis_common()
2022-09-15 13:25:49       File "/data/project/osmose/backend/analysers/Analyser_Merge.py", line 1369, in analyser_osmosis_common
2022-09-15 13:25:49         table = super().analyser_osmosis_common()
2022-09-15 13:25:49       File "/data/project/osmose/backend/analysers/Analyser_Merge.py", line 1213, in analyser_osmosis_common
2022-09-15 13:25:49         table = self.load.run(self, self.conflate, self.config.db_user, self.__class__.__name__.lower()[15:], self.analyser_version())
2022-09-15 13:25:49       File "/data/project/osmose/backend/analysers/Analyser_Merge.py", line 974, in run
2022-09-15 13:25:49         return super().run(osmosis, conflate, db_schema, default_table_base_name, version)
2022-09-15 13:25:49       File "/data/project/osmose/backend/analysers/Analyser_Merge.py", line 827, in run
2022-09-15 13:25:49         self.parser.import_(table, osmosis)
2022-09-15 13:25:49     TypeError: import_() missing 1 required positional argument: 'osmosis'