Modify

Opened 11 months ago

Closed 3 weeks ago

#7845 closed defect (fixed)

reverter plugin broken

Reported by: malenki Owned by: Upliner
Priority: normal Component: Plugin reverter
Version: latest Keywords: template_report reverter plugin
Cc: toby.murray@…

Description

What steps will reproduce the problem?

  1. Run JOSM
  2. create new data layer
  3. press ctrl-shift-t
  4. enter a changeset number (I used 12188821)
  5. press [revert]

What is the expected result?
A changeset gets reverted

What happens instead?
Exception

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-07-11 01:31:04
Last Changed Author: simon04
Revision: 5318
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-07-10 22:53:52 +0200 (Tue, 10 Jul 2012)
Last Changed Rev: 5318

Identification: JOSM/1.5 (5318 de)
Memory Usage: 206 MB / 4711 MB (57 MB allocated, but free)
Java version: 1.6.0_33, Sun Microsystems Inc., Java HotSpot(TM) 64-Bit Server VM
Operating system: Linux
Dataset consistency test: No problems found

Plugin: FastDraw (28412)
Plugin: FixAddresses (28412)
Plugin: OpeningHoursEditor (28412)
Plugin: PicLayer (27883)
Plugin: buildings_tools (28412)
Plugin: contourmerge (1003)
Plugin: download_along (28412)
Plugin: editgpx (28412)
Plugin: ext_tools (28412)
Plugin: imageryadjust (28412)
Plugin: jts (28415)
Plugin: lakewalker (28412)
Plugin: licensechange (28412)
Plugin: mapdust (28412)
Plugin: measurement (28412)
Plugin: mirrored_download (28418)
Plugin: opendata (28441)
Plugin: openstreetbugs (28412)
Plugin: openvisible (28412)
Plugin: reltoolbox (28412)
Plugin: reverter (28412)
Plugin: tag2link (28412)
Plugin: tageditor (28412)
Plugin: terracer (28412)
Plugin: turnrestrictions (28412)
Plugin: undelete (28416)
Plugin: utilsplugin2 (28412)
Plugin: waydownloader (28412)
Plugin: wayselector (28412)

org.openstreetmap.josm.io.OsmTransferException: org.openstreetmap.josm.io.OsmDataParsingException: notwendiges Attribut "lat" fehlt (in Zeile 1.532, Spalte 134)
	at reverter.corehacks.OsmServerChangesetReader.downloadChangeset(OsmServerChangesetReader.java:197)
	at reverter.ChangesetReverter.<init>(ChangesetReverter.java:132)
	at reverter.RevertChangesetTask.realRun(RevertChangesetTask.java:59)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.openstreetmap.josm.io.OsmDataParsingException: notwendiges Attribut "lat" fehlt (in Zeile 1.532, Spalte 134)
	at reverter.corehacks.OsmChangesetContentParser$Parser.throwException(OsmChangesetContentParser.java:62)
	at reverter.corehacks.OsmChangesetContentParser$Parser.getMandatoryAttributeDouble(OsmChangesetContentParser.java:109)
	at reverter.corehacks.OsmChangesetContentParser$Parser.createPrimitive(OsmChangesetContentParser.java:158)
	at reverter.corehacks.OsmChangesetContentParser$Parser.startNode(OsmChangesetContentParser.java:177)
	at reverter.corehacks.OsmChangesetContentParser$Parser.startElement(OsmChangesetContentParser.java:214)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(Unknown Source)
	at reverter.corehacks.OsmChangesetContentParser.parse(OsmChangesetContentParser.java:311)
	at reverter.corehacks.OsmServerChangesetReader.downloadChangeset(OsmServerChangesetReader.java:192)
	... 10 mor

Attachments (3)

OsmChangesetContentParser.java (13.8 KB) - added by anonymous 10 months ago.
OsmDataParsingException.java (1.3 KB) - added by anonymous 10 months ago.
2012-08-12_110645_scr.jpg (104.0 KB) - added by malenki 9 months ago.
Empty error message while reverting changeset of redaction bot

Download all attachments as: .zip

Change History (30)

comment:1 Changed 11 months ago by anonymous

http://www.openstreetmap.org/api/0.6/changeset/12188821/download
-> missing lat/lon infos in delete node:

<delete>

<node id="19376053" changeset="12188821" user="Folken" uid="22471" visible="false" timestamp="2012-07-11T18:28:44Z" version="4"/>

</delete>

comment:3 Changed 11 months ago by anonymous

Error message in stack trace above: Mandatory attribute "lat" missing (in line 1.532, col 134)

comment:4 Changed 11 months ago by Cobra

fix: find the earliest modified version of each changed node in the changeset, fetch the one before (in case a node was moved, uploaded, deleted, uploaded in the same changeset).

