Project

General

Profile

Actions

Defect #8880

closed

Error deleting issue with grandchild

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

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
Start date:
2011-07-22
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

If I have three task level and I try to delete the parent task Redmine fails.
Task |---> Sub Task Level two |---> Sub Task level three
But if I delete the sub task Level two and after the parent Redmine works

I test without any plugin

The error is:

ActiveRecord::StaleObjectError in IssuesController#destroy

Attempted to delete a stale object: Issue
RAILS_ROOT: /var/www/redmine

Application Trace | Framework Trace | Full Trace
/var/www/redmine/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:127:in `destroy_without_habtm_shim_for_changesets'
(eval):4:in `destroy_without_callbacks'
/var/www/redmine/app/controllers/issues_controller.rb:245:in `destroy'
/var/www/redmine/app/controllers/issues_controller.rb:243:in `each'
/var/www/redmine/app/controllers/issues_controller.rb:243:in `destroy'
Request

Parameters:

{"authenticity_token"=>"sE0B1d6fC5kL0w6VIuAFYQqGxyyvk1MIkig5RP9wFT0=",
"id"=>"29374"}
Show session dump

Response

Headers:

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

My environment is:

My system information

About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.1
Rails version 2.3.11
Active Record version 2.3.11
Active Resource version 2.3.11
Action Mailer version 2.3.11
Active Support version 2.3.11
Edge Rails revision unknown
Application root /var/www/redmine
Environment production
Database adapter mysql
Database schema version 20110511000000

Actions #1

Updated by Etienne Massip over 13 years ago

  • Target version set to Candidate for next minor release

Confirmed with pg on trunk and exact same stack trace.

Actions #2

Updated by Jean-Philippe Lang over 13 years ago

  • Subject changed from Error deleting task to Error deleting issue with grandchild
  • Target version changed from Candidate for next minor release to 1.2.2
Actions #3

Updated by Jean-Philippe Lang over 13 years ago

  • Status changed from New to Resolved
  • Resolution set to Fixed

Fixed in r6311.

Actions #4

Updated by Luis Serrano Aranda about 13 years ago

Something very similar happens when you try to delete a project with a sub-task, this is the error

ActiveRecord::StaleObjectError in ProjectsController#destroy

Attempted to delete a stale object: Issue
RAILS_ROOT: /var/www/redmine

Application Trace | Framework Trace | Full Trace
/var/www/redmine/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:127:in `destroy_without_habtm_shim_for_changesets'
(eval):4:in `destroy_without_callbacks'
/var/www/redmine/app/controllers/projects_controller.rb:234:in `destroy'
Request

Parameters:

{"commit"=>"Borrar",
"confirm"=>"1",
"_method"=>"delete",
"authenticity_token"=>"yxOI1JHy7oGkYM9rD7T31LE08lhXuugfp5qztRwWLh8=",
"id"=>"testing"}
Show session dump

Response

Headers:

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

Actions #5

Updated by Etienne Massip about 13 years ago

Could you please attach here the relevant full stack trace you'll find in your production.log file?

Actions #6

Updated by Luis Serrano Aranda about 13 years ago

Processing ProjectsController#destroy (for 127.0.0.1 at 2011-08-25 14:51:34) [GET]
Parameters: {"action"=>"destroy", "id"=>"plantoper", "controller"=>"projects"}
Rendering template within layouts/base
Rendering projects/destroy
Completed in 40ms (View: 36, DB: 0) | 200 OK [http://127.0.0.1/projects/plantoper/destroy]

Processing ProjectsController#destroy (for 127.0.0.1 at 2011-08-25 14:51:36) [DELETE]
Parameters: {"commit"=>"Borrar", "confirm"=>"1", "action"=>"destroy", "_method"=>"delete", "authenticity_token"=>"8SnFDMeQaBAt4QMsGsc1pegC/+eRsgIDQT45ArOlHR0=", "id"=>"plantoper", "controller"=>"projects"}

ActiveRecord::StaleObjectError (Attempted to delete a stale object: Issue):
(eval):4:in `destroy_without_callbacks'
app/controllers/projects_controller.rb:235:in `destroy'
/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'

Rendering rescues/layout (conflict)

Actions #7

Updated by Luis Serrano Aranda about 13 years ago

Without the revision 6311

Processing ProjectsController#destroy (for 127.0.0.1 at 2011-08-25 14:51:34) [GET]
Parameters: {"action"=>"destroy", "id"=>"plantoper", "controller"=>"projects"}
Rendering template within layouts/base
Rendering projects/destroy
Completed in 40ms (View: 36, DB: 0) | 200 OK [http://127.0.0.1/projects/plantoper/destroy]

Processing ProjectsController#destroy (for 127.0.0.1 at 2011-08-25 14:51:36) [DELETE]
Parameters: {"commit"=>"Borrar", "confirm"=>"1", "action"=>"destroy", "_method"=>"delete", "authenticity_token"=>"8SnFDMeQaBAt4QMsGsc1pegC/+eRsgIDQT45ArOlHR0=", "id"=>"plantoper", "controller"=>"projects"}

ActiveRecord::StaleObjectError (Attempted to delete a stale object: Issue):
(eval):4:in `destroy_without_callbacks'
app/controllers/projects_controller.rb:235:in `destroy'
/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'

Rendering rescues/layout (conflict)

Actions #8

Updated by Luis Serrano Aranda about 13 years ago

With the revision 6311

Processing ProjectsController#destroy (for 127.0.0.1 at 2011-08-25 14:54:26) [DELETE]
Parameters: {"commit"=>"Borrar", "confirm"=>"1", "action"=>"destroy", "_method"=>"delete", "authenticity_token"=>"8SnFDMeQaBAt4QMsGsc1pegC/+eRsgIDQT45ArOlHR0=", "id"=>"plantoper", "controller"=>"projects"}

ActiveRecord::StaleObjectError (Attempted to delete a stale object: Issue):
(eval):4:in `destroy_without_callbacks'
app/controllers/projects_controller.rb:235:in `destroy'
/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'

Rendering rescues/layout (conflict)

Actions #9

Updated by Luis Serrano Aranda about 13 years ago

The same log

Actions #10

Updated by Jack Chiu about 13 years ago

I have same problem, but i solve it.

if sub_issue.create_time > parent_issue.create_time
project.destroy is Error ===========================================================================================
ActiveRecord::StaleObjectError: Attempted to delete a stale object: Issue
(eval):4:in `destroy_without_callbacks'
test/unit/project_test.rb:187:in `test_destroying_root_projects_should_clear_data'
test/unit/project_test.rb:186:in `test_destroying_root_projects_should_clear_data'

Change craete_time by fixture file.

Units passed.

Actions #11

Updated by Etienne Massip about 13 years ago

Jack Chiu wrote:

I have same problem, but i solve it.

if sub_issue.create_time > parent_issue.create_time
project.destroy is Error ===========================================================================================
ActiveRecord::StaleObjectError: Attempted to delete a stale object: Issue
(eval):4:in `destroy_without_callbacks'
test/unit/project_test.rb:187:in `test_destroying_root_projects_should_clear_data'
test/unit/project_test.rb:186:in `test_destroying_root_projects_should_clear_data'

Change craete_time by fixture file.

Units passed.

Sorry, don't understand.

Do you mean that if you change create time in fixture file, test_destroying_root_projects_should_clear_data will fail?

How did you solve it?

Actions #12

Updated by Jean-Philippe Lang about 13 years ago

  • Status changed from Resolved to Closed

Merged in r7769.
If an error occurs in an other use case, please open a new ticket, thanks.

Actions

Also available in: Atom PDF