Project

General

Profile

Actions

Defect #7920

closed

Attempted to update a stale object when copying a project

Added by Luis Serrano Aranda about 13 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Category:
Projects
Target version:
Start date:
2011-03-18
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When I try to copy a project 80 tasks, subtasks and relations, versions, Redmine returns this messsage:

ActiveRecord::StaleObjectError in ProjectsController#copy

Attempted to update a stale object

RAILS_ROOT: /var/www/redmine

Application Trace | Framework Trace | Full Trace
/var/www/redmine/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:89:in `update_without_dirty'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/dirty.rb:146:in `update_without_timestamps'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/timestamp.rb:64:in `update_without_callbacks'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/callbacks.rb:282:in `update'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/base.rb:2874:in `create_or_update_without_callbacks'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in `create_or_update'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/base.rb:2538:in `save_without_validation'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/validations.rb:1078:in `save_without_dirty'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_without_transactions'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `send'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/var/www/redmine/app/models/issue.rb:542:in `reschedule_after_without_earlier_date'
/var/www/redmine/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/var/www/redmine/app/models/issue_relation.rb:82:in `before_save'
/var/www/redmine/app/models/project.rb:729:in `copy_issues'
/var/www/redmine/app/models/project.rb:722:in `copy_issues'
/var/www/redmine/app/models/project.rb:714:in `copy_issues'
/var/www/redmine/app/models/project.rb:579:in `send'
/var/www/redmine/app/models/project.rb:579:in `copy'
/var/www/redmine/app/models/project.rb:578:in `each'
/var/www/redmine/app/models/project.rb:578:in `copy'
/var/www/redmine/app/models/project.rb:575:in `copy'
/var/www/redmine/app/controllers/projects_controller.rb:121:in `copy'
/var/www/redmine/app/models/mailer.rb:337:in `with_deliveries'
/var/www/redmine/app/controllers/projects_controller.rb:117:in `copy'
Request

Parameters:

{"enabled_modules"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"repository",
"boards",
"calendar",
"gantt",
"budget_module",
"customer_module",
"ezfaq",
"redmine_blocks",
"charts",
"wiki_extensions"],
"commit"=>"Copiar",
"only"=>["members",
"versions",
"issue_categories",
"issues",
"queries",
"boards",
"wiki",
""],
"authenticity_token"=>"NVeCcahXzbXnygJw82iVbZFogwgeNEjkQPpsxWMvF+E=",
"id"=>"prueba2",
"project"=>{"name"=>"prueba4",
"issue_custom_field_ids"=>["48",
"49",
"53",
""],
"custom_field_values"=>{"44"=>"Número de albarán EST",
"45"=>"Número de albarán VAR",
"46"=>"Ubicación",
"47"=>"Dirección de la obra",
"50"=>"Número de albarán SOFT",
"51"=>"Número de albarán HARD",
"41"=>"Delegación",
"42"=>"Número de la obra",
"43"=>"Número de albarán ROB"},
"tracker_ids"=>["2",
"1",
"3",
"5",
"6",
"7",
"8",
"9",
""],
"parent_id"=>"",
"homepage"=>"",
"description"=>"Descripción del proyecto de operaciones",
"is_public"=>"0",
"identifier"=>"prueba4",
"enabled_module_names"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"repository",
"boards",
"calendar",
"gantt",
"budget_module",
"customer_module",
"ezfaq",
"redmine_blocks",
"charts",
"wiki_extensions",
""]}}
Show session dump

Response

Headers:

{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}

If I use the same database with aptana and with the debugger and I try to copy the same project redmine don't returns any error...

Ithink it

Actions #1

Updated by Luis Serrano Aranda about 13 years ago

I think its a problems of locks and velocity... with aptana redmine works more slow...

Could that be this?

Thanks

Actions #2

Updated by Jean-Philippe Lang about 13 years ago

