Cannot start the sinatra process - eventmachine "no acceptor"

I have a Sinatra application that I run as a daemon using Apache port forwarding to mediate between port 80 and port 7655. In the past, it worked fine. Today is not so good. I can’t understand why.

Problem: sudo ruby my_process.rb returns:

 /var/lib/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError) 

Tried: updating all system packages, updating all gems. No help (other than a clearer error message from eventmachine).

When I run sudo lsof -i :7655 , I get nothing. When I run sudo ps aux , I don't see any Ruby processes at all. Which I find very irregular given the nature of the error message!

So I don’t understand something, finding out why the port is unavailable?


also:

Tried to change ports, nothing. I wonder if this is related to "localhost"? When I ping localhost, I get all the dropped packets. This does not seem normal.

+6
source share
1 answer

Prints these two lines in the main Sinatra script, providing great information:

 set bind: "localhost" set port: 7655 

The problem was in localhost. The loopback interface has been configured incorrectly. ifconfig showed the lo interface, but it was not assigned IP 127.0.0.1 . To solve this problem, the following commands were executed on the command line (on Linux Ubuntu):

 ifdown lo ifup lo 
+2
source

Source: https://habr.com/ru/post/926612/


All Articles