in reply to Win32::TieRegistry and Connect Method Errors

I don't think this error is directly related to Win32::TieRegistry. The are report of this same error occuring when using Win32::AdminMisc and Win32::NetAdmin::CreateUser

Common elements seem to be apis that are communicating across the LAN, and an NT machine talking to a "K machine or vice versa.

The error is indicating that a previous call to some (network) IO was started asynchronously, and it hasn't yet completed, or it hasn't been reset prior to another attempt being made to perform further IO.

I think that you may be able to work around the problem by inserting a delay prior to calling which ever call is resulting in the error. I'd start with using 10 seconds, and if that is successful, slowly trim until the problem returns. I would use Win32::Sleep() in preference to perl's sleep as it allows millsecond increments, and may also relinguish more timeslice to the system and allow whatever process needs to complete, to complete more quickly. It is available by default on AS builds of perl, there is no need to load any extra modules to gain access to it.

The fact that the error is occuring from totally separate API's, and also I saw some evidence that it can be related to connections made from NT to 2K machines when perl is not involved, which suggests that this may well be a system level bug or failure rather than a perl or module problem per se.

Please come back and report your findings if you try this. Thanks.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!
Wanted!

  • Comment on Re: Win32::TieRegistry and Connect Method Errors

Replies are listed 'Best First'.
Re: Re: Win32::TieRegistry and Connect Method Errors
by kakaze (Sexton) on Nov 13, 2003 at 09:27 UTC
    Hi,

    Bonus points to Tye for suspecting that it was authentication related. (see below)

    If you're interested, here's what I tried:

    I tried intially stepping through various sleeps (from 1000 ms to 10000ms) to no avail. The script still did not connect.

    I tried connecting using NET USE with the Domain Admin user and password and this did not work (though I suspect that I did something wrong with the command so we will leave that aside :)

    If I managed to successfully embed the NET USE within the script, I will post the code here.

    Finally I popped up a Command shell Running as Domain Administrator and tried the script. It connected successfully every time.

    So thanks for all your help though we are still not left with any convincing reason for the original error.

    Thanks

    Kakaze

      As I suspected, I was doing something wrong with the NET USE command.

      Here's how it should look to connect to a machine:

      $list = "net use \\\\$Machine $password /USER:$domain\\$user"; system ("$list");

      And then connect as follows: $regKey = $Registry->Connect( $Machine, $target, { Access=>KEY_READ } );

      Note that I do not do and explicit or die after the connect attempt since I want to trap the failed machines so I do an  if ($regKey) {} later in the code.

      Kakaze