Opened 8 years ago

Closed 8 years ago

#3884 closed defect (fixed)

Failure when uploading data

Reported by: DaveF Owned by: potlatch-dev@…
Priority: major Milestone:
Component: potlatch2 Version:
Keywords: Cc:

Description

This is an error message I'm getting: "An unexpected error occurred, probably due to a bug in Potlatch 2. Do you want to retry? (The server said: Precondition failed: Cannot create way: data is invalid.)"

The data is in the attached file. It looks correctly formatted to me.

Attachments (1)

osm tennis.xml (5.8 KB) - added by DaveF 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by DaveF

Attachment: osm tennis.xml added

comment:1 Changed 8 years ago by Richard

There's a zero-length way in the XML, which shouldn't have got in there. Any ideas how that might have happened? (it's usually something to do with undo...)

comment:2 in reply to:  1 Changed 8 years ago by DaveF

Replying to Richard:

There's a zero-length way in the XML, which shouldn't have got in there. Any ideas how that might have happened? (it's usually something to do with undo...)

Which nodes are those? I can't see any that are the same. I didn't start undoing until I got the error. I was using the parallel command on closed ways & placing them on top of each other to create near identical duplicates. Isn't there a way to ignore 0 lengths? Didn't P1 do that? There is a bot that cleans up duplicate points so they must be getting uploaded somehow.

comment:3 Changed 8 years ago by Richard

The line

<way id="-37" version="0" changeset="8628320"/>

is a way without any nodes in it.

In theory P2 could do a last-minute check before uploading, and remove them from the changeset before sending (that's roughly what P1 did), but that's not really fixing the problem - it shouldn't be creating 0-length ways internally in the first place. I'd like to find out what circumstances make it do so.

comment:4 in reply to:  3 ; Changed 8 years ago by DaveF

Replying to Richard:

The line

<way id="-37" version="0" changeset="8628320"/>

is a way without any nodes in it.

Oh, I see. That's not actually a way with zero length (ie two nodes with identical lat & lon,) but poorly constructed xml.

If P2 would of excepted it without that line then it must be better/easier (especially for the end user) if it did some verification. Leaving major errors like that will only discourage users from adding to OSM

comment:5 in reply to:  4 Changed 8 years ago by DaveF

Replying to DaveF:

If P2 would of excepted it without that line...

Oh dear; apologies for the poor spelling, That, of course, should have been 'accepted'.

comment:6 Changed 8 years ago by Oliver O'Brien

I think I've found a reproduceable method of getting nodeless ways, so leading to this error.

  1. Create a way.
  2. Press "P" to start creating a parallel way.
  3. Without moving the mouse (i.e. before the new-extent lines start to appear), click.

I often do something similar to this (although I move the mouse back and forth to insubstantiate the way properly) in order to create a "duplicate" identically-shaped object, e.g. blocks of houses. If I don't move the mouse, the problem occurs.

Below is the OSM.xml which got created when I did the above, and so causes the error to appear.

<osmChange version="0.6">

<create version="0.6">

<node id="-273" version="0" lat="51.54834434165515" lon="-0.010761521148681633" changeset="8959043"/> <node id="-275" version="0" lat="51.548631226668704" lon="-0.010214350509643545" changeset="8959043"/> <node id="-277" version="0" lat="51.54787731567057" lon="-0.010192892837524404" changeset="8959043"/> <node id="-276" version="0" lat="51.54819756257658" lon="-0.009602806854248035" changeset="8959043"/>

</create> <create version="0.6">

<way id="-274" version="0" changeset="8959043">

<nd ref="-273"/> <nd ref="-275"/> <nd ref="-276"/> <nd ref="-277"/> <nd ref="-273"/>

</way> <way id="-278" version="0" changeset="8959043"/>

</create>

</osmChange>

comment:7 Changed 8 years ago by Richard

Resolution: fixed
Status: newclosed

Ollie - thanks; have fixed that in https://github.com/systemed/potlatch2/commit/dd2f112b649327d34103f9d7bfba83cfb541c68a . Am closing this for now, but if anyone can find another way of creating 0-length ways then they can reopen it.

Note: See TracTickets for help on using tickets.