Vote #70393
完了Error deleting issue with grandchild
0%
説明
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'
destroy_without_callbacks'
(eval):4:in
/var/www/redmine/app/controllers/issues_controller.rb:245:in destroy'
each'
/var/www/redmine/app/controllers/issues_controller.rb:243:in
/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
journals
Confirmed with pg on trunk and exact same stack trace.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Fixed in r6311.
--------------------------------------------------------------------------------
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"}
--------------------------------------------------------------------------------
Could you please attach here the relevant full stack trace you'll find in your @production.log@ file?
--------------------------------------------------------------------------------
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)
--------------------------------------------------------------------------------
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)
--------------------------------------------------------------------------------
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)
--------------------------------------------------------------------------------
The same log
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
Merged in r7769.
If an error occurs in an other use case, please open a new ticket, thanks.
--------------------------------------------------------------------------------