This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

too many open files

General support and discussion of Eggdrop bots.
Post Reply
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

too many open files

Post by devilsoulblack »

this happen every day once on a day

that file have chmod 777

Code: Select all

[12:00] Writing channel file...
[12:04] Checking for idle: #ec #quito
[12:09] Checking for idle: #ec #quito
[12:14] Checking for idle: #ec #quito
[12:19] Checking for idle: #ec #quito
[12:24] Checking for idle: #ec #quito
[12:29] Checking for idle: #ec #quito
[12:34] Checking for idle: #ec #quito
[12:39] Checking for idle: #ec #quito
[12:44] Checking for idle: #ec #quito
[12:49] Checking for idle: #ec #quito
[12:54] Checking for idle: #ec #quito
[12:59] Checking for idle: #ec #quito
[12:59] DEOP (#ec): Acanet - Idle: 64 minutes
[12:59] DEOP (#quito): Acanet - Idle: 64 minutes
[13:00] Writing user file...
[13:00] Writing channel file...
[13:04] Checking for idle: #ec #quito
[13:09] Checking for idle: #ec #quito
[13:14] Checking for idle: #ec #quito
[13:19] Checking for idle: #ec #quito
[13:24] Checking for idle: #ec #quito
[13:25] Tcl error [joincounter]: couldn't open "./scripts/#ec.jcount.txt": too many open files
[13:25] Tcl error [record:seened]: couldn't open "bellota.seenrecord.db": too many open files
[13:25] Tcl error [record:join]: couldn't open "bellota.BlackSeen.db": too many open files
[13:26] Tcl error in script for 'timer10305':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10304':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10303':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10302':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10301':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10300':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10299':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10298':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10297':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10296':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10295':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10294':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10293':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10292':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:26] Tcl error in script for 'timer10291':
[13:26] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10328':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10327':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10326':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10325':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10324':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10323':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10322':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10321':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10320':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10319':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10318':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10317':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10316':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10315':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10314':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10313':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10312':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10311':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10310':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10309':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10307':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:27] Tcl error in script for 'timer10306':
[13:27] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10339':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10338':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10337':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10336':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10335':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10334':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10333':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10332':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10331':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10330':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:28] Tcl error in script for 'timer10329':
[13:28] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10357':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10356':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10355':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10354':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10353':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10352':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10351':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10350':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10349':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10348':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10347':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10346':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Checking for idle: #ec #quito
[13:29] Tcl error in script for 'timer10344':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10343':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10342':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10341':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:29] Tcl error in script for 'timer10340':
[13:29] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10375':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10374':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10372':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10371':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10370':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10369':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10368':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10367':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10366':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10365':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10364':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10363':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10362':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10361':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10360':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10359':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:30] Tcl error in script for 'timer10358':
[13:30] couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:32] Tcl error [nicklist:make]: couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:32] Tcl error [joins]: couldn't open "greet(#ec).txt": too many open files
[13:32] Tcl error [joincounter]: couldn't open "./scripts/#ec.jcount.txt": too many open files
[13:32] Tcl error [record:seened]: couldn't open "bellota.seenrecord.db": too many open files
[13:32] Tcl error [record:join]: couldn't open "bellota.BlackSeen.db": too many open files
[13:34] Checking for idle: #ec #quito
[13:34] Tcl error [nicklist:make]: couldn't open "/home/felposa/stats/orenses/nicklist.txt": too many open files
[13:34] Tcl error [joins]: couldn't open "greet(#ec).txt": too many open files
[13:34] Tcl error [joincounter]: couldn't open "./scripts/#ec.jcount.txt": too many open files
[13:34] Tcl error [record:seened]: couldn't open "bellota.seenrecord.db": too many open files
[13:34] Tcl error [record:join]: couldn't open "bellota.BlackSeen.db": too many open files
any idea what ist the reason happen this ?
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Simply put, you are running low on file descriptors (aka channels), thus you can't create any further until others are free'd.

Usually, this limit is set rather high (1024 channels per process), so I'd suspect that you are using a poorly written script with file descriptor leaks (files opened for reading - but never closed, using the http-package without the neded cleanup, etc).

You could also use the ulimit binary from your shell to investigate the actual cap on file descriptors/channels.
NML_375
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

nml375 wrote:Simply put, you are running low on file descriptors (aka channels), thus you can't create any further until others are free'd.

Usually, this limit is set rather high (1024 channels per process), so I'd suspect that you are using a poorly written script with file descriptor leaks (files opened for reading - but never closed, using the http-package without the neded cleanup, etc).

You could also use the ulimit binary from your shell to investigate the actual cap on file descriptors/channels.
i think this ist the tcl make that issues

Code: Select all

# *********************************************************************************************
# Write Channel Nicklist 2 File -- By SpOoK
#
# Used to retrive the channels nicklist so it can be displayed on a webpaged
# Change set channel "#yourchanel" to reflect the channel you want to output the nicklist for.
#
# To set the update time change the value after "timer x make". There are 2 instances of this.
# default update time is now 5 mins
#
# Revisions:
# v1.1 - Added bind controls, nicklist is now generated upon join/kick or nick change.
#      - Nicklist is now sorted alphabetically for oped/voiced/normal users
# v1.0 - Initial Release
# **********************************************************************************************

set ver "1.1" 
set dumpfile "/home/felposa/stats/orenses/nicklist.txt" 
set channel "#EC" 