The method that triggers your error (#reschedule_after_without_earlier_date) is not defined in Redmine core.

Actions #3

Updated by Luis Serrano Aranda about 13 years ago

It's true but without this plugin (better_gantt) redmine also fails

ActiveRecord::StaleObjectError in ProjectsController#copy

Attempted to update a stale object
RAILS_ROOT: /var/www/redmine

Application Trace | Framework Trace | Full Trace
/var/www/redmine/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:89:in `update_without_dirty'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/dirty.rb:146:in `update_without_timestamps'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/timestamp.rb:64:in `update_without_callbacks'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/callbacks.rb:282:in `update'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/base.rb:2874:in `create_or_update_without_callbacks'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in `create_or_update'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/base.rb:2538:in `save_without_validation'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/validations.rb:1078:in `save_without_dirty'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_without_transactions'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `send'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/var/www/redmine/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/var/www/redmine/app/models/issue.rb:516:in `reschedule_after'
/var/www/redmine/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/var/www/redmine/app/models/issue.rb:824:in `reschedule_following_issues'
/var/www/redmine/app/models/issue.rb:823:in `reschedule_following_issues'
/var/www/redmine/app/models/issue.rb:516:in `reschedule_after'
/var/www/redmine/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/var/www/redmine/app/models/issue.rb:824:in `reschedule_following_issues'
/var/www/redmine/app/models/issue.rb:823:in `reschedule_following_issues'
/var/www/redmine/app/models/issue.rb:516:in `reschedule_after'
/var/www/redmine/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/var/www/redmine/app/models/issue_relation.rb:82:in `before_save'
/var/www/redmine/app/models/project.rb:729:in `copy_issues'
/var/www/redmine/app/models/project.rb:722:in `copy_issues'
/var/www/redmine/app/models/project.rb:714:in `copy_issues'
/var/www/redmine/app/models/project.rb:579:in `send'
/var/www/redmine/app/models/project.rb:579:in `copy'
/var/www/redmine/app/models/project.rb:578:in `each'
/var/www/redmine/app/models/project.rb:578:in `copy'
/var/www/redmine/app/models/project.rb:575:in `copy'
/var/www/redmine/app/controllers/projects_controller.rb:121:in `copy'
/var/www/redmine/app/models/mailer.rb:337:in `with_deliveries'
/var/www/redmine/app/controllers/projects_controller.rb:117:in `copy'
Request

Parameters:

{"enabled_modules"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"boards",
"calendar",
"gantt",
"budget_module",
"customer_module",
"redmine_blocks",
"charts",
"wiki_extensions",
"work_time"],
"commit"=>"Copiar",
"only"=>["members",
"versions",
"issue_categories",
"issues",
"queries",
"boards",
"wiki",
""],
"authenticity_token"=>"hrXm4psY17wxTVIXaDeEoiuhT+jECVTPvwqQ4DRKzgs=",
"id"=>"opnotocar",
"project"=>{"name"=>"Prueba",
"issue_custom_field_ids"=>["48",
"49",
"53",
""],
"custom_field_values"=>{"44"=>"Número de albarán EST",
"45"=>"Número de albarán VAR",
"46"=>"Ubicación",
"47"=>"Dirección de la obra",
"50"=>"Número de albarán SOFT",
"51"=>"Número de albarán HARD",
"41"=>"Delegación",
"42"=>"Número de la obra",
"43"=>"Número de albarán ROB"},
"tracker_ids"=>["2",
"1",
"3",
"5",
"6",
"7",
"8",
"9",
""],
"parent_id"=>"",
"homepage"=>"",
"description"=>"Descripción del proyecto de operaciones",
"is_public"=>"0",
"identifier"=>"prueba",
"enabled_module_names"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"boards",
"calendar",
"gantt",
"budget_module",
"customer_module",
"redmine_blocks",
"charts",
"wiki_extensions",
"work_time",
""]}}
Show session dump

Response

Headers:

{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}

Actions #4

Updated by Etienne Massip about 13 years ago

So much plugins, did you try with no plugin at all ?

Actions #5

Updated by Luis Serrano Aranda about 13 years ago

Without plugins and a clean installation, redmine return this

ActiveRecord::StaleObjectError in ProjectsController#copy

Attempted to update a stale object
RAILS_ROOT: /home/lserrano/redmine-dev1

