Project

General

Profile

Actions

Defect #1281

closed

Unable to delete images in a wiki page

Added by Lane Roathe almost 16 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Normal
Category:
Wiki
Target version:
-
Start date:
2008-05-21
Due date:
% Done:

100%

Estimated time:
Resolution:
Affected version:

Description

Whenever we try to delete an image from a wiki page we get the following error:

 TypeError in WikiController#destroy_attachment

can't modify frozen object

RAILS_ROOT: /var/www/rails_apps/redmine
Application Trace | Framework Trace | Full Trace

/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `[]'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `read_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:264:in `query_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:160:in `filename?'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `method_missing'
app/models/attachment.rb:71:in `after_destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `callback'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:296:in `destroy_without_transactions'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
app/controllers/wiki_controller.rb:181:in `destroy_attachment'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `synchronize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/var/lib/gems/1.8/bin/mongrel_rails:16:in `load'
/var/lib/gems/1.8/bin/mongrel_rails:16

/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'

/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `[]'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `read_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:264:in `query_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:160:in `filename?'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `method_missing'
app/models/attachment.rb:71:in `after_destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `callback'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:296:in `destroy_without_transactions'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
app/controllers/wiki_controller.rb:181:in `destroy_attachment'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `synchronize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/var/lib/gems/1.8/bin/mongrel_rails:16:in `load'
/var/lib/gems/1.8/bin/mongrel_rails:16

Request

Parameters:

{"attachment_id"=>"237",
 "id"=>"blackstone",
 "page"=>"Bscore"}

Show session dump

--- 
userslist_sort: 
  :order: asc
  :key: login
:page_layout: 
  left: []

  top: 
  - issuesassignedtome
  - calendar
  - timelog
  - documents
  right: 
  - issuesreportedbyme
boardsindex_sort: 
  :order: desc
  :key: messages.updated_on
projectslist_files_sort: 
  :order: asc
  :key: attachments.filename
:per_page: 100
:query: 
  :project_id: 3
  :filters: 
    status_id: 
      :values: 
      - "" 
      :operator: o
timelogdetails_sort: 
  :order: desc
  :key: hours
boardsshow_sort: 
  :order: desc
  :key: messages.updated_on
usersindex_sort: 
  :order: asc
  :key: login
adminprojects_sort: 
  :order: asc
  :key: name
issuesindex_sort: 
  :order: desc
  :key: issues.id
flash: !map:ActionController::Flash::FlashHash {}

Response

Headers:

{"cookie"=>[],
 "Cache-Control"=>"no-cache"}

I searched redmine and found no related issues, etc. on this topic. I did find via google that the "can't modify frozen object" could occur due to an operation on an object that has been modified/deleted/etc. Hopefully this helps.

We ran into this on 0.7, so I updated to 0.7.1 and then to the latest svn trunk without any change in behavior.


Files

unable_to_delete_attachements.dump.txt (10.5 KB) unable_to_delete_attachements.dump.txt Dump of r1444 failure on trying to delete attachment Lane Roathe, 2008-05-23 00:21
Actions #1

Updated by Jean-Philippe Lang almost 16 years ago

I can't reproduce.
Which Redmine version produced the reported log ?
Does this problem occur when deleting images only or any other kind of attachment ?

Actions #2

Updated by Lane Roathe almost 16 years ago

Admin info reports version of Redmine 0.7.devel.1441 (MySQL)

After further testing, this problem occurs for any attachment.

Actions #3

Updated by Jean-Philippe Lang almost 16 years ago

I'm still not able to reproduce but I think r1444 should fix this error.
Can you confirm ?

Actions #4

Updated by Lane Roathe almost 16 years ago

I did an update to r1444, and verified the update via the redmine admin information tab.

I still get the error when trying to delete any attachments. I've attached a dump from the latest release when failing to delete an attachment. Let me know if there's anything else I can try on my end.

Actions #5

Updated by Lane Roathe almost 16 years ago

I'm wondering if it is a ruby/rails version issue? I notice in the dump that there is a 'method_missing' after the destroy. Don't know enough about ruby or rails to say, but might be a clue. I'm on Ubuntu 8.04 with all the latest updates via aptitude.

Actions #6

Updated by Jean-Philippe Lang almost 16 years ago

  • Assignee set to Jean-Philippe Lang
Actions #7

Updated by Jean-Philippe Lang almost 16 years ago

Ruby on Rails uses method_missing hook heavily, it's not the problem.
Do you use the official 2.0.2 version of Rails or edge Rails ? And what is your exact version of ruby ?

Actions #8

Updated by Lane Roathe almost 16 years ago

As far as I can tell it's the official 2.0.2 version; it's the version installed by Ubuntu via apt w/o modifications.

rails 2.0.2-1ubu 2.0.2-1ubu

Actions #9

Updated by Lane Roathe almost 16 years ago

  • Status changed from New to Resolved

After updating to r1472 and restarting my mongrel cluster I can now delete attachments. :)

Actions #10

Updated by Thomas Lecavelier almost 16 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100

Declared solved by reporter. Now closing...

Actions

Also available in: Atom PDF