comment:5 Changed 10 months ago by simon04

Ticket #7854 has been marked as a duplicate of this ticket.

comment:6 Changed 10 months ago by NE2

Because of this API change I can't revert this: http://www.openstreetmap.org/?lat=41.625&lon=-87.7686&zoom=14&layers=M

comment:7 Changed 10 months ago by rickmastfan67

  • Priority changed from major to blocker

Yes, this plugin needs to be fixed ASAP in my opinion.

comment:8 Changed 10 months ago by ToeBee

  • Cc toby.murray@… added

Yeah, this is kind of a big deal. I gave it a go and was able to fix the initial parsing of the changeset XML but then it still errored out later while retrieving the history of some nodes. In that case the NullPointerException came from somewhere within core instead of the plugin itself at which point I gave up for the night.

I did find out that the OsmChangesetContentParser class is copy/pasted from josm core except it has some uid parsing removed from it. Not sure what's up with that...

Changed 10 months ago by anonymous

Changed 10 months ago by anonymous

comment:9 Changed 10 months ago by anonymous

Added 2 file attachments for reverter/corehacks directory, which are just slightly adjusted copies of the corresponding core classes.
Tried this out in changeset #12440114. Handle with care, though, this might not work at all if multiple versions of a node occur in a changeset. Rgds, mmd

comment:10 Changed 10 months ago by Don-vip

  • Resolution set to fixed
  • Status changed from new to closed

I just fixed it in [o28503]. Looks like we had the same idea at the same time ;)

Last edited 10 months ago by Don-vip (previous) (diff)

comment:11 Changed 10 months ago by anonymous

CS 12246562 fails with an HTTP 403 error message, as one of the nodes has been redacted.

comment:12 Changed 10 months ago by malenki

  • Resolution fixed deleted
  • Status changed from closed to reopened

Confirm anonymous comment 11.
Besides: IMO the revert plugin should not try to revert changesets created by the redaction bot.
If a user tries this let it just give a message like: "I won't do that! And you know that I am right!" :)
(Maybe realise this with an easy logic like "if changeset created by Redaction Bot; do ...")

Last edited 9 months ago by skyper (previous) (diff)

comment:13 follow-up: Changed 10 months ago by NE2

I still get an error when trying to revert changeset 12131373.

comment:14 in reply to: ↑ 13 ; follow-up: Changed 10 months ago by Don-vip

Replying to NE2:

I still get an error when trying to revert changeset 12131373.

Can you please detail the error you have ? I need at least to know if it occurs in plugin or in JOSM core (the exact message and stacktrace are always welcome)

comment:15 in reply to: ↑ 14 ; follow-up: Changed 10 months ago by anonymous

Replying to Don-vip:

Replying to NE2:

I still get an error when trying to revert changeset 12131373.

Can you please detail the error you have ? I need at least to know if it occurs in plugin or in JOSM core (the exact message and stacktrace are always welcome)


JOSM message:

Autorisation at the OSM server failed. The server reported the following error: ""


Log message:

GET http://api.openstreetmap.org/api/0.6/changeset/12246562
GET http://api.openstreetmap.org/api/0.6/changeset/12246562/download
...
GET http://api.openstreetmap.org/api/0.6/node/364555053/3
org.openstreetmap.josm.io.OsmApiException: ResponseCode=403

at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:121)
at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:46)
at reverter.OsmServerMultiObjectReader.ReadObject(OsmServerMultiObjectReader.java:31)
at reverter.OsmServerMultiObjectReader.ReadObject(OsmServerMultiObjectReader.java:21)
at reverter.ChangesetReverter.downloadObjectsHistory(ChangesetReverter.java:176)
at reverter.RevertChangesetTask.realRun(RevertChangesetTask.java:77)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:145)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)


v3 of node 364555053 is hidden:
http://www.openstreetmap.org/browse/node/364555053/history

comment:16 in reply to: ↑ 15 ; follow-up: Changed 10 months ago by anonymous

Replying to anonymous:

v3 of node 364555053 is hidden:
http://www.openstreetmap.org/browse/node/364555053/history

No "OSMF Redaction Account" shown in the history.
How can that be?

comment:17 in reply to: ↑ 16 Changed 10 months ago by bastiK

Replying to anonymous:

Replying to anonymous:

v3 of node 364555053 is hidden:
http://www.openstreetmap.org/browse/node/364555053/history

No "OSMF Redaction Account" shown in the history.
How can that be?

Versions 1-2 are clean, then a non-agreer added some tags or moved the node. Finally user "Schulwegplaner" deleted the object (probably replacing it with a new node). So all that needs to be done by the redaction bot, in order to get a clean history, is hiding the "tainted" version 3.

comment:18 Changed 10 months ago by anonymous

