Opened 11 years ago

Closed 11 years ago

#771 closed defect (fixed)

Deleting ways with relations breaks (returns 500)

Reported by: Thomas Wood Owned by: richard@…
Priority: major Milestone:
Component: potlatch (flash editor) Version:
Keywords: Cc:

Description

Deleting a way with a relation on it causes a precondition failed error.

Steps to reproduce: # Create way # Add relation # Unselect # Select # Hit shift-delete # Red 'cannot save' alert pops up.

Traceback in development.log:

[2008-03-21 13:49:11.715037 #8720] Processing AmfController#talk (for 127.0.0.1 at 2008-03-21 13:49:11) [POST]
[2008-03-21 13:49:11.715671 #8720]   Parameters: {"action"=>"talk", "controller"=>"amf"}
[2008-03-21 13:49:11.733820 #8720]   Message: deleteway, id=23359330.0
[2008-03-21 13:49:11.864309 #8720]   [4;36;1mSQL (0.003976)[0m   [0;1mSHOW TABLES[0m
[2008-03-21 13:49:11.876055 #8720]   [4;35;1mUser Columns (0.008569)[0m   [0mSHOW FIELDS FROM `users`[0m
[2008-03-21 13:49:11.925237 #8720]   [4;36;1mUserToken Columns (0.005957)[0m   [0;1mSHOW FIELDS FROM `user_tokens`[0m
[2008-03-21 13:49:11.936847 #8720]   [4;35;1mUserToken Load Including Associations (0.004950)[0m   [0mSELECT `user_tokens`.`id` AS t0_r0, `user_tokens`.`user_id` AS t0_r1, `user_tokens`.`token` AS t0_r2, `user_tokens`.`expiry` AS t0_r3, `users`.`id` AS t1_r0, `users`.`email` AS t1_r1, `users`.`active` AS t1_r2, `users`.`pass_crypt` AS t1_r3, `users`.`creation_time` AS t1_r4, `users`.`display_name` AS t1_r5, `users`.`data_public` AS t1_r6, `users`.`description` AS t1_r7, `users`.`home_lat` AS t1_r8, `users`.`home_lon` AS t1_r9, `users`.`home_zoom` AS t1_r10, `users`.`nearby` AS t1_r11, `users`.`pass_salt` AS t1_r12, `users`.`image` AS t1_r13 FROM `user_tokens` LEFT OUTER JOIN `users` ON `users`.id = `user_tokens`.user_id WHERE (user_tokens.token = 'VfD0RRIjCgOfIYyIVzpAJNdDoR62EJ') [0m
[2008-03-21 13:49:11.977960 #8720]   [4;36;1mSQL (0.000702)[0m   [0;1mBEGIN[0m
[2008-03-21 13:49:11.986214 #8720]   [4;35;1mUserToken Update (0.002004)[0m   [0mUPDATE `user_tokens` SET `expiry` = '2008-03-28 13:49:11', `user_id` = 1, `token` = 'VfD0RRIjCgOfIYyIVzpAJNdDoR62EJ' WHERE `id` = 2[0m
[2008-03-21 13:49:11.990976 #8720]   [4;36;1mSQL (0.003193)[0m   [0;1mCOMMIT[0m
[2008-03-21 13:49:11.996723 #8720]   [4;35;1mUser Load (0.002018)[0m   [0mSELECT * FROM `users` WHERE (`users`.`id` = 1) [0m
[2008-03-21 13:49:12.129281 #8720]   [4;36;1mWay Columns (0.006049)[0m   [0;1mSHOW FIELDS FROM `current_ways`[0m
[2008-03-21 13:49:12.248869 #8720]   [4;35;1mWay Load (0.096028)[0m   [0mSELECT * FROM `current_ways` WHERE (`current_ways`.`id` = 23359330.0) [0m
[2008-03-21 13:49:12.626973 #8720]   [4;36;1mNode Columns (0.036378)[0m   [0;1mSHOW FIELDS FROM `current_nodes`[0m
[2008-03-21 13:49:12.725287 #8720]   [4;35;1mNode Load (0.093995)[0m   [0mSELECT current_nodes.* FROM current_nodes INNER JOIN current_way_nodes ON (current_nodes.id=current_way_nodes.node_id) WHERE ((current_way_nodes.id = 23359330)) ORDER BY sequence_id[0m
[2008-03-21 13:49:12.783659 #8720]   [4;36;1mWayNode Load (0.053200)[0m   [0;1mSELECT * FROM `current_way_nodes` WHERE (node_id in (253029652,253029653,253029654) and id != 23359330) [0m
[2008-03-21 13:49:12.788077 #8720]   [4;35;1mNode Load (0.001834)[0m   [0mSELECT * FROM `current_nodes` WHERE (`current_nodes`.`id` = 253029652) [0m
[2008-03-21 13:49:12.804024 #8720]   [4;36;1mSQL (0.000774)[0m   [0;1mBEGIN[0m
[2008-03-21 13:49:12.812584 #8720]   [4;35;1mSQL (0.003400)[0m   [0mSHOW TABLES[0m
[2008-03-21 13:49:13.053760 #8720]   [4;36;1mNode Update (0.031218)[0m   [0;1mUPDATE `current_nodes` SET `tags` = '', `latitude` = 513697100, `visible` = 0, `timestamp` = '2008-03-21 13:49:12', `user_id` = 1, `longitude` = -1600091, `tile` = 2062264412 WHERE `id` = 253029652[0m
[2008-03-21 13:49:13.503117 #8720]   [4;35;1mSQL (0.444724)[0m   [0mSHOW TABLES[0m
[2008-03-21 13:49:13.575150 #8720]   [4;36;1mOldNode Columns (0.026637)[0m   [0;1mSHOW FIELDS FROM `nodes`[0m
[2008-03-21 13:49:13.671589 #8720]   [4;35;1mOldNode Create (0.069492)[0m   [0mINSERT INTO `nodes` (`timestamp`, `visible`, `latitude`, `tags`, `tile`, `id`, `longitude`, `user_id`) VALUES('2008-03-21 13:49:12', 0, 513697100, '', 2062264412, 253029652, -1600091, 1)[0m
[2008-03-21 13:49:13.676984 #8720]   [4;36;1mSQL (0.003649)[0m   [0;1mCOMMIT[0m
[2008-03-21 13:49:13.681401 #8720]   [4;35;1mNode Load (0.001963)[0m   [0mSELECT * FROM `current_nodes` WHERE (`current_nodes`.`id` = 253029653) [0m
[2008-03-21 13:49:13.684276 #8720]   [4;36;1mSQL (0.000669)[0m   [0;1mBEGIN[0m
[2008-03-21 13:49:13.765800 #8720]   [4;35;1mNode Update (0.073919)[0m   [0mUPDATE `current_nodes` SET `tags` = '', `latitude` = 513692063, `visible` = 0, `timestamp` = '2008-03-21 13:49:13', `user_id` = 1, `longitude` = -1596830, `tile` = 2062264412 WHERE `id` = 253029653[0m
[2008-03-21 13:49:13.778146 #8720]   [4;36;1mOldNode Create (0.001551)[0m   [0;1mINSERT INTO `nodes` (`timestamp`, `visible`, `latitude`, `tags`, `tile`, `id`, `longitude`, `user_id`) VALUES('2008-03-21 13:49:13', 0, 513692063, '', 2062264412, 253029653, -1596830, 1)[0m
[2008-03-21 13:49:13.797220 #8720]   [4;35;1mSQL (0.017378)[0m   [0mCOMMIT[0m
[2008-03-21 13:49:13.801361 #8720]   [4;36;1mNode Load (0.001840)[0m   [0;1mSELECT * FROM `current_nodes` WHERE (`current_nodes`.`id` = 253029654) [0m
[2008-03-21 13:49:13.804369 #8720]   [4;35;1mSQL (0.000765)[0m   [0mBEGIN[0m
[2008-03-21 13:49:13.814083 #8720]   [4;36;1mNode Update (0.002110)[0m   [0;1mUPDATE `current_nodes` SET `tags` = '', `latitude` = 513694420, `visible` = 0, `timestamp` = '2008-03-21 13:49:13', `user_id` = 1, `longitude` = -1592624, `tile` = 2062264414 WHERE `id` = 253029654[0m
[2008-03-21 13:49:13.827924 #8720]   [4;35;1mOldNode Create (0.002529)[0m   [0mINSERT INTO `nodes` (`timestamp`, `visible`, `latitude`, `tags`, `tile`, `id`, `longitude`, `user_id`) VALUES('2008-03-21 13:49:13', 0, 513694420, '', 2062264414, 253029654, -1592624, 1)[0m
[2008-03-21 13:49:13.832933 #8720]   [4;36;1mSQL (0.003308)[0m   [0;1mCOMMIT[0m
[2008-03-21 13:49:13.844635 #8720]   [4;35;1mSQL (0.003293)[0m   [0mSHOW TABLES[0m
[2008-03-21 13:49:13.878144 #8720]   [4;36;1mRelationMember Load (0.003251)[0m   [0;1mSELECT `current_relation_members`.* FROM `current_relation_members` INNER JOIN current_relations ON current_relations.id=current_relation_members.id WHERE (visible = 1 AND member_type='way' and member_id=23359330) LIMIT 1[0m
[2008-03-21 13:49:13.883795 #8720]   [4;35;1mSQL (0.003345)[0m   [0mSHOW TABLES[0m
[2008-03-21 13:49:14.058796 #8720] OSM::APIPreconditionFailedError (OSM::APIPreconditionFailedError):
    /app/models/way.rb:216:in `delete_with_relations_and_history'
    /app/models/way.rb:250:in `delete_with_relations_and_nodes_and_history'
    /app/controllers/amf_controller.rb:594:in `deleteway'
    /app/controllers/amf_controller.rb:69:in `talk'
    /app/controllers/amf_controller.rb:48:in `times'
    /app/controllers/amf_controller.rb:48:in `talk'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:1168:in `send'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:1168:in `perform_action_without_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/filters.rb:697:in `call_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/caching.rb:678:in `perform_action'
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/query_cache.rb:8:in `cache'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/caching.rb:677:in `perform_action'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:524:in `send'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:524:in `process_without_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/session_management.rb:123:in `process'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:388:in `process'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:171:in `handle_request'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:115:in `dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:9:in `dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/webrick_server.rb:112:in `handle_dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/webrick_server.rb:78:in `service'
    /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'
    /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'
    /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'
    /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'
    /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'
    /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'
    /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/webrick_server.rb:62:in `dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/commands/servers/webrick.rb:66
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:496:in `require'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:496:in `require'
    /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/commands/server.rb:39
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    script/server:3


[2008-03-21 13:49:14.488676 #8720] Rendering /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/templates/rescues/layout.erb (internal_server_error)

Change History (1)

comment:1 Changed 11 years ago by Richard

Resolution: fixed
Status: newclosed

Fixed (but see #773).

Note: See TracTickets for help on using tickets.