Project

General

Profile

Redmine upgrade breaks old attachments

Added by David Lyons almost 13 years ago

I am upgrading redmine from an old version (prior to .8, I believe). I had an issue with member role validation, I commented out the validation code in app/models/member_role.rb, and the upgrade works fine. My problem is the old files in the REDMINE/files directory. The attachment links are somehow broken. The page says "The page you were trying to access doesn't exist or has been removed" and "production.log" has the following:

Processing AttachmentsController#show (for 207.207.18.252 at 2011-05-02 16:20:26) [GET]
  Parameters: {"action"=>"show", "id"=>"17544", "filename"=>"Corporate_Training_Reports_-_3-28-11.xlsx", "controller"=>"attachments"}
Rendering template within layouts/base
Rendering common/error (404)
Filter chain halted as [:file_readable] rendered_or_redirected.
Completed in 1004ms (View: 868, DB: 31) | 404 Not Found [http://newredmine.alchemysystems.com/attachments/17544/Corporate_Training_Reports_-_3-28-11.xlsx]

I know the file is there, I can see it in the filesystem, and a newly uploaded file that I tested shows up in the same filesystem, with the same permissions. The newly uploaded file link works correctly. The new file perms:

rw-rw-rw 1 www-data mail 17K 2011-03-24 14:56 110324145623_retrainDate.sql

the old files perms:

rw-rw-rw 1 www-data mail 86K 2011-04-14 14:07 110414140746_Corporate_Training_Reports_-_3-28-11.xlsx

My environment:

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.5
Active Record version 2.3.5
Active Resource version 2.3.5
Action Mailer version 2.3.5
Active Support version 2.3.5
Edge Rails revision unknown
Application root /usr/share/redmine
Environment production
Database adapter mysql
Database schema version 20101114115359

Any help would be greatly appreciated!


Replies (4)

RE: Redmine upgrade breaks old attachments - Added by David Lyons almost 13 years ago

Ok, figured it out. I was using an ubuntu package installation, and the files directory isn't where I expected, it lives in /var/lib/redmine/default/files. Setting up the files there fixed the issue.

RE: Redmine upgrade breaks old attachments - Added by Mario Luzeiro about 12 years ago

I got same problem with last updates, how do you solve it?
where did you update the files directory?
I tested it with pdf files and it works ok, it didn't change.

RE: Redmine upgrade breaks old attachments - Added by Mario Luzeiro about 12 years ago

Correction: in some projects it shows OK the images and files, other nothing works.

RE: Redmine upgrade breaks old attachments - Added by Mario Luzeiro about 12 years ago

Closed: I forgot to backup files folder :\
I recover it, but you must take care with exactly file system flags (use tar to save and restore that flags)

    (1-4/4)