Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Net::SFTP::Foreign works intermittently

by salva (Canon)
on Jun 17, 2014 at 10:08 UTC ( [id://1090125]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Net::SFTP::Foreign works intermittently
in thread Net::SFTP::Foreign works intermittently

Apparently, the password is being send at the right time. I can't see any problem there.

Are you sure you are using the right password? could there be more than one server, with different configurations, listening at the same address?

You can also try running the program with strace and checking that the password is written to the PTY from the Perl side and also read from the ssh slave process correctly.

Replies are listed 'Best First'.
Re^4: Net::SFTP::Foreign works intermittently
by JustPerl (Initiate) on Jun 17, 2014 at 10:41 UTC

    The password is correct as it is the same password which works smoothly for all the successful attempts. Shouldn't it work for a failed attempt too? There is no such other server which is listening on the same address. Also, I am creating these sftp connection objects from a script, which runs as a daemon/background job. And am invoking 10 such jobs or gearman worker threads. These worker threads listen to a webservice call. Whenever, there is a webservice call, one of the available worker threads serves the request, downloads the file from the remote server and does some processing. do you see any issue with spawning such number of worker threads which create the sftp connection objects? Please let me know.

      Do all the tasks involve connecting to the same server with the same authentication credentials? or are there several servers or credential settings?

      How does Gearman Perl workers run at the OS level? are they threads inside some master process or are they different processes?

      There could be some race condition on the PTY allocation as performed by IO::Pty. Try the strace thing.

        Yes, all the tasks are connecting to the same server with the same authentication credentials. And each Gearman worker runs in its own process. Can you tell me on how to run the strace thing? any examples.
      Setting $IO::Tty::DEBUG = 1 may also show some interesting stuff.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1090125]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found