Search code examples
ruby-on-railsrubyubuntuproduction-environmentthin

Rails-Thin server stopped on Production(live) mode.Website down


I have put my ruby on rails project on production mode.I was running thin on production mode.Now suddenly the thin server seems to stop and give the following error while trying to start:-

/home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:158:in `delete': Read-only file system - tmp/pids/thin.3000.pid (Errno::EROFS)

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:158:in `remove_pid_file'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:175:in `remove_stale_pid_file'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:43:in `daemonize'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/controllers/controller.rb:62:in `start'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/thin:23:in `load'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/thin:23:in `<main>'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/ruby_executable_hooks:15:in `eval'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/ruby_executable_hooks:15:in `<main>'

I tried to delete the pid by using $ lsof -wni tcp:3000..But am not getting any output for it. Also went through filezilla and tried to delete the pids from temp but am getting the following error.General failure (server should provide error description).

Now my website is down for an hour Please help me with this


Solution

  • The immediate error is that your program couldn't remove the old pid file. Each process running on your computer has a number associated with it; servers often save this number to a file, to stop two running simultaneously.

    The error message you got, though - "Read-only file system" - is rarely a good sign. If your computer encounters hard drive problems, it may remount the file system as read-only to prevent further damage. The output of dmesg may give you an idea whether this is the case here. You can probably get your server back up and running by rebooting it, but you need to be on the lookout for an imminent hard drive failure.