mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
389 stars 195 forks source link

[ERROR] track#track_request (PG::UniqueViolation) "ERROR: duplicate key value violates unique #4116

Open lizconlan opened 7 years ago

lizconlan commented 7 years ago

I expect this is someone on a slow connection managing to click the button twice before the page reloads

A PG::UniqueViolation occurred in track#track_request:

  ERROR:  duplicate key value violates unique constraint "index_track_things_on_tracking_user_id_and_track_query"
DETAIL:  Key (tracking_user_id, track_query)=(92284, request:abseiling_report) already exists.

  app/controllers/track_controller.rb:141:in `track_set'

-------------------------------
Request:
-------------------------------

  * URL        : https://www.whatdotheyknow.com/track/request/abseiling_report
  * HTTP Method: GET
  * IP address : [FILTERED]
  * Parameters : {"controller"=>"track", "action"=>"track_request", "feed"=>"track", "url_title"=>"abseiling_report"}
  * Timestamp  : 2017-07-19 12:14:50 +0100
  * Server : FILTERED
  * Rails root : /FILTERED/www.whatdotheyknow.com/alaveteli-2017-07-17T15-43-03
  * Process: 9408

-------------------------------
Backtrace:
-------------------------------

  app/controllers/track_controller.rb:141:in `track_set'
  app/controllers/track_controller.rb:21:in `track_request'
  app/controllers/application_controller.rb:108:in `record_memory'
  lib/strip_empty_sessions.rb:13:in `call'
lizconlan commented 7 years ago

Have now had a second one of these come through:

A PG::UniqueViolation occurred in track#track_request:

  ERROR:  duplicate key value violates unique constraint "index_track_things_on_tracking_user_id_and_track_query"
DETAIL:  Key (tracking_user_id, track_query)=(92284, request:list_of_all_sussex_police_social) already exists.

  app/controllers/track_controller.rb:141:in `track_set'

-------------------------------
Request:
-------------------------------

  * URL        : https://www.whatdotheyknow.com/track/request/list_of_all_sussex_police_social
  * HTTP Method: GET
  * IP address : FILTERED
  * Parameters : {"controller"=>"track", "action"=>"track_request", "feed"=>"track", "url_title"=>"list_of_all_sussex_police_social"}
  * Timestamp  : 2017-07-24 01:37:38 +0100
  * Server : FILTERED
  * Rails root : /FILTERED/www.whatdotheyknow.com/alaveteli-2017-07-19T14-30-12
  * Process: 25179

-------------------------------
Backtrace:
-------------------------------

  app/controllers/track_controller.rb:141:in `track_set'
  app/controllers/track_controller.rb:21:in `track_request'
  app/controllers/application_controller.rb:108:in `record_memory'
  lib/strip_empty_sessions.rb:13:in `call'