Application Trace | Framework Trace | Full Trace
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:89:in `update_without_dirty'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/dirty.rb:146:in `update_without_timestamps'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/timestamp.rb:64:in `update_without_callbacks'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/callbacks.rb:282:in `update'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/base.rb:2874:in `create_or_update_without_callbacks'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in `create_or_update'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/base.rb:2538:in `save_without_validation'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/validations.rb:1078:in `save_without_dirty'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_without_transactions'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `send'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/home/lserrano/redmine-dev1/app/models/issue.rb:500:in `reschedule_after'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/home/lserrano/redmine-dev1/app/models/issue.rb:806:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:805:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:500:in `reschedule_after'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/home/lserrano/redmine-dev1/app/models/issue.rb:806:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:805:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:500:in `reschedule_after'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:82:in `before_save'
/home/lserrano/redmine-dev1/app/models/project.rb:729:in `copy_issues'
/home/lserrano/redmine-dev1/app/models/project.rb:722:in `copy_issues'
/home/lserrano/redmine-dev1/app/models/project.rb:714:in `copy_issues'
/home/lserrano/redmine-dev1/app/models/project.rb:579:in `send'
/home/lserrano/redmine-dev1/app/models/project.rb:579:in `copy'
/home/lserrano/redmine-dev1/app/models/project.rb:578:in `each'
/home/lserrano/redmine-dev1/app/models/project.rb:578:in `copy'
/home/lserrano/redmine-dev1/app/models/project.rb:575:in `copy'
/home/lserrano/redmine-dev1/app/controllers/projects_controller.rb:121:in `copy'
/home/lserrano/redmine-dev1/app/models/mailer.rb:337:in `with_deliveries'
/home/lserrano/redmine-dev1/app/controllers/projects_controller.rb:117:in `copy'
Request

Parameters:

{"enabled_modules"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"boards",
"calendar",
"gantt"],
"commit"=>"Copiar",
"only"=>["members",
"versions",
"issue_categories",
"issues",
"queries",
"boards",
"wiki",
""],
"authenticity_token"=>"xvPtz4xU7a4RKeyfKN1TknbJ4kO/L+9nG0UpsQYg0ls=",
"id"=>"opnotocar",
"project"=>{"name"=>"Prueba",
"issue_custom_field_ids"=>["48",
"49",
"53",
""],
"custom_field_values"=>{"44"=>"Número de albarán EST",
"45"=>"Número de albarán VAR",
"46"=>"Ubicación",
"47"=>"Dirección de la obra",
"50"=>"Número de albarán SOFT",
"51"=>"Número de albarán HARD",
"41"=>"Delegación",
"42"=>"Número de la obra",
"43"=>"Número de albarán ROB"},
"tracker_ids"=>["2",
"1",
"3",
"5",
"6",
"7",
"8",
"9",
""],
"parent_id"=>"",
"homepage"=>"",
"description"=>"Descripción del proyecto de operaciones",
"is_public"=>"0",
"identifier"=>"prueba",
"enabled_module_names"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"boards",
"calendar",
"gantt",
""]}}
Show session dump

Response

Headers:

{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}

Actions #6

Updated by Luis Serrano Aranda about 13 years ago

The problem is in the function def reschedule_after(date)

Actions #7

Updated by Luis Serrano Aranda about 13 years ago

The problem is in the save method...

def reschedule_after(date)
return if date.nil?
if leaf?
if start_date.nil? || start_date < date
self.start_date, self.due_date = date, date + duration # save
end
else
leaves.each do |leaf|
leaf.reschedule_after(date)
end
end
end
Actions #8

Updated by Etienne Massip about 13 years ago

Try replacing self.due_date = date with self.due_date = date.dup

Actions #9

Updated by Luis Serrano Aranda about 13 years ago

I have try it
if start_date.nil? || start_date < date
self.start_date, self.due_date = date.dup, date + duration
save
end

but not fails

Attempted to update a stale object
RAILS_ROOT: /home/lserrano/redmine-dev1

Application Trace | Framework Trace | Full Trace
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:89:in `update_without_dirty'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/dirty.rb:146:in `update_without_timestamps'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/timestamp.rb:64:in `update_without_callbacks'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/callbacks.rb:282:in `update'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/base.rb:2874:in `create_or_update_without_callbacks'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in `create_or_update'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/base.rb:2538:in `save_without_validation'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/validations.rb:1078:in `save_without_dirty'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_without_transactions'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `send'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/home/lserrano/redmine-dev1/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/home/lserrano/redmine-dev1/app/models/issue.rb:500:in `reschedule_after'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/home/lserrano/redmine-dev1/app/models/issue.rb:806:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:805:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:500:in `reschedule_after'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/home/lserrano/redmine-dev1/app/models/issue.rb:806:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:805:in `reschedule_following_issues'
/home/lserrano/redmine-dev1/app/models/issue.rb:500:in `reschedule_after'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:88:in `set_issue_to_dates'
/home/lserrano/redmine-dev1/app/models/issue_relation.rb:82:in `before_save'
/home/lserrano/redmine-dev1/app/models/project.rb:729:in `copy_issues'
/home/lserrano/redmine-dev1/app/models/project.rb:722:in `copy_issues'
/home/lserrano/redmine-dev1/app/models/project.rb:714:in `copy_issues'
/home/lserrano/redmine-dev1/app/models/project.rb:579:in `send'
/home/lserrano/redmine-dev1/app/models/project.rb:579:in `copy'
/home/lserrano/redmine-dev1/app/models/project.rb:578:in `each'
/home/lserrano/redmine-dev1/app/models/project.rb:578:in `copy'
/home/lserrano/redmine-dev1/app/models/project.rb:575:in `copy'
/home/lserrano/redmine-dev1/app/controllers/projects_controller.rb:121:in `copy'
/home/lserrano/redmine-dev1/app/models/mailer.rb:337:in `with_deliveries'
/home/lserrano/redmine-dev1/app/controllers/projects_controller.rb:117:in `copy'
Request

