Opened 11 years ago

Closed 11 years ago

#718 closed defect (fixed)

500 on uploading relation with duplicate members

Reported by: robx Owned by: frederik@…
Priority: critical Milestone:
Component: api Version:
Keywords: Cc: Shaun McDonald

Description

JOSM allows creating relations with duplicate members (bug filed there). The upload to OSM fails with 500, which is supposedly an error in the server, hence my report.

Concretely, I created a route relation with a duplicate way of role="".

Change History (6)

comment:1 Changed 11 years ago by Tom Hughes

Owner: changed from Tom Hughes to frederik@…

comment:2 Changed 11 years ago by Thomas Wood

I came across this bug again last night, it also appears that the API adds a new blank relation on each 500 error encountered.

comment:3 Changed 11 years ago by Thomas Wood

Priority: majorcritical

comment:4 Changed 11 years ago by Shaun McDonald

Cc: Shaun McDonald added

The issue appears to be that an index is being violated, thus MySQL is rolling back.

Here is the last part of the trace in my local setup:

[2008-05-20 14:09:28.573877 #2105] RelationMember? Delete all (0.000437) DELETE FROM current_relation_members WHERE (id = 1) [2008-05-20 14:09:28.575965 #2105] RelationMember? Columns (0.001801) SHOW FIELDS FROM current_relation_members [2008-05-20 14:09:28.578431 #2105] RelationMember? Create (0.000323) INSERT INTO current_relation_members (member_type, member_id, id, member_role) VALUES('way', 6, 1, ) [2008-05-20 14:09:28.579880 #2105] RelationMember? Create (0.000000) Mysql::Error: Duplicate entry '1-way-6-' for key 1: INSERT INTO current_relation_members (member_type, member_id, id, member_role) VALUES('way', 6, 1, ) [2008-05-20 14:09:28.581210 #2105] SQL (0.000686) ROLLBACK [2008-05-20 14:09:28.581798 #2105] Completed in 0.24997 (4 reqs/sec) | Rendering: 0.00010 (0%) | DB: 0.13949 (55%) | 500 Internal Server Error http://localhost/api/0.5/relation/1

comment:5 Changed 11 years ago by Shaun McDonald

interestingly the log doesn't keep the port number in the log.

comment:6 Changed 11 years ago by Shaun McDonald

Resolution: fixed
Status: newclosed

(In [7869]) Add a check to make sure that a node/way/relation doesn't already exist in the relation as part of the preconditions. closes #718

Note: See TracTickets for help on using tickets.