Project

General

Profile

Internal Server Error on file upload

Added by Perry Wolf about 11 years ago

Hi !

We have installed redmine 2.2.1 running on our server.
Everything works fine except when we want to upload files we get this error below.
I already checked folder permissions and everything seems ok.
What could this be ?

Greetings

Processing by FilesController#create as HTML
  Parameters: {"utf8"=>"â", "authenticity_token"=>"AfqrSQRR4kg6j6iy6VLACa72zVSAimAnmcuU9DhbXmY=", "attachments"=>{"dummy"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0x00000006bbae30 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"attachments[dummy][file]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\n", @tempfile=#<File:/tmp/RackMultipart20130201-4707-1rk2mg2>>}}, "commit"=>"Hinzufügen", "project_id"=>"test-project"}
  Current user: admin (id=1)
Completed 500 Internal Server Error in 12ms

NoMethodError (undefined method `disk_directory=' for #<Attachment:0x00000006c0d928>):
  app/models/attachment.rb:103:in `files_to_final_location'
  lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb:85:in `block in save_attachments'
  lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb:80:in `each'
  lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb:80:in `save_attachments'
  app/models/attachment.rb:251:in `attach_files'
  app/controllers/files_controller.rb:45:in `create'

Replies (4)

RE: Internal Server Error on file upload - Added by Etienne Massip about 11 years ago

You forgot to run migrations?

RE: Internal Server Error on file upload - Added by Perry Wolf about 11 years ago

Hi !
No, I did run the migrations.

RE: Internal Server Error on file upload - Added by Etienne Massip about 11 years ago

You have some trunk code inside your 2.2.1 setup.

The migration adding the #disk_directory (see source:/trunk/db/migrate/20121213084931_add_attachments_disk_directory.rb) is related to a 2.3.0 feature (#5298).

RE: Internal Server Error on file upload - Added by Perry Wolf about 11 years ago

Etienne, thanks for your help.
I was able to solve the issue the file you mentioned was present in the db folder.
I did a clean uprade to 2.2.2 run the migrations and now it's working again.

Greetings

    (1-4/4)