Project

General

Profile

attachments_storage_path is not applied

Added by Adrian Antonana over 10 years ago

I have my attchments path in /etc/redmine/configuration.yml set as follows:

attachments_storage_path: /mnt/data/www/redmine

And runned:

rake db:migrate RAILS_ENV=production 
rake redmine:plugins:migrate RAILS_ENV=production 
rake tmp:cache:clear
rake tmp:sessions:clear

But when I try to download an attached file I get following 404 error:

The page you were trying to access doesn't exist or has been removed.

Redmine log shows the following error messages:

Cannot send attachment, /var/lib/redmine/default/<file-path> does not exist or is unreadable

Of cource the path doesn't exist since my files are under /mnt/data/www/redmine/
So it seems that the attachments_storage_path setting is not beeing applied.

I had the same setting on an Ubuntu 12.04 server with no problems... am I missing some config steps?

System Info


My Redmine environment:

Environment:
  Redmine version                2.5.1.stable
  Ruby version                   1.9.3-p194 (2012-04-20) [x86_64-linux]
  Rails version                  3.2.6
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            1.7.10.4
  Filesystem                     
Redmine plugins:
  redmine_scm                    0.4.3
  redmine_wiki_extensions        0.6.4
  sidebar                        0.1.1
  wiking                         0.0.4

OS

Debian GNU/Linux 7.6 (wheezy)

Installed Packages:

Note : All bpo packages are installed from wheezy_backports repository.

redmine                  : 2.5.1-2~bpo70+3
redmine-mysql            : 2.5.1-2~bpo70+3
apache2                  : 2.2.22-13+deb7u3
libapache2-mod-passenger : 4.0.10-1~bpo7+1
ruby1.9.1                : 1.9.3.194-8.1+deb7u2
ruby-mysql2              : 0.3.15-1~bpo70+1
ruby-passenger           : 4.0.10-1~bpo7+1
mysql-server             : 5.5.38-0+wheezy1
mysql-client             : 5.5.38-0+wheezy1

Replies (4)

RE: attachments_storage_path is not applied - Added by Tony Maher over 9 years ago

I have same problem. Any solutions?

RE: attachments_storage_path is not applied - Added by stefan pofahl 2 days ago

I have installed redmine via Debian install packages and was surprised, - the storage folder for attachments is:
/var/lib/redmine/default/files/
And the configuration file: $RAILS_ROOT/config/configuration.yml was not present, only the template configuration.yml.example was present in this folder.
I performed a string search in all files above $RAILS_ROOT and found only one file that uses this variable:
$RAILS_ROOT/app/models/attachment.rb
The strange thing in this file is a statement with an or expression and neither of the two options indicate that the attached files will be located in /var/lib/redmine/default/files/:

  [...]
  cattr_accessor :storage_path
  @@storage_path = Redmine::Configuration['attachments_storage_path'] || File.join(Redmine.root, "files")
  [...]

RE: attachments_storage_path is not applied - Added by Holger Just 2 days ago

The Debian packages have some changes applied which make then behave different from standard Redmine. See https://wiki.debian.org/Redmine#Differences_from_upstream_Redmine. Specifically, they changed the default locations of various config files in order to introduce a featire to tun multiple independent Redmine installation from the same code base.

Note that the code you quoted uses Redmine.root as a default base path (rather than Rails.root which is used by standard Redmine). This is changed in a Debian specific patch which also introduces the Redmine.root method.

RE: attachments_storage_path is not applied - Added by stefan pofahl 1 day ago

Thanks a lot Hoger!!! :-)

    (1-4/4)