Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Redmine - Internal error when trying to upload files to /redmine/files directory.

Posted on 2011-09-13
7
Medium Priority
?
2,681 Views
Last Modified: 2012-05-12
First off this is all new to me.  The probably I'm trying to solve is that we can't upload files to the /redmine/files folder.  We get this error.
Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.

We found the error message and some solutions at this link
http://www.redmine.org/boards/2/topics/19859

I've "chown www.-data:www-data /opt/redmine/files.  And "chmod 775 /opt/redmine/files".
If I change the /opt/redmine/files acl  to 777. I can upload files but the owner is "nobody" and the group is "no group"

I'm trying to determine who passenger is running as so I grepped it and it returns this. It appears that passenger is running from nginx and as nobody.

root     22355     1  0 Sep08 ?        00:00:04 PassengerNginxHelperServer /usr/lib/phusion_passenger ruby 3 4 0 6 0 300 1 nobody 33 33 /tmp/passenger.22353

Here's the nginx passenger.conf file.
more passenger.conf
passenger_root /usr/lib/phusion_passenger;

I tried adding "passengerdefaultuser www-data; to the passenger.conf file but when I restart nginx I get the msg unknown directive "passengerdefaultuser" in /etc/nginx/conf.d/passenger.conf:2

What needs to be done to get this up and rolling?  
I've read the faq's on Phusion, and nginx sites, googled for info etc.

If you need more info, config, or log files let me know.
Below is the info that Redmine faq's mention as helpful.

==========================================================================

ruby 1.8.7 (2010-08-16 patchlevel 302) [i486-linux]
==========================================================================

mysql  Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (i486) using readline 6.1
===========================================================================

Linux server 2.6.32-4-pve #1 SMP Thu Oct 21 09:35:29 CEST 2010 i686 GNU/Linux
===========================================================================

Server version: Apache/2.2.16 (Debian)
===========================================================================

nginx version: nginx/0.7.64
===========================================================================
RAILS_ENV=production script/about
/var/lib/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
About your application's environment
Ruby version              1.8.7 (i486-linux)
RubyGems version          1.3.7
Rack version              1.0
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
Application root          /opt/redmine
Environment               production
Database adapter          mysql
Database schema version   20100819172912
=======================================================================
RAILS_ENV=development script/about
/var/lib/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
About your application's environment
Ruby version              1.8.7 (i486-linux)
RubyGems version          1.3.7
Rack version              1.0
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
Application root          /opt/redmine
Environment               development
Database adapter          mysql
Database schema version   20100819172912

0
Comment
Question by:Westez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 40

Expert Comment

by:noci
ID: 36534584
If you enable acl support you can setup an acl to access a file anyway you like:

setfacl getfacl are the tools of trade here..

acls need to be enabled in /etc/fstab specifying the acl option.
also the parent directory needs a default acl to be applied to all files, THis default acl can specify any user you wish.

http://linux.die.net/man/1/getfacl
http://linux.die.net/man/1/setfacl
0
 

Author Comment

by:Westez
ID: 36536714
What I take away from the Redmine post.  Is that passenger needs to be running as www-data.  And that www-data needs rwx permissions to the /redmine/files directory.

I'm thinking that I need to add "passengerdefaultuser www-data" to the Nginx passenger.conf file.
I will have a look at the links you provided and the cmd's.  I have a bit of an Aix background so I'm not completely unfamiliar with the basic unix cmds.
Have you worked with Nginx, Passenger, Ruby, and Apache?
0
 
LVL 40

Expert Comment

by:noci
ID: 36537658
I have worked with apache (long time ago), now using lighttpd.
I intend to work with diaspora..., ruby base so that's probably a future thing.


About nobody that is effectively the default:
As it is per documentation:
http://wiki.nginx.org/NginxHttpMainModule#user

So add a line: user www-data www-data
in the global config area.
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:Westez
ID: 36539486
It may already be in there.  How's this look?

server:/etc/nginx# cat nginx.conf
user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
0
 
LVL 40

Accepted Solution

by:
noci earned 2000 total points
ID: 36539998
yes on line 2 of the config.

Now regarding passenger, (not running it myself)

   http://www.modrails.com/documentation/Users%20guide%20Nginx.html

is the manual specific to nginx integrating with passenger...  (nginx needs extra support for passenger statements)
Also the username needs to be put in passenger configs, but the spelling is different from your question;

passenger_default_user
passenger_user
passenger_default_group
(including the _ 's)
0
 

Author Comment

by:Westez
ID: 36545187
Many thanks, I added passenger_default_user to the passenger.conf file and restarted nginx.  No errors on the restart.  And I was able to upload a couple of files.  And the owner of the files is www-data. So it's looking good to me.  I'm waiting on the users to test it and confirm it works for them.
0
 

Author Closing Comment

by:Westez
ID: 36546427
Thanks again for your help.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question