Skip Menu |

This queue is for tickets about the Net-CLI-Interact CPAN distribution.

Report information
The Basics
Id: 86772
Status: resolved
Priority: 0/
Queue: Net-CLI-Interact

People
Owner: Nobody in particular
Requestors: ze [...] anime.is
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Wrapper bug when called from Dancer
Date: Mon, 8 Jul 2013 10:30:39 +0000
To: bug-Net-CLI-Interact [...] rt.cpan.org
From: Freyr Guðjónsson <ze [...] anime.is>
Running: Net::CLI::Interact 2.131260 Net::Appliance::Session 4.131260 Dancer 1.3116 Perl v5.14.2 Kali Linux (debian) Linux freyrg-kali 3.7-trunk-amd64 #1 SMP Debian 3.7.2-0+kali8 x86_64 GNU/Linux When running Net::Appliance::Session from within a Dancer webapp has some unexpected behavior. When using Telnet to connect to Cisco equipment the process runs fine, however when using SSH it seems like Net::CLI::Interact loses it's handle for the output of SSH. This causes the output to come in the console for the Dancer app and won't be caught by the wrapper. This causes the connection to time out. Output from Dancer is something like this: [29146] core @0.001174> [hit #1]Trying to match 'POST /setup/metro' against /^\/setup\/metro$/ (generated from '/setup/metro') in /usr/local/share/perl/5.14.2/Dancer/Route.pm l. 84 [29146] core @0.001272> [hit #1] --> got 1 in /usr/local/share/perl/5.14.2/Dancer/Route.pm l. 102 user: freyrg, pass: Qwert2asd, einhver config [ 0.005539] pr finding prompt [ 0.007692] tr creating Net::Telnet wrapper for ssh [ 0.008438] tr connecting with: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -T -l freyrg a001 [ 0.504995] pr output matching prompt was "Password: " [ 0.508555] pr finding prompt Unauthorized Access not allowed, connections are logged and monitored. A001-S#[ 11.517640] pr failed: [read timed-out at /usr/local/share/perl/5.14.2/Net/CLI/Interact/Transport/Wrapper/Net_Telnet.pm line 35 ], sending WAKE_UP and trying again [ 11.517940] pr finding prompt [29146] error @22.602266> [hit #1]request to POST /setup/metro crashed: login failed to remote host - prompt does not match at /usr/local/share/perl/5.14.2/Net/Appliance/Session/Transport.pm line 78. in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 98 [29146] core @22.603594> [hit #1]response: 500 in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 179 As can be seen, after logging in with the password, it starts looking for the prompt, but that's when the router output starts coming into the console, and then finally the log from Net::CLI::Interact states that it has timed out, then the POST route crashes in Dancer. I
Subject: Re: [rt.cpan.org #86772] Wrapper bug when called from Dancer
Date: Wed, 25 Sep 2013 14:38:11 +0100
To: <bug-net-cli-interact [...] rt.cpan.org>
From: Oliver Gorwits <oliver [...] cpan.org>
Hi, My advice is not to use the module directly from within the web application. I believe there are buffer issues/limitations which cause this behaviour. If you put the Net::Appliance::Session code into an external script and call that from the web server code, it might be better. regards, oliver. On 2013-07-08 11:30, Freyr Guðjónsson via RT wrote: Show quoted text
> Mon Jul 08 06:30:57 2013: Request 86772 was acted upon. > Transaction: Ticket created by ze@anime.is > Queue: Net-CLI-Interact > Subject: Wrapper bug when called from Dancer > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: ze@anime.is > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86772 > > > > Running: > Net::CLI::Interact 2.131260 > Net::Appliance::Session 4.131260 > Dancer 1.3116 > Perl v5.14.2 > Kali Linux (debian) > Linux freyrg-kali 3.7-trunk-amd64 #1 SMP Debian 3.7.2-0+kali8 x86_64 > GNU/Linux > > > When running Net::Appliance::Session from within a Dancer webapp has > some > unexpected behavior. When using Telnet to connect to Cisco equipment > the > process runs fine, however when using SSH it seems like > Net::CLI::Interact > loses it's handle for the output of SSH. This causes the output to > come in > the console for the Dancer app and won't be caught by the wrapper. > This > causes the connection to time out. > > Output from Dancer is something like this: > > [29146] core @0.001174> [hit #1]Trying to match 'POST /setup/metro' > against /^\/setup\/metro$/ (generated from '/setup/metro') in > /usr/local/share/perl/5.14.2/Dancer/Route.pm l. 84 > [29146] core @0.001272> [hit #1] --> got 1 in > /usr/local/share/perl/5.14.2/Dancer/Route.pm l. 102 > user: freyrg, pass: Qwert2asd, einhver config > [ 0.005539] pr finding prompt > [ 0.007692] tr creating Net::Telnet wrapper for ssh > [ 0.008438] tr connecting with: ssh -o StrictHostKeyChecking=no -o > UserKnownHostsFile=/dev/null -o CheckHostIP=no -T -l freyrg a001 > [ 0.504995] pr output matching prompt was "Password: " > [ 0.508555] pr finding prompt > > Unauthorized Access not allowed, connections are logged and > monitored. > > A001-S#[ 11.517640] pr failed: [read timed-out at > > /usr/local/share/perl/5.14.2/Net/CLI/Interact/Transport/Wrapper/Net_Telnet.pm > line 35 > ], sending WAKE_UP and trying again > [ 11.517940] pr finding prompt > [29146] error @22.602266> [hit #1]request to POST /setup/metro > crashed: > login failed to remote host - prompt does not match at > /usr/local/share/perl/5.14.2/Net/Appliance/Session/Transport.pm line > 78. in > /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 98 > [29146] core @22.603594> [hit #1]response: 500 in > /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 179 > > > > As can be seen, after logging in with the password, it starts looking > for > the prompt, but that's when the router output starts coming into the > console, and then finally the log from Net::CLI::Interact states that > it > has timed out, then the POST route crashes in Dancer. > > I