komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.96k stars 284 forks source link

fail import from Nominatim 4.1 #781

Closed YaroslavGoryachkoBY closed 9 months ago

YaroslavGoryachkoBY commented 9 months ago

Data import from Nominatim 4.1 (and above) fails with an error: Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT place_id, osm_type, osm_id, class, type, name, postcode, address, extratags, ST_Envelope(geometry) AS bbox, parent_place_id, linked_place_id, rank_address, rank_search, importance, country_code, centroid FROM placex WHERE linked_place_id IS NULL AND centroid IS NOT NULL ORDER BY geometry_sector, parent_place_id; ]; SQL state [XX001]; error code [0]; ERROR: missing chunk number 0 for toast value 78034 in pg_toast_58949; nested exception is org.postgresql.util.PSQLException: ERROR: missing chunk number 0 for toast value 78034 in pg_toast_58949 at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1578) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:398) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:468) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:473) at de.komoot.photon.nominatim.NominatimConnector.readEntireDatabase(NominatimConnector.java:268) at de.komoot.photon.App.startNominatimImport(App.java:122) at de.komoot.photon.App.main(App.java:39) Caused by: org.postgresql.util.PSQLException: ERROR: missing chunk number 0 for toast value 78034 in pg_toast_58949 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2712) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2400) at org.postgresql.core.v3.QueryExecutorImpl.fetch(QueryExecutorImpl.java:2597) at org.postgresql.jdbc.PgResultSet.next(PgResultSet.java:2237) at org.apache.commons.dbcp2.DelegatingResultSet.next(DelegatingResultSet.java:1159) at org.apache.commons.dbcp2.DelegatingResultSet.next(DelegatingResultSet.java:1159) at org.springframework.jdbc.core.JdbcTemplate$RowCallbackHandlerResultSetExtractor.extractData(JdbcTemplate.java:1731) at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:456) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:383) ... 5 more

Photon version is 0.4.4
Data import from Nominatim 4.0 works properly (but there is sume problems with reverse geocoding). Is Nominatim versions higher than 4.0 supported?

otbutz commented 9 months ago
ERROR: missing chunk number 0 for toast value 78034 in pg_toast_58949

This looks like a corrupted database to be honest. I'd go the extra mile and check the hardware.