Sync byte error with Expect 
Author Message
 Sync byte error with Expect

I have written an Expect script that telnets into 100's of network
devices in order to extract certain data from each of them.  It works
fine for 24 devices but always fails on the 25th with the following
message:

    child: sync byte read: Bad file number
    parent: sync byte read: Bad file number

I have made sure to close each telnet session before proceeding on to
the next as per the FAQ. (which did improve the problem somewhat from 17
to 24)

Don Libes suggests that this may be an OS problem or a systems resource
issue.  Can anyone elaborate on this and/or give me any other
suggestions?

Jeff.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.*-*-*.com/ - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



Sat, 08 Mar 2003 03:00:00 GMT  
 Sync byte error with Expect
This is probably due to limited resources available on your system. Use
"limit" command to find out the current resource settings and also to
increase its value (see man limit). Especially, increasing the value of
"descriptors" will help.

Hemang.

Quote:

> I have written an Expect script that telnets into 100's of network
> devices in order to extract certain data from each of them.  It works
> fine for 24 devices but always fails on the 25th with the following
> message:

>     child: sync byte read: Bad file number
>     parent: sync byte read: Bad file number

> I have made sure to close each telnet session before proceeding on to
> the next as per the FAQ. (which did improve the problem somewhat from 17
> to 24)

> Don Libes suggests that this may be an OS problem or a systems resource
> issue.  Can anyone elaborate on this and/or give me any other
> suggestions?

> Jeff.

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



Sat, 08 Mar 2003 03:00:00 GMT  
 Sync byte error with Expect
I was able to get things working by changing the descriptor limit from 64 to
256 but as more devices eventually get placed in the network, this may not be
enough either.  Do you know why I need this many descriptors?  I only have 4
files
open at any time so that can't be it.  However, descriptors can also be open
network sockets but this I have tried to address be ensuring that I close each

spawned telnet session before opening the next.

Quote:

> This is probably due to limited resources available on your system. Use
> "limit" command to find out the current resource settings and also to
> increase its value (see man limit). Especially, increasing the value of
> "descriptors" will help.

> Hemang.


> > I have written an Expect script that telnets into 100's of network
> > devices in order to extract certain data from each of them.  It works
> > fine for 24 devices but always fails on the 25th with the following
> > message:

> >     child: sync byte read: Bad file number
> >     parent: sync byte read: Bad file number

> > I have made sure to close each telnet session before proceeding on to
> > the next as per the FAQ. (which did improve the problem somewhat from 17
> > to 24)

> > Don Libes suggests that this may be an OS problem or a systems resource
> > issue.  Can anyone elaborate on this and/or give me any other
> > suggestions?

> > Jeff.

> > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


Sun, 09 Mar 2003 03:00:00 GMT  
 Sync byte error with Expect
Quote:

> I was able to get things working by changing the descriptor limit from 64 to
> 256 but as more devices eventually get placed in the network, this may not be
> enough either.  Do you know why I need this many descriptors?  I only have 4
> files
> open at any time so that can't be it.  However, descriptors can also be open
> network sockets but this I have tried to address be ensuring that I close each

> spawned telnet session before opening the next.

I am by no means a network expert, but IIRC a closed socket tends to
hang around for a while waiting for any stray packets that are still
travelling through the 'net. Thus a rapid opening and closing might in
fact exhaust your resources.
Have you tried to wait for, say, 10 seconds after the error occurs and
then retry the connection?
If I am talking night-earth here, I'd like to learn from all the
Netperts out there.

Live!
        Stefan.



Mon, 10 Mar 2003 03:00:00 GMT  
 Sync byte error with Expect

Quote:
> I was able to get things working by changing the descriptor limit from 64 to
> 256 but as more devices eventually get placed in the network, this may not be
> enough either.  Do you know why I need this many descriptors?  I only have 4
> files
> open at any time so that can't be it.  However, descriptors can also be open
> network sockets but this I have tried to address be ensuring that I close each

> spawned telnet session before opening the next.

How do you ensure this? In your telnet session, do you send and "exit" and
wait before trying the next telnet? If you are on a decent OS, you should be
able to check how many file descriptors are open. There may even be a way to
do this in more recent versions of Tcl using [file channels].

L

--
MY EMAIL ADDRESS HAS CHANGED --> UPDATE YOUR ADDRESSBOOK

Laurent Duperval                 "Montreal winters are an intelligence test,
                                         and we who are here have failed it."

Penguin Power!         ***Nothing I say reflects the views of my employer***



Mon, 10 Mar 2003 03:00:00 GMT  
 Sync byte error with Expect
For a normally behaving telnet session I issue the following:

    send "quit\r"
    expect eof
    wait

If the telnet session is not responding properly, I issue:

    close
    wait

BTW, I am using Solaris 2.5.1.  I don't know how to check for open descriptors, but
that would be very useful to determine what is going on.

 close;wait for every telnet session before moving on to the next.

Quote:


> > I was able to get things working by changing the descriptor limit from 64 to
> > 256 but as more devices eventually get placed in the network, this may not be
> > enough either.  Do you know why I need this many descriptors?  I only have 4
> > files
> > open at any time so that can't be it.  However, descriptors can also be open
> > network sockets but this I have tried to address be ensuring that I close each

> > spawned telnet session before opening the next.

> How do you ensure this? In your telnet session, do you send and "exit" and
> wait before trying the next telnet? If you are on a decent OS, you should be
> able to check how many file descriptors are open. There may even be a way to
> do this in more recent versions of Tcl using [file channels].

> L

> --
> MY EMAIL ADDRESS HAS CHANGED --> UPDATE YOUR ADDRESSBOOK

> Laurent Duperval                 "Montreal winters are an intelligence test,
>                                          and we who are here have failed it."

> Penguin Power!         ***Nothing I say reflects the views of my employer***

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


Mon, 10 Mar 2003 03:00:00 GMT  
 Sync byte error with Expect
There is about 1-2 seconds between ending one session and starting another.  I
haven't really tried increasing this, but I'll try it out.

Quote:


> > I was able to get things working by changing the descriptor limit from 64 to
> > 256 but as more devices eventually get placed in the network, this may not be
> > enough either.  Do you know why I need this many descriptors?  I only have 4
> > files
> > open at any time so that can't be it.  However, descriptors can also be open
> > network sockets but this I have tried to address be ensuring that I close each

> > spawned telnet session before opening the next.

> I am by no means a network expert, but IIRC a closed socket tends to
> hang around for a while waiting for any stray packets that are still
> travelling through the 'net. Thus a rapid opening and closing might in
> fact exhaust your resources.
> Have you tried to wait for, say, 10 seconds after the error occurs and
> then retry the connection?
> If I am talking night-earth here, I'd like to learn from all the
> Netperts out there.

> Live!
>         Stefan.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


Mon, 10 Mar 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Expect - spawn sync byte errors

2. Expect Parent/Child Sync Byte error?

3. expect error - parent sync byte read: bad file number

4. EXPECT, parent: waiting for sync byte

5. expect, trouble with spawn, waiting for sync byte

6. Parent sync byte: bad file number error message

7. parent: sync byte write: broken pipe

8. Expectk sync byte issue

9. Garnet 3.0 under Redhat/CMUCL: Error in function C::BYTE-INTERPRET-BYTE: Unbound variable: OPAL::AGGRELIST

10. DBF / DBT Sync Error. Please Help

11. Expect: error with puts after expect

12. Expected bytes per sloc (semicolons) performance

 

 
Powered by phpBB® Forum Software