Parameters:

{"enabled_modules"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"boards",
"calendar",
"gantt"],
"commit"=>"Copiar",
"only"=>["members",
"versions",
"issue_categories",
"issues",
"boards",
"wiki",
""],
"authenticity_token"=>"xvPtz4xU7a4RKeyfKN1TknbJ4kO/L+9nG0UpsQYg0ls=",
"id"=>"opnotocar",
"project"=>{"name"=>"Prueba2",
"issue_custom_field_ids"=>["48",
"49",
"53",
""],
"custom_field_values"=>{"44"=>"Número de albarán EST",
"45"=>"Número de albarán VAR",
"46"=>"Ubicación",
"47"=>"Dirección de la obra",
"50"=>"Número de albarán SOFT",
"51"=>"Número de albarán HARD",
"41"=>"Delegación",
"42"=>"Número de la obra",
"43"=>"Número de albarán ROB"},
"tracker_ids"=>["2",
"1",
"3",
"5",
"6",
"7",
"8",
"9",
""],
"parent_id"=>"",
"homepage"=>"",
"description"=>"Descripción del proyecto de operaciones",
"is_public"=>"0",
"identifier"=>"prueba2",
"enabled_module_names"=>["issue_tracking",
"time_tracking",
"news",
"documents",
"files",
"wiki",
"boards",
"calendar",
"gantt",
""]}}
Show session dump

Response

Headers:

{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}

Actions #10

Updated by Etienne Massip about 13 years ago

Make sure you don't have some circular dependencies with issue relations, that is :

issue1 -> issue2 -> issue1

Actions #11

Updated by Etienne Massip almost 13 years ago

  • Target version set to Candidate for next minor release

Just hit a very similar issue :

  1. following scenario of note 10 in #6320, I got : issue 380 parent of 379 and 381
  2. in the issue list, select all the 3 issues and right-click to delete all the 3

Bang !

Processing IssuesController#destroy (for 10.132.21.161 at 2011-04-01 11:32:03) [POST]
  Parameters: {"back_url"=>"/projects/psmtxa/issues", "ids"=>["381", "380", "379"], "action"=>"destroy", "authenticity_token"=>"gGV5wcWHWc+93sHWkfbrS79eCHaDFVroRIbO/Rwcl7A=", "controller"=>"issues"}

ActiveRecord::StaleObjectError (Attempted to delete a stale object: Issue):
  (eval):4:in `destroy_without_callbacks'
  app/controllers/issues_controller.rb:239:in `each'
  app/controllers/issues_controller.rb:239:in `destroy'
  config/initializers/mongrel.rb:62:in `dispatch_cgi'

Actually, only the 381 has been deleted.

Actions #12

Updated by Etienne Massip almost 13 years ago

In my case, the issue is that you can't destroy a parent issue, period.

Actions #13

Updated by Jean-Philippe Lang almost 13 years ago

Etienne Massip wrote:

Just hit a very similar issue :

  1. following scenario of note 10 in #6320, I got : issue 380 parent of 379 and 381
  2. in the issue list, select all the 3 issues and right-click to delete all the 3

Bang !

Fixed in r5283.

Actions #14

Updated by Jean-Philippe Lang almost 13 years ago

Actually, not totally fixed.

Actions #15

Updated by Jean-Philippe Lang almost 13 years ago

Finally fixed the error that may occur on deletion in r5285.

Actions #16

Updated by Luis Serrano Aranda almost 13 years ago

Even I have the same error and have made ​​modifications r5283 and r5285

Actions #17

Updated by Luis Serrano Aranda almost 13 years ago

More news...

I need a copy of this project to use as a template, for error left the project start date in the template, if I delete that date (it is not no date) gives me no error when copying....

I deleted the changes (r5283 and r5285) and still works.

Leave patches or delete?

Thanks

Actions #18

Updated by Jean-Philippe Lang about 12 years ago

  • Subject changed from Attempted to update a stale object to Attempted to update a stale object when copying a project
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version changed from Candidate for next minor release to 1.4.0
  • Resolution set to Fixed

I couldn't reproduce but the error on #reschedule_after should be fixed by r8864.

Actions #19

Updated by Jean-Philippe Lang about 12 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF