#84 open
Steve Purcell

Relative path for --socket option fails

Reported by Steve Purcell | October 2nd, 2008 @ 11:19 AM | in Future

When there's no "/" in the path given to "--socket", the error message is very confusing.

It should be possible (IMO) to pass a relative path to the --socket option without explicitly including a leading "./".

% thin start --socket socket -e production -c ../../app/
>> Using rails adapter
>> Thin web server (v1.0.0 codename That's What She Said)
>> Maximum connections set to 1024
>> Listening on socket:3000, CTRL+C to stop
/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/lib/eventmachine.rb:531:in `start_tcp_server': no acceptor (RuntimeError)
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/lib/eventmachine.rb:531:in `start_server'
	from /opt/local/lib/ruby/gems/1.8/gems/thin-1.0.0/lib/thin/backends/tcp_server.rb:16:in `connect'
	from /opt/local/lib/ruby/gems/1.8/gems/thin-1.0.0/lib/thin/backends/base.rb:49:in `start'

Comments and changes to this ticket

  • Michael Klishin (antares)

    Michael Klishin (antares) October 2nd, 2008 @ 04:50 PM

    I believe this exception is from EventMachine.

  • macournoyer

    macournoyer October 2nd, 2008 @ 04:56 PM

    • State changed from “new” to “open”
    • Tag set to usability

    It really is a Thin issue cause it tries to open a TCP connection: ...start_tcp_server... That's because Thin seek for a slash in the hostname to determine if it's a socket. --socket is just an alias for --host.

    socket => tcp host ./socket => unix socket

    I know that's not intuitive, that's I want to fix it.

  • Marty McGee

    Marty McGee November 4th, 2008 @ 12:26 PM

    Just wanted to post a workaround for this issue...

    I'm not sure about the "--socket" stuff that macournoyer is speaking of, but my issue was that their was a lurking thin process on the server running on the same port I was trying to configure -- apparently this process was not killed upon stopping the thin server. So, the thin.3000.pid file was not being created upon configuration (sudo thin config -C /etc/thin/domain.com.yml -c /home/user/public_html/domain.com/ --servers 1 -e production), and thus throwing this error start_tcp_server': no acceptor (RuntimeError). In fact, there is "no acceptor" because there is no thin.XXXX.pid file to accept the tcp start request.

    The workaround is to simply kill the lurking running thin process by:

    ps -ef | grep thin sudo kill XXXXX (whatever lurking thin process id is running) then configure thin app (sudo thin config ...) so the thin.3000.pid file is created. then start the thin server (sudo /etc/init.d/thin start)

    :-) Marty McGee

  • Marty McGee

    Marty McGee November 4th, 2008 @ 12:29 PM

    Sorry about the formatting...

    The workaround (again) is:

    Search for lurking running thin process: ps -ef | grep thin

    Kill it: sudo kill XXXXX (the process id)

    Run thin config within application home: sudo thin config -C /etc/thin/domain.com.yml -c /home/user/public_html/domain.com/ --servers 1 -e production

    Start thin server: sudo /etc/init.d/thin start

    Thanks, Marty McGee

  • Steve Purcell

    Steve Purcell November 4th, 2008 @ 02:20 PM

    Erm, Marty, your comments appear to have been meant for a different ticket, because they have nothing to do with this one. :-)

  • macournoyer

    macournoyer November 4th, 2008 @ 08:15 PM

    a simple workaround is to prepend ./ to the socket name you want to use if no slash is in the filename already, eg.:

    thin start --socket ./sockfile

  • HenryMitchell

    HenryMitchell May 22nd, 2021 @ 07:45 AM

    An elegant option for failure is formed for all joys. The initial element of the https://www.instapaper.com/p/8831491 is fit for the branches. The plant is fired for the realms. The class is done for the host of the gaols for all projects for the ticket holders and element for all humans.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป