Modify

Opened 16 years ago

Closed 17 months ago

#4093 closed enhancement (fixed)

Parse 412 error messages from API and offer corrective action

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 also 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)

Attachments (1)

merzhausen_bug.tar.bz2 (211.5 KB ) - added by skyper 16 years ago.
2 osm + log

Download all attachments as: .zip

Change History (13)

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

comment:5 by skyper, 14 years ago

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

comment:6 by skyper, 14 years ago

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

comment:7 by skyper, 14 years ago

Cc: bilbo added
Priority: normalmajor

comment:8 by planemad, 13 years ago

Cc: planemad added

comment:9 by Don-vip, 13 years ago

In [4691/josm]:

see #4093 - More user-friendly error message with failed precondition (HTTP 412) related to nodes still used by ways

comment:10 by simon04, 13 years ago

Resolution: fixed
Status: reopenedclosed

In [4816/josm]:

fix #7257, fix #4093 - Provide an option to automatically download elements after a reference error

comment:11 by gpspilot, 17 months ago

Resolution: fixed
Status: closedreopened

This ticket should not have been closed. In 2024 I am getting the same exact error message described in this ticket opened 14 years ago:

Errors occurred while trying to save
Precondition failed: Way -63 requires the nodes with id in 11365414266,11365414267,11365414268,11365430969,11365430970,11365430971,11365430972,11365430973,11365430974,11365430975,11365430976,11365430995,11367299006,11367299007, which either do not exist, or are not visible.

This occurred when I was trying to save after a very productive editing session. Does anyone have advice about how not to lose all of the edits I made?

Thanks

comment:12 by skyper, 17 months ago

Description: modified (diff)
Resolution: fixed
Status: reopenedclosed

@gpspilot:
You problem does rather sounds similar to #23164, #23314 and similar recent tickets. We suspect a plugin to be the issue. Please create a new ticket with your status report and what actions of plugins you used during the session.
You should be able to save your data layer to a file. Please attach it to the new ticket.

In order to rescue your work you can try to download the missing nodes with Download Object using "nodes" and the list of ids of the non-existing or invisible nodes. If this does not work you need to modify the saved file in a text editor and look for <way id='-63' and possible <member type='way' ref='-63'. If the latter does not exist you can safely delete the way in deleting the block of lines starting with <way id='-63' and ending with </way>.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.