Ticket #3443 (closed defect: fixed)
Illegal value for attribute 'version' when loading OSM file
| Reported by: | markb@… | Owned by: | team |
|---|---|---|---|
| Priority: | blocker | Component: | Core |
| Version: | latest | Keywords: | |
| Cc: | teemu.koskinen@… |
Description
Today, having updated my josm to 2084 from 2066, I tried to load an osm file that I had saved yesterday. It failed with:
org.openstreetmap.josm.io.IllegalDataException: Illegal value for attribute 'version' on OSM primitive with id -1. Got 0 (at line 3, column 143)
at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:580) at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:41) at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:33) at org.openstreetmap.josm.actions.OpenFileAction.openFile(OpenFileAction.java:57) at org.openstreetmap.josm.Main.downloadFromParamString(Main.java:537) at org.openstreetmap.josm.Main.postConstructorProcessCmdLine(Main.java:388) at org.openstreetmap.josm.gui.MainApplication$2.run(MainApplication.java:163) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Attachments
Change History
comment:2 Changed 2 years ago by markb@…
- Status changed from closed to reopened
- Resolution fixed deleted
Hmm, not fixed here as you can see - BTW this is a 0.5 API file and all the elements appear to have version 0 - don't know when that version info was put into file.
Revision: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7.0 Created-By: 14.0-b16 (Sun Microsystems Inc.) Main-class: JOSM Main-Version: 2088 SVN Main-Date: 2009-09-09T17:38:48.279227Z loading colorscheme loading graphview loading measurement loading utilsplugin loading wmsplugin org.openstreetmap.josm.io.IllegalDataException: Illegal value for attribute 'version' on OSM primitive with id 84532064. Got 0 (at line 7, column 138)
at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:583) at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:41) at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:33) at org.openstreetmap.josm.actions.OpenFileAction.openFile(OpenFileAction.java:57) at org.openstreetmap.josm.Main.downloadFromParamString(Main.java:537) at org.openstreetmap.josm.Main.postConstructorProcessCmdLine(Main.java:388) at org.openstreetmap.josm.gui.MainApplication$2.run(MainApplication.java:162) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
comment:4 Changed 2 years ago by Gubaer
- Status changed from reopened to closed
- Resolution set to fixed
Reading 0.5 files with primitive versions set to 0 (event for primitives with id >0 which now always have a version >=1) supported again. Version 0 will not be preserved. On the next save the primitive will have version 1.
comment:5 Changed 2 years ago by vsandre
- Status changed from closed to reopened
- Resolution fixed deleted
- Summary changed from Illegal value for attribute 'version' when loading OSM file to [Patch] Illegal value for attribute 'version' when loading OSM file
Don't work for me with 2300. Please check the added patch.
comment:6 Changed 2 years ago by Gubaer
We shouldn't apply this patch. We don't allow version 0 on OsmPrimitives with an id > 0.
Could you please post an example file? I'll try to provide a fix in the IO subsystem, not in the core data package.
comment:7 Changed 2 years ago by Gubaer
- Status changed from reopened to closed
- Resolution set to fixed
comment:8 Changed 2 years ago by Daeron
- Cc teemu.koskinen@… added
- Status changed from closed to reopened
- Resolution fixed deleted
- Summary changed from [Patch] Illegal value for attribute 'version' when loading OSM file to Illegal value for attribute 'version' when loading OSM file
Josm doesn't save version for objects that are new, thus it is now impossible to open files which contain new objects.
comment:9 Changed 2 years ago by Gubaer
- Status changed from reopened to closed
- Resolution set to fixed
comment:10 Changed 2 years ago by anonymous
Works great :-)




(In [2086]) fixed #3443: Illegal value for attribute 'version' when loading OSM file