Skip Menu |

This queue is for tickets about the Net-SFTP-Foreign CPAN distribution.

Report information
The Basics
Id: 69820
Status: resolved
Worked: 4 hours (240 min)
Priority: 0/
Queue: Net-SFTP-Foreign

People
Owner: salva [...] cpan.org
Requestors: jorge.gonzalez [...] daikon.es
Cc:
AdminCc:

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



The following code does not work: #!/usr/bin/perl -w use Net::SFTP::Foreign; my $sftp = Net::SFTP::Foreign->new( host => 'localhost', port => 22, user => 'jorgegv', password => 'XXXXXXXX', ); $sftp->error and die "Error en conexión SFTP: " . $sftp->error; warn('Conexion SFTP correcta'); --------------- [jorgegv@desarrollo3 script]$ perl test-sftp.pl Error en conexión SFTP: Bad ssh command: Desplazamiento ilegal at test- sftp.pl line 11. Installed on Perl 5.14.1. Version 1.58_07 worked OK.
From: jorge.gonzalez [...] daikon.es
El Mar Jul 26 14:03:16 2011, jorgegv escribió: Show quoted text
> The following code does not work: > > #!/usr/bin/perl -w > > use Net::SFTP::Foreign; > > my $sftp = Net::SFTP::Foreign->new( > host => 'localhost', > port => 22, > user => 'jorgegv', > password => 'XXXXXXXX', > ); > $sftp->error and die "Error en conexión SFTP: " . $sftp->error; > warn('Conexion SFTP correcta'); > > --------------- > > [jorgegv@desarrollo3 script]$ perl test-sftp.pl > Error en conexión SFTP: Bad ssh command: Desplazamiento ilegal at
test- Show quoted text
> sftp.pl line 11. > > Installed on Perl 5.14.1. > Version 1.58_07 worked OK.
Well, 1.58_07 worked on 5.8.8, didn't test on 5.14.1. In fact, I have tried versions 1.62 and 1.58:07 and neither of them works on 5.14.1. Sorry for the inconvenience, looks like some incompatibility in perl 5.14.1. I have somehow traced it to the open3 system call in Backend/Unix.pm, but can't get further. Any help would be very much appreciated.
Subject: Re: [rt.cpan.org #69820]
Date: Tue, 26 Jul 2011 11:30:05 -0700 (PDT)
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
>________________________________ >From: Jorge Gonzalez via RT <bug-Net-SFTP-Foreign@rt.cpan.org> >To: >Sent: Tuesday, July 26, 2011 8:03 PM >Subject: [rt.cpan.org #69820] > >Tue Jul 26 14:03:16 2011: Request 69820 was acted upon. >Transaction: Ticket created by jorgegv >      Queue: Net-SFTP-Foreign >    Subject: (No subject given) >  Broken in: 1.67 >    Severity: Critical >      Owner: Nobody >  Requestors: jorge.gonzalez@daikon.es >      Status: new >Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=69820 > > > >The following code does not work: > >#!/usr/bin/perl -w > >use Net::SFTP::Foreign; > >my $sftp = Net::SFTP::Foreign->new( >  host      => 'localhost', >  port      => 22, >  user      => 'jorgegv', >  password  => 'XXXXXXXX', >  ); >$sftp->error and die "Error en conexión SFTP: " . $sftp->error; >warn('Conexion SFTP correcta'); > >--------------- > >[jorgegv@desarrollo3 script]$ perl test-sftp.pl >Error en conexión SFTP: Bad ssh command: Desplazamiento ilegal at test- >sftp.pl line 11. > >Installed on Perl 5.14.1. >Version 1.58_07 worked OK. >
Hola, Activa la opcion de depurado añadiendo la siguiente linea al principio del script:     $Net::SFTP::Foreign = -1; y mandame la salida. Tambien me ayudaria bastante que me enviases una captura de lo que hace el script a nivel de sistema operativo utilizando strace (no hace falta que utilices la clave real, Net::SFTP::Foreign no esta llegando a la fase de login):     strace -f -o /tmp/out perl /donde/esta/el/script.pl - Salva
Subject: Re: [rt.cpan.org #69820]
Date: Wed, 27 Jul 2011 09:25:10 +0200
To: bug-Net-SFTP-Foreign [...] rt.cpan.org
From: Jorge Gonzalez <jorge.gonzalez [...] daikon.es>
Hola Salva, me he imaginado que la variable a activar es $Net::SFTP::Foreign::debug, y no $Net::SFTP::Foreign, como indicas en tu correo. He añadido esto: $net::SFTP::Foreign::debug = -1; al principio del script. La salida es esta: [jorgegv@desarrollo3 script]$ perl test-sftp.pl #26177 1311750706.00000 _init_transport: ssh cmd: ssh -p 22 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=keyboard-interactive,password -l jorgegv localhost -s sftp #26177 1311750706.00000 _conn_lost: _conn_lost #26177 1311750706.00000 _set_status: _set_status code: 6, str: No connection #26177 1311750706.00000 _set_error: _set_err code: 37, str: Bad ssh command: Desplazamiento ilegal Error en conexión SFTP: Bad ssh command: Desplazamiento ilegal at test-sftp.pl line 12. #26177 1311750706.00000 DESTROY: Net::SFTP::Foreign=HASH(0x9a20248)->DESTROY called (current pid: 26177, disconnect_by_pid: ) #26177 1311750706.00000 disconnect: Net::SFTP::Foreign=HASH(0x9a20248)->disconnect called (ssh pid: ) #26177 1311750706.00000 _conn_lost: _conn_lost Te adjunto la salida del strace que me pides. Por lo que parece, el programa esta haciendo varios _llseek en descriptores que han sido creados previamente con "pipe" (que me imagino que vienen de la llamada a open3 de tu modulo), y que dan errores de "Illegal seek", que es lo que al final se ve en la traza de Perl (ver traza del proceso 26181). Supongo que es normal, en una pipe no se puede hacer "seek", aunque quiza POSIX permite hacerlo si el valor es SEEK_CUR... Bueno, a ver que te parece a ti. Por cierto, he hecho mas anotaciones en el bug de RT: las versiones 1.58_07 y 1.62 tampoco funcionan (las he instalado desde Backpan), parece un problema con la version de Perl en concreto (la 5.14.1). Cuando funcionaba con la version 1.58_07 era sobre perl 5.8.8. El SO sobre el que estan hechas todas las pruebas es CentOS 5.5. Muchas gracias por la rapidez en contestar. Saludos Jorge */Jorge González Villalonga/* Director Técnico */DAIKON Integración y Desarrollo S.L./* Telf: (+34) 91 188 08 28 Fax: (+34) 91 632 65 42 *www.daikon.es* El 26/07/11 20:30, Salvador \"Fandiño\" via RT escribió: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=69820> > > > > > > >
>> ________________________________ >> From: Jorge Gonzalez via RT<bug-Net-SFTP-Foreign@rt.cpan.org> >> To: >> Sent: Tuesday, July 26, 2011 8:03 PM >> Subject: [rt.cpan.org #69820] >> >> Tue Jul 26 14:03:16 2011: Request 69820 was acted upon. >> Transaction: Ticket created by jorgegv >> Queue: Net-SFTP-Foreign >> Subject: (No subject given) >> Broken in: 1.67 >> Severity: Critical >> Owner: Nobody >> Requestors: jorge.gonzalez@daikon.es >> Status: new >> Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=69820> >> >> >> The following code does not work: >> >> #!/usr/bin/perl -w >> >> use Net::SFTP::Foreign; >> >> my $sftp = Net::SFTP::Foreign->new( >> host => 'localhost', >> port => 22, >> user => 'jorgegv', >> password => 'XXXXXXXX', >> ); >> $sftp->error and die "Error en conexión SFTP: " . $sftp->error; >> warn('Conexion SFTP correcta'); >> >> --------------- >> >> [jorgegv@desarrollo3 script]$ perl test-sftp.pl >> Error en conexión SFTP: Bad ssh command: Desplazamiento ilegal at test- >> sftp.pl line 11. >> >> Installed on Perl 5.14.1. >> Version 1.58_07 worked OK. >> >>
> Hola, > > Activa la opcion de depurado añadiendo la siguiente linea al principio del script: > > $Net::SFTP::Foreign = -1; > > y mandame la salida. > > Tambien me ayudaria bastante que me enviases una captura de lo que hace el script a nivel de sistema operativo utilizando strace (no hace falta que utilices la clave real, Net::SFTP::Foreign no esta llegando a la fase de login): > > strace -f -o /tmp/out perl /donde/esta/el/script.pl > > > - Salva > >

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #69820]
Date: Wed, 27 Jul 2011 03:58:03 -0700 (PDT)
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>

Message body is not shown because it is too large.

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #69820]
Date: Wed, 27 Jul 2011 13:30:19 +0200
To: bug-Net-SFTP-Foreign [...] rt.cpan.org
From: Jorge Gonzalez <jorge.gonzalez [...] daikon.es>
Gracias Salva, aplicaré el patch, parece muy sencillo. Saludos Jorge
Subject: Re: [rt.cpan.org #69820]
Date: Wed, 27 Jul 2011 14:06:37 +0200
To: bug-Net-SFTP-Foreign [...] rt.cpan.org
From: Jorge Gonzalez <jorge.gonzalez [...] daikon.es>
El parche funciona perfectamente, gracias.
Subject: IPC::Open3 bug
Starting from version 1.68_06, on Unix, Net::SFTP::Foreign uses its own open3 implementation getting rid of the buggy IPC::Open3 one.