# Bind Events we want to catch...
# Note: Remove the following 6 lines for timer only update. Reccomended for larger channels.
bind sign - "$channel %" nicklist:make
bind part - "$channel %" nicklist:make
bind splt - "$channel %" nicklist:make
bind join - "$channel %" nicklist:make
bind kick - "$channel %" nicklist:make
bind nick - "$channel %" nicklist:make

if {![info exists nicklist_running]} {   
    timer 5 nicklist:make                      
    set nicklist_running 1                 
  }                                   

proc nicklist:make {args} { 

global dumpfile channel botnick

set nicklist [chanlist $channel]
set nicklist [lsort -dictionary [lrange $nicklist 0 end]]

set templist ""
set oplist ""
set voicelist ""
set userlist ""

set outputfile [open $dumpfile w]

foreach user $nicklist {
    if {([isop $user $channel])} {
    	lappend oplist $user
       } elseif {([isvoice $user $channel])} {
    	lappend voicelist $user
    	} else {
   	 lappend userlist $user
   }
}


foreach chanlistnicks "\{$oplist\} \{$voicelist\} \{$userlist\}" {
            foreach usernick $chanlistnicks {
                if {[isop $usernick $channel]} {set control "@"} {set control ""}
                if {[isvoice $usernick $channel]} {set control "+"}
                    puts $outputfile $control$usernick
  }
}

close $outputfile

#putlog "Saving $channel NickList..." 
timer 5 nicklist:make
return 1
} 

putlog "Write Channel Nicklist to File v$ver by SpOoK loaded." 
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Here's a better version indented properly:

Code: Select all

set ver "1.1"
set dumpfile "/home/felposa/stats/orenses/nicklist.txt"
set channel "#EC"

# Bind Events we want to catch...
# Note: Remove the following 7 lines for timer only update. Reccomended for larger channels.
bind sign - "$channel %" nicklist:make
bind part - "$channel %" nicklist:make
bind splt - "$channel %" nicklist:make
bind join - "$channel %" nicklist:make
bind kick - "$channel %" nicklist:make
bind nick - "$channel %" nicklist:make
bind mode - "$channel %" nicklist:make

if {![info exists nicklist_running]} {   
	timer 5 nicklist:make                     
	set nicklist_running 1                 
}                                   

proc nicklist:make {args} {

	global dumpfile channel botnick

	set nicklist [chanlist $channel]
	set nicklist [lsort -dictionary $nicklist]

	set oplist [list]
	set voicelist [list]
	set userlist [list]

	set outputfile [open $dumpfile w]

	foreach user $nicklist {
		if {([isop $user $channel])} {
			lappend oplist "@$user"
		} elseif {([isvoice $user $channel])} {
			lappend voicelist "+$user"
		} else {
			lappend userlist $user
		}
	}


	set chanlistnicks [concat $oplist $voicelist $userlist]
	puts $outputfile [join $chanlistnicks "\n"]

	close $outputfile
	
	putlog "Saved $channel NickList..."
	timer 5 nicklist:make
}

putlog "Write Channel Nicklist to File v$ver by SpOoK loaded." 
t
thommey
Halfop
Posts: 76
Joined: Tue Apr 01, 2008 2:59 pm

Post by thommey »

That script doesn't look like it's leaking file handles. But it also shows in your logfile more than once every 5 minutes which shouldn't happen. Did you try to ".restart" the bot? Do you have this script loaded multiple times? Copied to handle multiple channels maybe?

If you're desperate to find what's leaking file handles, load this script:

Code: Select all

bind dcc n fileinfo tellfileinfo
proc tellfileinfo {hand idx text} {
    if {$text eq ""} {
        foreach f [file channels] {
            if {![string match file* $f]} { continue }
            catch {tellfileinfo $hand $idx $f}
        }
    } else {
        set f $text
        putdcc $idx "Filesock $f -> [file normalize [handle2file $f]]. Opened by \[[handle2opener $f]\]"
    }
}

if {![info exists ::opentrace]} {
    # add the 2 traces. one to 'open', one to 'close'.
    trace add execution open leave tracer_open
    trace add execution close leave tracer_close
    set ::opentrace 1
}

#procedure to lookup <socket> to <filename> (or commandname if piped)
# Usage: handle2file fileXXXX
# Example: "handle2file [open randomfile w]" should return "randomfile"
# (close the file afterwards :)
proc handle2file {handle} {
    if {![info exists ::openfiles($handle)]} {
        error "File handle not found"
    } else {
        return [lindex $::openfiles($handle) 0]
    }
}

#procedure to lookup <socket> to <procedure which initially called open>
proc handle2opener {handle} {
    if {![info exists ::openfiles($handle)]} {
        error "File handle not found"
    } else {
        return [lindex $::openfiles($handle) 1]
    }
}

# tracer_open "open <filename> ?mode?" 0/1 "file..." leave
proc tracer_open {cmdstr rescode resstr op} {
    # there was an error, file wasn't really opened
    if {$rescode} { return }
    # check if it was a filesocket
    if {[string match file* $resstr]} {
        # add handle with corresponding filename to array
        if {[catch {info level -1} caller]} { set caller -global- }
        set ::openfiles($resstr) [list [lindex [split $cmdstr] 1] $caller]
    }
}

# tracer_close "close <handle>" 0/1 "" leave
proc tracer_close {cmdstr rescode resstr op} {
    set handle [lindex [split $cmdstr] 1]
    # there was an error or I don't know about that handle
    if {$rescode || ![info exists ::openfiles($handle)]} { return }
    # remove handle from array
    unset ::openfiles($handle)
}
, restart the bot, wait some time, and check .fileinfo every now and then to see which tcl procedure is opening which file and not closing it.
Post Reply