https://www.redmine.org/
https://www.redmine.org/favicon.ico?1679302129
2009-03-04T17:04:29Z
Redmine
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=7800
2009-03-04T17:04:29Z
Jean-Philippe Lang
jp_lang@yahoo.fr
<ul></ul><p>Not able to reproduce. Can you attach the html source of the page where it happens please?</p>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=7804
2009-03-04T17:35:03Z
Robert Cerny
<ul><li><strong>File</strong> <a href="/attachments/1633">Redmine.html</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1633/Redmine.html">Redmine.html</a> added</li></ul><p>Enclosed please find requested data</p>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=7806
2009-03-04T17:49:20Z
Jean-Philippe Lang
jp_lang@yahoo.fr
<ul></ul><p>Maybe you have duplicated rows in your <code>projects_trackers</code> table (this table stores this association between project and trackers).<br />Can you check that?</p>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=7807
2009-03-04T17:58:12Z
Robert Cerny
<ul></ul><pre>
mysql> select * from projects_trackers;
+------------+------------+
| project_id | tracker_id |
+------------+------------+
| 1 | 1 |
| 1 | 2 |
| 2 | 3 |
| 3 | 1 |
| 3 | 3 |
| 5 | 3 |
| 5 | 2 |
| 5 | 4 |
| 3 | 4 |
| 2 | 1 |
| 2 | 2 |
| 2 | 4 |
| 6 | 1 |
| 6 | 2 |
| 6 | 3 |
| 6 | 4 |
| 5 | 1 |
| 8 | 1 |
| 8 | 2 |
| 9 | 1 |
| 9 | 2 |
| 9 | 3 |
| 9 | 4 |
| 2 | 6 |
| 11 | 1 |
| 11 | 2 |
| 12 | 7 |
| 5 | 6 |
| 5 | 7 |
| 13 | 1 |
| 13 | 2 |
| 2 | 7 |
| 14 | 1 |
| 14 | 2 |
| 13 | 8 |
| 1 | 1 |
| 1 | 2 |
| 2 | 3 |
| 3 | 1 |
| 3 | 3 |
| 5 | 3 |
| 5 | 2 |
| 5 | 4 |
| 3 | 4 |
| 2 | 1 |
| 2 | 2 |
| 2 | 4 |
| 6 | 1 |
| 6 | 2 |
| 6 | 3 |
| 6 | 4 |
| 5 | 1 |
| 8 | 1 |
| 8 | 2 |
| 9 | 1 |
| 9 | 2 |
| 9 | 3 |
| 9 | 4 |
| 2 | 6 |
| 11 | 1 |
| 11 | 2 |
| 12 | 7 |
| 5 | 6 |
| 5 | 7 |
| 13 | 1 |
| 13 | 2 |
| 2 | 7 |
| 14 | 1 |
| 14 | 2 |
| 13 | 8 |
+------------+------------+
70 rows in set (0.03 sec)
</pre>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=7810
2009-03-04T18:17:53Z
Jean-Philippe Lang
jp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Cant reproduce</i></li></ul><p>I was right, all the lines are duplicated. The solution is to manually remove all the duplicates.<br />I've migrated several database and never faced this problem. And I can't see what could have produced this, so I close this defect. Reopen if you have any idea about the cause of this problem.</p>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=8001
2009-03-12T19:47:41Z
Jean-Philippe Lang
jp_lang@yahoo.fr
<ul></ul>A database migration is added in <a class="changeset" title="Adds a unique index on projects_trackers table (#2882)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/2580">r2580</a>. It will:
<ul>
<li>remove duplicates, if any</li>
<li>add a unique index to avoid this kind of problem</li>
</ul>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=9356
2009-05-18T16:41:55Z
Eric Davis
<ul><li><strong>File</strong> <a href="/attachments/2052">2882-use-uniq-for-habtm.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2052/2882-use-uniq-for-habtm.patch">2882-use-uniq-for-habtm.patch</a> added</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Resolution</strong> deleted (<del><i>Cant reproduce</i></del>)</li></ul><p>I just got hit by this bug. Somehow my Redmine was trying to insert duplicate Trackers and MySQL threw back an error from this unique index. Since the MySQL error wasn't being caught, it rendered the 500 error page. By I removing the database index and added the <code>:uniq</code> option to the Projects / Trackers association I was able to prevent this error while still keeping the trackers from duplicating.</p>
<p>Jean-Philippe: Since this patch backs out your change, can you review this patch before I commit it?</p>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=9358
2009-05-18T16:45:41Z
Eric Davis
<ul></ul><p>Here's the backtrace I got. Redmine version is <a class="changeset" title="Fixed an interpolation argument error in nl.yml" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/2757">r2757</a>.</p>
<pre>
A ActiveRecord::StatementInvalid occurred in projects#add:
Mysql::Error: Duplicate entry '85-3' for key 1: INSERT INTO `projects_trackers` (`project_id`, `tracker_id`) VALUES (85, 3)
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in `log_without_newrelic_instrumentation'
-------------------------------
Request:
-------------------------------
* URL : https://projects.littlestreamsoftware.com/projects/new
* IP address:
* Parameters: {"commit"=>"Save", "enabled_modules"=>["issue_tracking", "time_tracking", "files", "budget_module", "customer_module", "schedule_module"], "project"=>{"issue_custom_field_ids"=>[""], "name"=>"removed", "tracker_ids"=>["3", ""], "description"=>"removed", "homepage"=>"", "is_public"=>"0", "identifier"=>"removed", "parent_id"=>"54", "custom_field_values"=>{"6"=>"Prospecting", "2"=>"0", "3"=>"", "4"=>""}}, "action"=>"add", "controller"=>"projects"}
* Rails root: /home/websites/projects.littlestreamsoftware.com/releases/20090517194548
-------------------------------
Backtrace:
-------------------------------
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in `log_without_newrelic_instrumentation'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb:54:in `log_with_capture_sql'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb:37:in `log_without_trace_Database___adapter_name____args_1__'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:41:in `trace_method_execution_with_scope'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb:36:in `log_without_trace_Database___adapter_name____args_1__'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:138:in `log_without_trace_Database_all'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:41:in `trace_method_execution_with_scope'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:137:in `log_without_trace_Database_all'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:141:in `log'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:309:in `execute'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:171:in `insert_sql'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:319:in `insert_sql'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:44:in `insert_without_query_dirty'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:18:in `insert'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/has_and_belongs_to_many_association.rb:56:in `insert_record'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:145:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:145:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations.rb:1391:in `after_create_or_update_associated_records_for_trackers'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:359:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:212:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:212:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:212:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:212:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:359:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations.rb:1391:in `after_create_or_update_associated_records_for_trackers'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:in `send'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:in `evaluate_method'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:93:in `run'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:92:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:92:in `send'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:92:in `run'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:277:in `run_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:315:in `callback'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:238:in `create_without_timestamps'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/timestamp.rb:29:in `create'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2699:in `create_or_update_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:222:in `create_or_update'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2383:in `save_without_validation'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:1009:in `save_without_dirty'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/dirty.rb:79:in `save_without_transactions'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:179:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:179:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:138:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:178:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:146:in `save_without_trace_ActiveRecord___self_class_name__save'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:158:in `rollback_active_record_state!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:146:in `save_without_trace_ActiveRecord___self_class_name__save'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:138:in `save_without_trace_ActiveRecord_save'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:41:in `trace_method_execution_with_scope'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:137:in `save_without_trace_ActiveRecord_save'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:141:in `save_without_trace_ActiveRecord_all'
[RAILS_ROOT]/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:141:in `save'
[RAILS_ROOT]/app/controllers/projects_controller.rb:77:in `add'
</pre>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=9360
2009-05-18T17:28:44Z
Jean-Philippe Lang
jp_lang@yahoo.fr
<ul></ul><p>Eric, I don't think removing the unique index and ignoring duplicates is the right solution.<br />I'd really prefer this defect to be fixed instead, if it is confirmed.</p>
<p>Did you get this error with any plugin installed (see <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Cannot create project on postgresql (Closed)" href="https://www.redmine.org/issues/3368">#3368</a>)?</p>
Redmine - Defect #2882: trackers doubled
https://www.redmine.org/issues/2882?journal_id=9367
2009-05-18T21:53:22Z
Eric Davis
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Resolution</strong> set to <i>Cant reproduce</i></li></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Did you get this error with any plugin installed (see <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Cannot create project on postgresql (Closed)" href="https://www.redmine.org/issues/3368">#3368</a>)?</p>
</blockquote>
<p>You're right. I thought I was testing with a clean Redmine install earlier (fresh database, no plugins, from trunk) but I must have had something else loaded. When I installed the Stuff To Do plugin (like in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Cannot create project on postgresql (Closed)" href="https://www.redmine.org/issues/3368">#3368</a>), I was able to reproduce the error. It looks like the <code>require 'project'</code> in the plugin was the cause. Why a <code>require</code> caused a MySQL error, I do not know....</p>
<p>Sorry for the noise and thank you for reviewing the patch.</p>