Re: [Twisted-Python] 111: Connection refused

Hi Itamar,
--- Itamar Shtull-Trauring itamar@itamarst.org wrote:
On Tue, 2004-08-03 at 15:23, Damon Fasching wrote:
- Can you telnet to this port?
No, but I can't telnet into the machine on which everything works either. No daemon.
Telnet to the port where PB is running I mean. e.g. telnet host 9767.
I can't telnet into the PB port on either machine; the machine where PB does accept connections or the one where it doesn't. Wouldn't I need telnetd running to do this even if I specify the port?
In any case, AFAICT this a configuration issue on your side, and not a Twisted bug.
Right. I didn't post this as a bug and indicated that I think the problem is with my network configuration. (That's why I was poking around in /etc) However, not being familiar with Redhat (I use Debian) I don't know where to look. The config files I compared look the same on both machines, so I must not be looking in the right place. Because this mailing list is repleat with networking experts, I thought it would be a good place to ask. Some of the other non-experts here may benefit from a solution, too.
Can anyone tell me what I need to have enabled/set/configured in order for my Redhat box to accept connections on a PB server?
Thanks, Damon
-- Itamar Shtull-Trauring http://itamarst.org

On Aug 3, 2004, at 4:16 PM, Damon Fasching wrote:
Hi Itamar,
--- Itamar Shtull-Trauring itamar@itamarst.org wrote:
On Tue, 2004-08-03 at 15:23, Damon Fasching wrote:
- Can you telnet to this port?
No, but I can't telnet into the machine on which everything works either. No daemon.
Telnet to the port where PB is running I mean. e.g. telnet host 9767.
I can't telnet into the PB port on either machine; the machine where PB does accept connections or the one where it doesn't. Wouldn't I need telnetd running to do this even if I specify the port?
No. telnet simply establishes a tcp connection on that port. So for example, to 'manually' pull a page from a webserver you can do:
telnet www.example.com 80
and then when the prompt returns issue an HTTP request manually a la:
GET / HTTP/1.0
In this case, telnet'ing to the port that your server is supposedly binding to will establish whether or not anything is bound to the specified port. You should also run 'netstat -an | grep LISTEN' on your server and look for the port number that you are trying to bind to.
Can anyone tell me what I need to have enabled/set/configured in order for my Redhat box to accept connections on a PB server?
I think you need to figure out what the problem is first. Is the server not binding? Is it firewalled off, etc.
George

On Tue, Aug 03, 2004 at 01:16:21PM -0700, Damon Fasching wrote:
Hi Itamar,
--- Itamar Shtull-Trauring itamar@itamarst.org wrote:
Telnet to the port where PB is running I mean. e.g. telnet host 9767.
I can't telnet into the PB port on either machine; the machine where PB does accept connections or the one where it doesn't. Wouldn't I need telnetd running to do this even if I specify the port?
No, telnet just opens a socket. You can telnet to any port, and it will establish a connection if the port is open. You can even send messages to text-based protocols, such as HTTP, for instance (I've marked the lines I typed, the rest is the reply from the server):
$ telnet www.twistedmatrix.com 80 Trying 198.49.126.190... Connected to twistedmatrix.com. Escape character is '^]'. -> HEAD / HTTP/1.0 -> HTTP/1.0 200 OK Last-Modified: Tue, 03 Aug 2004 09:13:39 GMT Content-Length: 6507 Date: Tue, 03 Aug 2004 20:31:12 GMT Accept-Ranges: bytes Content-Type: text/html Server: TwistedWeb/SVN-trunk X-Cache: MISS from home.puzzling.org X-Cache-Lookup: MISS from home.puzzling.org:3128 Connection: close
Connection closed by foreign host.
But if you telnet to a port that isn't open, you'd get:
$ telnet localhost 1234 Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused
Judging from the errors you're seeing, I'd expect that telnet to your PB port on one machine would give the "Connected to foo." message, and the other would give "Unable to connect to remote host: Connection refused". Also, try doing these telnets from a different machine and also locally from the machines running the PB server, you should get the same results, but if you don't, that might hint at where the problem is.
[...]
Can anyone tell me what I need to have enabled/set/configured in order for my Redhat box to accept connections on a PB server?
Well, it depends on what the problem is, and we still don't know that. It also depends on what your PB server actually is; there's not really any such thing as a plain "PB server"; that doesn't really tell us anything about what it is or how it should run. What application is this PB server? Is it run by twistd (and if so, from a tap or a tac)? Or is it a script that calls reactor.run() directly? Etc.
Have you looked in the log files for the service on both machines? Perhaps the service is simply failing to start on one, in which case the reason should be logged there.
You could also try "netstat -ntlp", and see if there is a process listening on that port, and if so, is it listening on the right interface (probably 0.0.0.0), and is it the right process.
-Andrew.
participants (3)
-
Andrew Bennetts
-
Damon Fasching
-
George Schlossnagle