It looks like your input file contains duplicate nodes. It is possible that multiple versions of the same node exist. This has come up a number of times on the mailing list.<br><br>Does anybody have the list of steps for fixing this handy?<br>
<br>Brett<br><br><div class="gmail_quote">On Fri, Oct 15, 2010 at 3:21 AM, Jose Cid <span dir="ltr"><<a href="mailto:doncid@gmail.com">doncid@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">
<font size="-1">Hello All,<br>
<br>
I've been trying to import osm files (bz2) into postGres DB using
osmosis (version 0.36 - built from svn). The command I used is the
following:<br>
<br>
./osmosis --read-xml-0.6 file="north_america.osm.bz2"
--write-apidb-0.6 populateCurrentTables=yes host="localhost"
database="openstreetmap" user="osm" password="osm1"
validateSchemaVersion=no<br>
<br>
The result being the following:<br>
<br>
SEVERE: Thread for task 1-read-xml-0.6 failed<br>
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to
bulk insert nodes into the database.<br>
at
org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushNodes(ApidbWriter.java:577)<br>
at
org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1108)<br>
at
org.openstreetmap.osmosis.core.container.v0_6.NodeContainer.process(NodeContainer.java:58)<br>
at
org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1082)<br>
at
org.openstreetmap.osmosis.xml.v0_6.impl.NodeElementProcessor.end(NodeElementProcessor.java:117)<br>
at
org.openstreetmap.osmosis.xml.v0_6.impl.OsmHandler.endElement(OsmHandler.java:107)<br>
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)<br>
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)<br>
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)<br>
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)<br>
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)<br>
at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)<br>
at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)<br>
at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)<br>
at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)<br>
at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)<br>
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown
Source)<br>
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)<br>
at
org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:108)<br>
at java.lang.Thread.run(Thread.java:636)<br>
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key
value violates unique constraint "nodes_pkey"<br>
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)<br>
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)<br>
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)<br>
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)<br>
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)<br>
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:321)<br>
at
org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushNodes(ApidbWriter.java:575)<br>
... 19 more<br>
Oct 14, 2010 12:14:21 PM org.openstreetmap.osmosis.core.Osmosis
main<br>
SEVERE: Execution aborted.<br>
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or
more tasks failed.<br>
at
org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)<br>
at
org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)<br>
at
org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)<br>
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br>
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
at java.lang.reflect.Method.invoke(Method.java:616)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)<br>
at
org.codehaus.classworlds.Launcher.main(Launcher.java:31)<br>
<br>
This has been the case for several other OSM files that I
attempted to import.<br>
<br>
Has anyone run into the above issue? Any solutions?<br>
<br>
</font>
</div>
<br>_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/dev" target="_blank">http://lists.openstreetmap.org/listinfo/dev</a><br>
<br></blockquote></div><br>