1

I have been attempting to import a north-america-latest.osm.pbf (from Geofabrik) into a Postgres database for some time. After reviewing the wiki detailed usage page thoroughly, I set the database to include all necessary tables (pgSnapshot) via the included sql scripts. I also made sure that osmosis was functioning as intended by running a smaller file (Antarctica) through, and I got the results I expected. However, when I attempt to do the same process with the north america file, I get an error that is dissimilar to others that have been reported on the web. I am trying to get this data onto a server, uploads to my local seem to be fine.

Here's my code (via command prompt) :

C:\Users\eddie\Desktop>osmosis --read-pbf-fast north-america-latest.osm.pbf --log-progress interval=3000 --write-pgsql nodeLocationStoreType="TempFile" host=1*.8*.*.*0* database=osm postgresSchema=osm_updates user=eddie password=***

Here is the error message I get:

SEVERE: Thread for task 1-read-pbf-fast failed
org.springframework.dao.EmptyResultDataAccessException: Incorrect result 
size: expected 1, actual 0
at org.springframework.dao.support.DataAccessUtils.requiredSingleResult(DataAccessUtils.java:71)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:495)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:500)
at org.openstreetmap.osmosis.pgsnapshot.common.SchemaVersionValidator.validateDBVersion(SchemaVersionValidator.java:64)
at org.openstreetmap.osmosis.pgsnapshot.common.SchemaVersionValidator.validateVersion(SchemaVersionValidator.java:47)
at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.CopyFilesetLoader.run(CopyFilesetLoader.java:77)
at org.openstreetmap.osmosis.pgsnapshot.v0_6.PostgreSqlCopyWriter.complete(PostgreSqlCopyWriter.java:117)
at org.openstreetmap.osmosis.core.progress.v0_6.EntityProgressLogger.complete(EntityProgressLogger.java:82)
at org.openstreetmap.osmosis.pbf2.v0_6.PbfReader.run(PbfReader.java:96)
at java.lang.Thread.run(Unknown Source)

Jul 19, 2018 8:28:24 AM org.openstreetmap.osmosis.core.Osmosis main 
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

I am running osmosis .46, Postgres/PostGis 10/2.4 on Windows 10 with 12GB of RAM and 2 Intel 2.4GHz processors.

UPDATE: the error now occurs even when I run smaller files. Additionally, osmosis behaves as if it is processing a larger file (reaches node 4614331685 for Antarctica) as seen through the progress logger messages. An upload of OSM data for Canada to my local went through without any issues, so the problem probably has to do with the server I am trying to connect to. If anyone has any clues as to how to decipher the error message though, I'd like to hear them!

eddie
  • 11
  • 5
  • 1
    Also asked here: https://help.openstreetmap.org/questions/64808/how-to-interpret-this-java-error – scai Jul 20 '18 at 07:09
  • If you suspect that PostgreSQL may be involved in the problem, try to trace the SQL statements. – Laurenz Albe Jul 20 '18 at 07:37
  • @Laurenz PostgreSQL could very well be the problem, but I think the issue lies with osmosis since my DB on PostgreSQL is running fine and has never exhibited problems before. – eddie Jul 20 '18 at 14:55
  • Try turning off schema validation via the respective osmosis command line parameter. – mmd Jul 21 '18 at 08:31
  • Also, the file north-america-latest.osm.pbf doesn't contain metadata due to GDPR. Try to download and use the file from Geofabrik including metadata instead. – mmd Jul 22 '18 at 12:08
  • @mmd I am doing a run without the schema validation as we speak, I will update this comment once it finishes. Also, my north-america-latest.osm.pbf file is from Geofabrik (http://download.geofabrik.de/), so I am not sure what file type you are talking about specifically. – eddie Jul 31 '18 at 14:54
  • Did you read that notice at the top of the geofabrik download page w/ green background? If not, do so now before continuing. – mmd Jul 31 '18 at 16:33
  • @mmd Indeed I did. I am not particularly interested in "the user names, user IDs and changeset IDs of the OSM objects" as much as the objects themselves. Are you suggesting that the lack of metadata is what is causing osmosis to fail? Is there a practical advantage to importing that data – eddie Jul 31 '18 at 17:24

1 Answers1

0

I got osmosis to work by taking @mmd 's advice of turning off the schema validation. Even though I ran the pgsnapshot scripts and had been successful putting data there before, something about doing all of north america seemed to throw it off. I'll update this answer after subsequent database updates.

eddie
  • 11
  • 5