Opened 16 years ago

Last modified 2 years ago

#4093 closed enhancement

Parse 412 error messages from API and offer corrective action — at Version 4

Reported by: skyper Owned by: team
Priority: major Milestone:
Component: Core Version: latest
Keywords: 412 Cc: bilbo, planemad

Description (last modified by skyper)

I tried to upload (see attachment) and got an error-message:

org.openstreetmap.josm.io.OsmApiException: ResponseCode=412, Error Header=<Precondition failed: Way requires the nodes with id in (556645598), which either do not exist, or are not visible.>

isn`t there at least one ID missing.

I als do not know where this error comes from and thinks something with conflict-management is buggy

I attached 2 files (original + updated from server and conflict-management done)
and a log-file

Using /usr/lib/jvm/java-5-openjdk/bin/java to execute josm.
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2009-12-05 02:31:54
Last Changed Author: stoecker
Revision: 2574
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2009-12-04 19:11:45 +0100 (Fri, 04 Dec 2009)
Last Changed Rev: 2574

Error parsing gtk-icon-sizes string: ''
loading ColumbusCSV
loading buildings_tools
loading editgpx
loading osmarender
loading utilsplugin
loading validator
loading waydownloader
loading wmsplugin

.......

GET http://www.openstreetmap.org/api/0.6/nodes?nodes=27279987
PUT http://www.openstreetmap.org/api/0.6/changeset/3295058... OK
PUT http://www.openstreetmap.org/api/0.6/way/create... Precondition Failed
Error header: Precondition failed: Way  requires the nodes with id in (556645598), which either do not exist, or are not visible.
05.12.2009 14:47:00 org.openstreetmap.josm.actions.UploadAction handlePreconditionFailed
WARNUNG: Warnung: die Fehlermeldung 'Precondition failed: Way  requires the nodes with id in (556645598), which either do not exist, or are not visible.' stimmt nicht mit einem erwarteten Muster überein
org.openstreetmap.josm.io.OsmApiException: ResponseCode=412, Error Header=<Precondition failed: Way  requires the nodes with id in (556645598), which either do not exist, or are not visible.>
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:561)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:448)
	at org.openstreetmap.josm.io.OsmApi.createPrimitive(OsmApi.java:240)
	at org.openstreetmap.josm.io.OsmServerWriter.makeApiRequest(OsmServerWriter.java:222)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadChangesIndividually(OsmServerWriter.java:98)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:202)
	at org.openstreetmap.josm.actions.UploadAction$UploadPrimitivesTask.realRun(UploadAction.java:631)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:63)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:105)
	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)

Change History (5)

by skyper, 16 years ago

Attachment: merzhausen_bug.tar.bz2 added

2 osm + log

comment:1 by mjulius, 16 years ago

Resolution: invalid
Status: newclosed

That is the error message as it is returned by the API server. There is not much JOSM can do about this.

If you want to find the offending way you can search for "parent id:556645598".

in reply to:  1 comment:2 by Gubaer, 16 years ago

Resolution: invalid
Status: closedreopened
Type: defectenhancement

Replying to mjulius:

That is the error message as it is returned by the API server. There is not much JOSM can do about this.

Yes, there is.

As with other error messages from the API server JOSM can parse it and provide a more user friendly feedback, including translation. In most cases it can even offer options to automatically handle the errors (see conflict handling routines which are triggered by HTTP 409 instead of HTTP 412 as described here).

See also #2882.

comment:3 by mjulius, 16 years ago

Summary: missing id in error messageParse 412 error messages from API and offer corrective action

comment:4 by skyper, 14 years ago

Description: modified (diff)
Keywords: 412 added

inserted log from tar.bz2

Note: See TracTickets for help on using tickets.