Newbie problems

Eric Wong normalperson at yhbt.net
Tue Mar 16 14:10:28 EDT 2010


Matt Davies <mjdavies at glam.ac.uk> wrote:
> Hello everyone
> 
> I'm trying out Unicorn at the moment, I've used nginx and passenger extensively for some time now but I fancy a change :-). 
> 
> Here's the specs
> 
> nginx version: nginx/0.7.65
> ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0]
> unicorn (0.97.0)
> rails 2.3.5
> bundler 0.9.7
> 
> When I run unicorn_rails from within the app root it all starts fine, and nginx proxies the requests over to unicorn, all hunky dorey.
> 
> But, I can't get unicorn to start properly with a config file, even if the file is empty.
> 
> Here's the error I'm getting back when trying to start unicorn_rails
> 
> sudo unicorn_rails -c /path/to/unicorn.rb -E production -D -d
> {:app=>
>   #<Proc:0x000000010118dd80@/usr/local/lib/ruby/gems/1.8/gems/unicorn-0.97.0/bin/unicorn_rails:120>,
>  :unicorn_options=>
>   {:config_file=>"/path/to/unicorn.rb",
>    :listeners=>[]},
>  :daemonize=>true}
> Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/cache
> Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/pids
> Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sessions
> Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sockets
> Exception `EOFError' at /usr/local/lib/ruby/gems/1.8/gems/unicorn-0.97.0/lib/unicorn/launcher.rb:45 - end of file reached

> master failed to start, check stderr log for details

Hi Matt,

Was there anything else in the stderr output?  Does starting
unicorn_rails without "-D" work (or show you more info)?  Daemonizing
will redirect stderr to /dev/null unless you explicitly set
"stderr_path" in your config file.

> I've switched logging on in the config file like so
> 
> logger Logger.new("log/unicorn.log")
> 
> all that shows in that log is
> 
> I, [2010-03-16T10:01:08.250818 #1824]  INFO -- : listening on addr=0.0.0.0:8080 fd=5

If your application fails to load, the application probably spews
the error messages to stderr instead of the Unicorn logger, which
is only for Unicorn-only messages.

> Nginx however is throwing this error
> 
> 2010/03/16 09:21:42 [error] 1539#0: *1 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: ipaddress, server: machinename, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "machinename"

Try getting more info out of stderr first, since there appears to
be a problem with the startup.

But after that, what happens when you hit http://127.0.0.1:8080/ with
curl from that host?

> I'm sure I must be doing something very silly, I've searched the mailing list but can't find anything that is specific to this issue.

No worries.  Also, if you leave out the -D switch, you can try
truss/strace/dtrace-ing the process if you still don't get enough
information.

-- 
Eric Wong


More information about the mongrel-unicorn mailing list