mifflin has asked for the wisdom of the Perl Monks concerning the following question:

I've been trying to make the DBI Proxy feature work but have run into a snag. I am able to successfully connect from one sun box to another but I am unable to connect from my WIN32 (XP) box to the sun box.
I've started my dbi proxy server with the followning...
dbiproxy --localport 3333 --mode fork --debug
and I am able to connect to this server from another sun box and issue a select statement successfully with the following code...
use warnings; use strict; use DBI; DBI->trace(3); my $dbh = DBI->connect( "dbi:Proxy:hostname=isfe;port=3333;dsn=dbi:Oracle:xxxx", 'xxxx', 'xxxx', {RaiseError => 1, PrintError => 0, AutoCommit => 0} ); my $sql = 'select id, str from sfile'; my $csr = $dbh->prepare($sql); $csr->execute(); while (my ($id, $str) = $csr->fetchrow_array) { print "$id = $str\n"; } $dbh->disconnect();
But when I run the same code from my XP desktop (actually laptop) I am not able to connect.
Here is the trace dump...
DBI 1.43-ithread default trace level set to 0x0/3 (pid 296) -> DBI->connect(dbi:Proxy:hostname=isfe;port=3333;dsn=dbi:Oracle:p +rod, mwh, ****, HASH(0x15d5338)) -> DBI->install_driver(Proxy) for MSWin32 perl=5.008004 pid=296 ru +id=0 euid=0 install_driver: DBD::Proxy version 0.2004 loaded from C:/Perl/s +ite/lib/DBD/Proxy.pm New DBI::dr (for DBD::Proxy::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x1b58580)=>DBI::dr=HASH(0x1b08af8) +, DBD::Proxy::dr, 0, Null!) dbih_make_com(Null!, 0, DBD::Proxy::dr, 112, 0) thr#15d4594 <- install_driver= DBI::dr=HASH(0x1b58580) -> connect for DBD::Proxy::dr (DBI::dr=HASH(0x1b58580)~0x1b08af8 ' +hostname=isfe;port=3333;dsn=dbi:Oracle:prod' 'mwh' **** HASH(0x1cf247 +c)) thr#15d4594 1 -> set_err in DBD::_::common for DBD::Proxy::dr (DBI::dr=HASH(0x1b +08af8)~INNER 1 'Cannot log in to DBI::ProxyServer: Unexpected EOF fro +m server at C:/Perl/site/lib/RPC/PlClient.pm line 84. ' ' ') thr#15d4594 !! ERROR: 1 'Cannot log in to DBI::ProxyServer: Unexpected EOF fro +m server at C:/Perl/site/lib/RPC/PlClient.pm line 84. ' (err#1) 1 <- set_err= undef at Proxy.pm line 73 !! ERROR: 1 'Cannot log in to DBI::ProxyServer: Unexpected EOF fro +m server at C:/Perl/site/lib/RPC/PlClient.pm line 84. ' (err#1) <- connect= undef at DBI.pm line 595 -> $DBI::errstr (&) FETCH from lasth=HASH >> DBD::Proxy::dr::errstr <- $DBI::errstr= 'Cannot log in to DBI::ProxyServer: Unexpected EO +F from server at C:/Perl/site/lib/RPC/PlClient.pm line 84. ' DBI connect('hostname=isfe;port=3333;dsn=dbi:Oracle:prod','mwh' +,...) failed: Cannot log in to DBI::ProxyServer: Unexpected EOF from +server at C:/Perl/site/lib/RPC/PlClient.pm line 84. DBI connect('hostname=isfe;port=3333;dsn=dbi:Oracle:prod','mwh',...) f +ailed: Cannot log in to DBI::ProxyServer: Unexpected EOF from server +at C:/Perl/site/lib/RPC/PlClient.pm line 84. at test.pl line 7 -- DBI::END -> disconnect_all for DBD::Proxy::dr (DBI::dr=HASH(0x1b58580)~0x1b +08af8) thr#15d4594 <- disconnect_all= (not implemented) at DBI.pm line 674 via test.p +l line 0 ! -> DESTROY for DBD::Proxy::dr (DBI::dr=HASH(0x1b08af8)~INNER) thr# +15d4594 ! <- DESTROY= undef during global destruction ! <> DESTROY for DBI::dr=HASH(0x1b58580) ignored (inner handle gone)
I always seem to get the error "...Cannot log in to DBI::ProxyServer: Unexpected EOF..."
Any Idea's?

