Modify

Opened 12 years ago

Closed 11 years ago

#7845 closed defect (fixed)

reverter plugin broken

Reported by: malenki Owned by: Upliner
Priority: normal Milestone:
Component: Plugin reverter Version: latest
Keywords: template_report reverter plugin Cc: ToeBee

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 12 years ago.
OsmDataParsingException.java (1.3 KB ) - added by anonymous 12 years ago.
2012-08-12_110645_scr.jpg (104.0 KB ) - added by malenki 12 years ago.
Empty error message while reverting changeset of redaction bot

Download all attachments as: .zip

Change History (30)

comment:1 by anonymous, 12 years ago

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 by anonymous, 12 years ago

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

comment:4 by Cobra, 12 years ago

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 by simon04, 12 years ago

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

comment:7 by rickmastfan67, 12 years ago

Priority: majorblocker

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

comment:8 by ToeBee, 12 years ago

Cc: ToeBee 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...

by anonymous, 12 years ago

by anonymous, 12 years ago

comment:9 by anonymous, 12 years ago

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 by Don-vip, 12 years ago

Resolution: fixed
Status: newclosed

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

Version 0, edited 12 years ago by Don-vip (next)

comment:11 by anonymous, 12 years ago

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

comment:12 by malenki, 12 years ago

Resolution: fixed
Status: closedreopened

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 12 years ago by skyper (previous) (diff)

comment:13 by NE2, 12 years ago

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

in reply to:  13 ; comment:14 by Don-vip, 12 years ago

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)

in reply to:  14 ; comment:15 by anonymous, 12 years ago

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

in reply to:  15 ; comment:16 by anonymous, 12 years ago

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?

in reply to:  16 comment:17 by bastiK, 12 years ago

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 by anonymous, 12 years ago

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 by Don-vip, 12 years ago

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.

by malenki, 12 years ago

Attachment: 2012-08-12_110645_scr.jpg added

Empty error message while reverting changeset of redaction bot

comment:20 by malenki, 12 years ago

Priority: blockernormal

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 by NE2, 12 years ago

Priority: normalmajor

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?

in reply to:  21 ; comment:22 by malenki, 12 years ago

Priority: majornormal

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 by rickmastfan67, 12 years ago

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. ;)

in reply to:  22 comment:24 by NE2, 12 years ago

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 by Cobra, 12 years ago

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 by NE2, 12 years ago

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 by Don-vip, 11 years ago

Resolution: fixed
Status: reopenedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Upliner.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.