egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error: too many open files

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Tue Aug 14, 2007 7:20 am    Post subject: Error: too many open files Reply with quote

Hi,

I get the following errors all the time:

Quote:
14/08/07@05:03.21> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp /logs/timestats/ ~/$webscore"
(procedure "mx_userspeedsave" line 368)
invoked from within
"mx_userspeedsave"
(procedure "moxquiz_pubm" line 656)
invoked from within
"moxquiz_pubm $_pubm1 $_pubm2 $_pubm3 $_pubm4 $_pubm5"


14/08/07@05:03.27> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $newnick $host $handle $channel"
(procedure "moxquiz_on_nickchanged" line 10)
invoked from within
"moxquiz_on_nickchanged $_stnm1 $_stnm2 $_stnm3 $_stnm4 $_stnm5"


14/08/07@05:05.44> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $botnick "" "" $quizconf(quizchannel)"
(procedure "moxquiz_after_part" line 3)
invoked from within
"moxquiz_after_part"


14/08/07@05:05.45> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $botnick "" "" $quizconf(quizchannel)"
(procedure "moxquiz_after_part" line 3)
invoked from within
"moxquiz_after_part"

.
.
.

14/08/07@11:10.29> : moxquiz.mo.funpic.de: unknown host.
ncftpput: cannot open moxquiz.mo.funpic.de: unknown host.
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $botnick "" "" $quizconf(quizchannel)"
(procedure "moxquiz_after_part" line 3)
invoked from within
"moxquiz_after_part"


too many open files
The error occurs on random locations in the script. Unfortunately I can't find a file in the script that isn't closed after use. Reducing the files being opened doesn't seem to help. Is there a way to avoid the bot freezing due to this error other than restarting it all the time?

moxquiz.mo.funpic.de: unknown host.
this one is probably easier: how can I avoid to send a file to my webspace (per ftp) which ist temporarily down?


I hope my questions aren't too unspecific. If needed, here's the script: http://moxquiz.mo.funpic.de/test/moxquizz.txt


Thanks for your help!

-typ-
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Aug 14, 2007 2:29 pm    Post subject: Reply with quote

I had a quick look at the script, it seems to properly close every file it opens. I guess the problem is from the machine hosting your Eggdrop.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Tue Aug 14, 2007 3:11 pm    Post subject: Reply with quote

Thanks!


I consulted the bot-hoster, who told me the problem lies within the script. Is there a way to convince him of the opposite?
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Aug 14, 2007 7:59 pm    Post subject: Reply with quote

-typ- wrote:
Thanks!


I consulted the bot-hoster, who told me the problem lies within the script. Is there a way to convince him of the opposite?

Unload all scripts; test one by one to see for certain which is the offender.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Wed Aug 15, 2007 10:27 am    Post subject: Reply with quote

I know the error lies within: http://moxquiz.mo.funpic.de/test/moxquizz.txt
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Aug 15, 2007 10:35 am    Post subject: Reply with quote

I guess one option might be to replace the open and close-commands with a proc featuring some debugging code; ie, rename open to _open, create a proc named open that calls _open, and tries to figure out number of opened files, where it was called from, and such.

Also, remember that sockets also make use of file descriptors, including the http-package..
Not sure this part might be to blame, but might be worth investigating:
Code:
variable newquest ""
package require http
setudef flag weather
set agent "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"

bind pub - !qread pub_w
bind pub - !qinsert pub_i
bind pub - !qcorrect pub_c

proc pub_w {nick uhand handle chan input} {
    global botnick agent datadir newquest
 
if {![isop $nick $chan]} {
mxirc_notc $nick "Du musst Op sein, um diese Funktion auszuführen"
return
}
mxirc_quick_notc $nick "Neue Fragen werden eingelesen. Sollte der Befehl nicht funktionieren, probier zunächst !rehash."


    set query "http://moxquiz.mo.funpic.de/fragen/neue_fragen.txt"
    set http [::http::config -useragent $agent]
    set http [::http::geturl $query]
    set html [::http::data $http]

 set questtime "[unixtime].txt"
 set fname "$datadir/backup/$questtime"
 set newquest $fname
 set fp [open $fname "a"]

foreach line [split $html "\n"] {
puts $fp $line
}

close $fp

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Sat Aug 18, 2007 11:35 am    Post subject: Reply with quote

thx, I'll change my hoster and try that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber