[josm-dev] BUG: 412 precondition failed

Igor Brejc igor.brejc at gmail.com
Fri Oct 12 21:39:56 BST 2007


Gabriel Ebner wrote:
> On Fri, Oct 12, 2007 at 07:45:43PM +0200, Igor Brejc wrote:
>   
>> I posted this on the JOSM wiki talk page and also added a TRAC ticket:
>>
>> I'm using the latest jar file (v368) . When I try to upload the changes, 
>> JOSM uploads updated and modified objects, but when it starts to send 
>> info to server about deleted objects I get the following message box: 
>> Error while parsing: An error occured: 412 precondition failed. This 
>> happens every time I try to upload the info about the deleted objects.
>> This was not happening to me in previous (API 0.4) versions of JOSM. 
>> Just to be sure, I loaded a much bigger area, so the data I tried to 
>> modify was not overlapping the loaded boundaries. Also, the data I'm 
>> modifying has been freshly downloaded from the server, so there were no 
>> conflicts with other users.
>> If, after this error occurs, I save the data to file, then restart the 
>> JOSM, load that file back into JOSM and try to upload the changes, the 
>> same changeset is being uploaded to the server and the same error 
>> occurs. I can send the example of the file.
>>     
>
> The server returns 412 Precondition Failed when you want to delete something
> that is still referenced, or create something that references something
> deleted, etc.
>
> Now say there are two nodes in the db:
>
>   <node id="1" lat="..." lon="..." visible="1"/>
>   <node id="2" lat="..." lon="..." visible="1"/>
>
> And you create a way connecting these nodes:
>
>   <way id="1" visible="1">
>     <nd ref="1"/>
>     <nd ref="2"/>
>   </way>
>
> But meanwhile someone runs the validator on that area, gets warnings about
> unconnected & untagged nodes, and decides to delete these nodes:
>
>   <node id="1" visible="0"/>
>   <node id="2" visible="0"/>
>
> If you upload your way then, the server will see that your new way points to
> deleted nodes and sends a 412 Precondition Failed back.
>
> Redownloading that area won't help as the server doesn't send deleted objects
> back, and so JOSM is unable to figure out that these nodes would need to be
> recreated.  (This is not a problem specific to 0.5, it happened to me in the
> days of 0.4.)
>
>   Gabriel.
>
>   
I read about this explanation before, but I'm sure that in my case it 
does not apply:
- first of all, I can reproduce this bug within 1 minute after 
downloading the fresh data from the server, so there is really a very 
small chance that someone else has changed  the same data
- the area which I'm working on is covered only by me, there aren't any 
other users which work on the same data (specifically outlining forest 
areas on 
http://www.openstreetmap.org/?lat=46.50886755953023&lon=15.590208653170441&zoom=13&layers=B0F).
- I worked on this area for at least one month before the 0.5 switch and 
never had any kind of a problem

As an additional info, which might or might not help in debugging: I'm 
trying to update areas which mistakenly had shared segments in the 0.4 
database and have now been converted into several separate ways sharing 
the same relation (multipolygon). I have to combine those ways into a 
single area and upload that to the OSM server and that's when this error 
occurs. I suspect it has something to do with relations feature, since I 
also saw other bugs reported by JOSM related to relations editing.

I'll try to create an exact instructions on how to reproduce this bug.

Breki




More information about the josm-dev mailing list