Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m confused

RoR + Mongrel + Nginx => 500 internal server error

Have just build an ec2 server with ror+mongrel+nginx - deployed the rails app using capistrano and your deploy.rb but when I try to access the page on port 9000 I got:

/!\ FAILSAFE /!\ Sat Oct 25 22:07:29 +0000 2008
Status: 500 Internal Server Error
file /tmp/ruby_sess.d621d64e8b2f655e not readable

No idea on how to solve this issue.
1 person has
this problem
+1
Reply
  • Pat K (Official Rep) October 25, 2008 22:36
    To narrow this down can you check out a couple things.
    SSH into your server using the password for cftuser that you were emailed about your server assembly. Use sudo to become superuser (sudo su)

    1) Then, could you check that there is space left in your filesystem.
    2) Check to see if that file is in tmp and what its permissions are
    3) And then - depending on those answers it might be worth wacking the contents of /tmp and try again.

    Then we will take it from there.
    • Thanks for your prompt reply.

      1) The server is basically empty
      Filesystem 1K-blocks Used Available Use% Mounted on
      /dev/sda1 10079084 478908 9088176 6% /
      tmpfs 870472 0 870472 0% /lib/init/rw
      tmpfs 870472 4 870468 1% /dev/shm
      /dev/sda2 153899044 192072 145889348 1% /mnt
      none 870472 4 870468 1% /dev/shm

      2) The ruby session files are:
      -rw------- 1 root root 159 Oct 25 22:07 /tmp/ruby_sess.1f1c98f550b29467
      -rw------- 1 root root 159 Oct 25 22:07 /tmp/ruby_sess.d621d64e8b2f655e

      3) I have tried to rm them but the problem happen again when I start the rails app. It looks like those files are created with the root user and then accessed by another one (maybe cftuser?)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Pat K (Official Rep) October 25, 2008 23:18
    Pinging other members of the team for their thoughts...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Try chown mongrel /tmp/ruby_sess.* and retry.

    In Elastic Server out of the box, both nginx and mongrels are configured to run as user mongrel (uid=200).

    This may not be the root cause of the problem however, because I can't explain how the files are created with root ownership. How do you start the rails app? You could use Elastic Server Manager to start and stop services (it's a web admin console running on port 2999), or /etc/init.d/cft-rails-nginx [start|stop].

    Could you please show output of ps auxww | egrep 'nginx|mongrel' ?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated