Hi,

   I have recently had osmosis in --rri mode refuse to apply an update
it had downloaded from OSM, claiming there was an UTF8 error in the
file. I looked and looked but the file was fine, passed UTF8 and XML
validity checks.

I tried to isolate the line that gave me the "error" but isolating it
made the problem go away. Only including the 583379 previous lines makes
the error occur.

So I now have two .osc files, one with 583380 lines and one with 583379
lines:

$ wc -l x.osc y.osc
   583380 x.osc
   583379 y.osc

their only difference is one line at the beginning of the longer file:

$ diff x.osc y.osc
2d1
<     <node id="4585086821" version="1" timestamp="2017-01-02T09:18:33Z"
uid="72020" user="Petr1868" changeset="44840247" lat="49.9957035"
lon="14.2460943"/>

But the longer one fails to process in osmosis, and the shorter one works:

$ osmosis --read-xml-change x.osc --write-null-change
Jan 11, 2017 10:19:41 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.43.1
...
SEVERE: Thread for task 1-read-xml-change failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to parse
xml file x.osc.  publicId=(null), systemId=(null), lineNumber=583379,
columnNumber=90.
        at
org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader.run(XmlChangeReader.java:114)

$ osmosis --read-xml-change y.osc --write-null-change
Jan 11, 2017 10:20:34 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.43.1
...
Jan 11, 2017 10:20:35 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Total execution time: 1448 milliseconds.

Since the line which supposedly contains the "error" is identical in
both files, it can't really be an error (and the line does not contain
any non-ASCII characters).

Re-formatting the XML file with "xmlstarlet fo" or "xmlstarlet c14n"
makes the problem go away.

I've reproduced this bug on different machines with different Osmosis
versions. I've tried these java versions with identical results:

$ java -showversion
java version "1.7.0_121"
OpenJDK Runtime Environment (IcedTea 2.6.8) (7u121-2.6.8-1ubuntu0.14.04.1)

$ java -showversion
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

I have uploaded the two .osc files here:

http://www.remote.org/frederik/tmp/osmosis-bug-try-read-xml-change-write-null-change-on-these-files-which-differ-only-by-one-line.zip

I'd be interested in any insights anyone has to share.

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frede...@remote.org  ##  N49°00'09" E008°23'33"

_______________________________________________
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osmosis-dev

Reply via email to