Modify

Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#483 closed defect (fixed)

Precondition failed after fixing intersected ways

Reported by: andy@… Owned by: framm
Priority: minor Component: Core
Version: latest Keywords:
Cc:

Description

I fixed some validator errors and warnings:

  • double nodes
  • intersected ways

When I tried to upload the data, the upload aborts with an exception saying "Precondition failed".
I tried to find and fix the way by splitting it into parts until I found the bad part. The last part was a node and a way with just this node. Both of them where deleted.

Maybe this is related with #177 (and maybe #237 too)

upload to: http://www.openstreetmap.org/api/0.5/node/104050921
got return: 412 with id 104050921
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.5' generator='JOSM'>
  <node id='104050921' timestamp='2007-11-09T13:53:26+00:00' user='bobo11' visible='true' lat='47.6054856' lon='8.4947361' />
</osm>

java.lang.RuntimeException: 412 Precondition Failed
        at org.openstreetmap.josm.io.OsmServerWriter.sendRequest(OsmServerWriter.java:192)
        at org.openstreetmap.josm.io.OsmServerWriter.visit(OsmServerWriter.java:90)
        at org.openstreetmap.josm.data.osm.Node.visit(Node.java:41)
        at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:73)
        at org.openstreetmap.josm.actions.UploadAction$2.realRun(UploadAction.java:151)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:84)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
org.xml.sax.SAXException: An error occoured: 412 Precondition Failed
        at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:78)
        at org.openstreetmap.josm.actions.UploadAction$2.realRun(UploadAction.java:151)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:84)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by andy@…

Maybe it's because of the way with only a single node. This time I've had the same error when I fixed an empty way without any nodes (with validator plugin):

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.5' generator='JOSM'>
</osm>

java.lang.RuntimeException: 412 Precondition Failed
        at org.openstreetmap.josm.io.OsmServerWriter.sendRequest(OsmServerWriter.java:192)
        at org.openstreetmap.josm.io.OsmServerWriter.visit(OsmServerWriter.java:105)
        at org.openstreetmap.josm.data.osm.Way.visit(Way.java:23)
        at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:73)
        at org.openstreetmap.josm.actions.UploadAction$2.realRun(UploadAction.java:151)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:84)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
org.xml.sax.SAXException: An error occoured: 412 Precondition Failed
        at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:78)
        at org.openstreetmap.josm.actions.UploadAction$2.realRun(UploadAction.java:151)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:84)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)

comment:2 Changed 6 years ago by andy@…

It seems to occure only when fixing 0-node ways with validator plugin.

comment:3 follow-up: Changed 6 years ago by Gabriel Ebner <ge@…>

Generally speaking, you get an 412 error when you want to delete something that is still used by something else, e.g. you download a bounding box, and then remove some of the superfluous nodes in a way, but don't realize that these were actually intersections because the server doesn't return ways outside the bounding box you requested.

Now, when you're fixing duplicate nodes, exactly that might happen.

As for the 0-node ways: Until now, the validator plugin would show incomplete ways that are referenced by relations, but not returned by the server, as errors.

comment:4 in reply to: ↑ 3 Changed 6 years ago by anonymous

Replying to Gabriel Ebner <ge@gabrielebner.at>:

Generally speaking, you get an 412 error when you want to delete something that is still used by something else, e.g. you download a bounding box, and then remove some of the superfluous nodes in a way, but don't realize that these were actually intersections because the server doesn't return ways outside the bounding box you requested.

Ok, that makes sense.

Now, when you're fixing duplicate nodes, exactly that might happen.

As for the 0-node ways: Until now, the validator plugin would show incomplete ways that are referenced by relations, but not returned by the server, as errors.

Good to know. It then seems not to be a bug (at least not a JOSM bug, more a validator issue).

comment:5 Changed 5 years ago by anonymous

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

Should be fixed in newer versions. Reopen report, when still existing.

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.