Update:
just in case someone wonders, yes, it does appear that I have connectivity to the isfe unix box from my pc...
>ping isfe Pinging isfe.csc.hdsupply.com [172.25.209.30] with 32 bytes of data: Reply from 172.25.209.30: bytes=32 time<10ms TTL=254 Reply from 172.25.209.30: bytes=32 time<10ms TTL=254 Reply from 172.25.209.30: bytes=32 time<10ms TTL=254 Reply from 172.25.209.30: bytes=32 time<10ms TTL=254 Ping statistics for 172.25.209.30: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms

Replies are listed 'Best First'.
Re: DBI Proxy connection prob
by tachyon (Chancellor) on Oct 04, 2004 at 22:48 UTC

    Any Idea's?

    Firewall issue? Ping proves you can get to your remote box using ICMP, not make a TCP connection on port 3333. Try telnetting into 3333.

    C:\> telnet isfe 3333
      I can run this small test server on my unix box
      #!/home/utils/perl/bin/perl use strict; use warnings; use IO::Socket; my $server = IO::Socket::INET->new(LocalPort => 4444, Reuse => 1, List +en => 10); die $@ unless $server; print "waiting for a connection\n"; while (my $client = $server->accept()) { my $line = <$client>; print $line; close($client); }
      And run this test client on my Win XP box...
      use strict; use warnings; use IO::Socket; my $socket = IO::Socket::INET->new(PeerAddr => 'isfe', PeerPort => 4444, Type => SOCK_STREAM); die $@ unless $socket; print $socket "hello\n"; close($socket);
      And successfully receive a message.
      erickn@isfe:/home/erickn> server1.pl waiting for a connection hello
      Does this prove I don't have a firewall issue?

      Update:
      this test shows me using port 4444 instead of 3333. However, I have also run it as 3333 and I get the same results.

        Well it proves connectivity on port 4444 which is not what you were using. This is pedantic but important. To prove that you can connect to isfe:3333 you actually need to connect to isfe:3333. You don't need a script, just telnet will do. You will either see it flip to a blank screen (or a header message in some cases but not this one) or give you a connection timed out message. You can open or firewall any port so it is an important sanity check.

        Anyway assuming that all is connective on 3333 the it is time to RTFS. If you grok the RPC::PlClient source around the line noted or just for the error message you will see it comes from the new() function.

      What does the Telnet test tell me?
      Here is the attempt...
      C:\erick>telnet isfe 3333 Connecting To isfe...Could not open a connection to host on port 3333 +: Connect failed
      If I don't have a telnet service accepting connections on 3333, how would this test ever work?

      Update:
      However, running the telnet command with out the port does work.
      SunOS 5.9 login: erickn Password: Last login: Mon Oct 4 16:30:59 from rmtislt054.csc. erickn@isfe:/home/erickn> exit Connection to host lost. C:\Documents and Settings\erickn>
      but doesn't that just test the default telnet port (whatever that is)?

        You are confusing telnet the client program and telnet the protocol/server. They are *different*. Telnet the program is just making a socket connection for you and displaying the IO in a shell type environment. You can't get a connection on 3333 which is the problem. Your script will fail to get a socket on 3333 as well. FIREWALL or DEAD DEAMON is the reason it does not work. Anyway telnet can connect to any socket server, You can telnet into your SMTP server on 25, HTTP server on 80, POP3 server on 110 or *any other socket server on any other port*. If you know the protocol you can talk to them. For example I can send myself email via telnet (the program, not the protocol/server) connecting to an SMTP server on port 25 because I know the protocol (I typed the HELO, MAIL FROM, RCPT TO, DATA, blah . , QUIT lines). Knowing basic SMTP and POP3 etc is often useful to debug connectivity issues FWIW. Rather than just ping you telnet into the server and say Gday.