I'm also getting an error when trying to revert 12582787. I don't know if it's the same problem.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-07-23 01:31:06
Last Changed Author: Don-vip
Revision: 5356
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-07-22 22:36:44 +0200 (Sun, 22 Jul 2012)
Last Changed Rev: 5356

Identification: JOSM/1.5 (5356 fr)
Memory Usage: 123 MB / 494 MB (71 MB allocated, but free)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) Client VM
Operating system: Windows XP
Dataset consistency test: No problems found

Plugin: cadastre-fr (28412)
Plugin: reverter (28503)
Plugin: utilsplugin2 (28523)

java.lang.IllegalStateException: Cible de fusion manquante pour le type nœud avec l’identifiant 840 675 084
	at reverter.DataSetCommandMerger.getMergeTarget(DataSetCommandMerger.java:47)
	at reverter.DataSetCommandMerger.mergeNode(DataSetCommandMerger.java:67)
	at reverter.DataSetCommandMerger.merge(DataSetCommandMerger.java:141)
	at reverter.DataSetCommandMerger.<init>(DataSetCommandMerger.java:41)
	at reverter.ChangesetReverter.getCommands(ChangesetReverter.java:279)
	at reverter.RevertChangesetTask.realRun(RevertChangesetTask.java:80)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

comment:19 Changed 10 months ago by Don-vip

I have made some changes in #7934 (r5408, r5409, r5410).

Can you tell me, guys, if you still have errors when trying to revert changesets with latest JOSM ? If so, do not forget to :

  • give the changeset number
  • attach the .osm file you have and screenshots if relevant
  • give the full stacktrace in an exception occurs.

Thanks.

Changed 9 months ago by malenki

Empty error message while reverting changeset of redaction bot

comment:20 Changed 9 months ago by malenki

  • Priority changed from blocker to normal

The initial mentioned changeset gets reverted fine now.

There is still an issue when boldly trying to revert a changeset created by the redaction bot. Josm gives an error message without error message (I tried it with changeset 12277671):

GET http://api.openstreetmap.org/api/0.6/relations?relations=898594
GET http://api.openstreetmap.org/api/0.6/node/609073968/2
org.openstreetmap.josm.io.OsmApiException: ResponseCode=403
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:121)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:46)
	at reverter.OsmServerMultiObjectReader.ReadObject(OsmServerMultiObjectReader.java:31)
	at reverter.OsmServerMultiObjectReader.ReadObject(OsmServerMultiObjectReader.java:21)
	at reverter.ChangesetReverter.downloadObjectsHistory(ChangesetReverter.java:171)
	at reverter.RevertChangesetTask.realRun(RevertChangesetTask.java:77)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

(see also screenshot)

Is there anything speaking against the handling of redaction bot changesets like this: If changeset created by redaction bot, then print message: "Won't revert changeset nr. XY since it was created due to the license change by Redaction Bot."?

comment:21 follow-up: Changed 9 months ago by NE2

  • Priority changed from normal to major

I still can't revert changeset 12131373.
An unexpected exception occurred that may have come from the 'reverter' plugin. According to the information within the plugin, the author is Upliner. Try updating to the newest version of this plugin before reporting a bug. Should the plugin be disabled?

comment:22 in reply to: ↑ 21 ; follow-up: Changed 9 months ago by malenki

  • Priority changed from major to normal

Replying to NE2:

I still can't revert changeset 12131373.
An unexpected exception occurred that may have come from the 'reverter' plugin.

"can't revert" and "may have come from" is not something which I'd call a valid bug report. See Don-vip's comment above.
Additionally I can't reproduce the unrevertability of changeset 12131373.

comment:23 Changed 9 months ago by rickmastfan67

I think I know why NE2 is still having problems. He's still using the "tested" version of JOSM per his recent uploads to OSM.

So, NE2, upgrade your copy to [5448], and you shouldn't have anymore problems. ;)

comment:24 in reply to: ↑ 22 Changed 9 months ago by NE2

Replying to malenki:

"can't revert" and "may have come from" is not something which I'd call a valid bug report. See Don-vip's comment above.

Buh? That's the bloody error message JOSM gives. However, since I'm using the tested version, I'll give the latest one a try when I get a chance.

comment:25 Changed 9 months ago by Cobra

I've recognised that you simply copy-pasted the error message. Usually there's a "report problem" button which gives all the information needed by the developers. Most of the time the stack trace is the important piece of information.

comment:26 Changed 9 months ago by NE2

Yeah, that seems to work, though I still get the "star" of nodes without coordinates.

New issue: how am I supposed to revert http://www.openstreetmap.org/browse/way/10670746/history to version 1? 2 and 3 are "redacted".

comment:27 Changed 3 weeks ago by Don-vip

  • Resolution set to fixed
  • Status changed from reopened to closed

Should be fixed in [o29553] (JOSM latest required).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.