I have done some edits in OSM via Potlatch and I've been saving them as usual, but I have found an error when saving the last changeset.

After saving, Potlatch warns: "A server error occurred. Do you want to retry? (The server said: Precondition failed: Cannot create way: data is invalid.)".How can I validate data so I can save it?

I haven't been able to copy the code here, but I've saved the output data in https://www.dropbox.com/s/4wrpjgoufw26nju/potlacht_error.txt

asked 13 Oct '13, 18:28

polkillas's gravatar image

polkillas
16111
accept rate: 0%

edited 14 Oct '13, 14:21

aseerel4c26's gravatar image

aseerel4c26 ♦
32.1k16239551

Did you use Potlatch version 2 or 1?

(14 Oct '13, 14:22) aseerel4c26 ♦

This is a pretty unusual error, although it can occur when your network is not very reliable or at times when the API server is stressed. It is possible to recover your work from the saved file, but it requires a fair bit of technical knowledge. I have done this once, so I'm a bit sketchy on the precise details for achieving a successful upload, so I have worked through your data because I think it is worth knowing how to do this.

Your file is in OSM Change Format (OSC) and can be saved as a valid XML document with a name like XXX.osc or XXX.osc.xml. This format is readable by the offline editor JOSM, although you may need to hand-edit bits of the file to be acceptable for JOSM (for instance by removing the changeset number to a placeholder value. (Search and replace changeset="999" with empty space.

One way is to remove various parts of the file (conflicts and invalid preconditions can only occur on pre-existing objects, so removing delete and modify statements may help). Basically using a divide and conquer strategy means that one can recover parts of your changes separately: even if you cannot recover them all you may get the bulk of them.

Once loaded into JOSM select File|Update Data. JOSM will update all objects in your file from the API database: it will probably report conflicts (in your case 25). Use the JOSM Conflict editor to resolve these conflicts & then upload your data.

Select each item shown in the conflict pane. Click "Resolve Conflict", each part of the object with a conflict is shown in a tab with a red button. On each (tags, nodes, members, etc.) click the button on the left which selects your version (not the server version) and then the "Apply Resolution" button. Do this until all conflicts are resolved.

I have done this with your file (I needed to step through to see what needed to be done), and I have made minor corrections to your Olive Trees (natural=tree and species=Olea europea).

Potlatch seems to have created an empty way (a way with 0 nodes) which was causing the problem.

<way id="-41" version="0" changeset="18336367">
  <tag k="species" v="olea europaea"/>
  <tag k="nature" v="tree"/>
</way>

I have uploaded your data (changeset http://www.openstreetmap.org/browse/changeset/18340844), please check that it as you expect.

permanent link

answered 13 Oct '13, 22:24

SK53's gravatar image

SK53 ♦
22.9k46233360
accept rate: 20%

edited 13 Oct '13, 22:25

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×236
×196
×100
×64
×2

question asked: 13 Oct '13, 18:28

question was seen: 5,230 times

last updated: 14 Oct '13, 14:22

powered by OSQA