Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-09-13
7
Medium Priority
?
2,727 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
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

916 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