Forum OpenACS Q&A: How do I find this ad.tcl error?

Collapse
Posted by Jade Rubick on
I'm receiving email messages from OpenACS describing errors in my ad.tcl file, I believe, based on Don's previous posting. Here is the message I get:
Errors since 08/Sep/2000:11:37:50

[08/Sep/2000:11:37:58]
    Error: can't use non-numeric string as operand of "&&"
    can't use non-numeric string as operand of "&&"
        while executing
    "if {! $webmail_queue_processing_enabled_p && [ad_parameter
WebmailEnabledP webmail
0] } {
    
        ns_share wm_queue
        set      wm_queue(processingP) 0
     ..."
        (file "/web/intranet/tcl/webmail-defs.tcl" line 162)
    Notice: tclinit: sourcing '/web/intranet/tcl/wp-defs.tcl'
Don says here:
It sounds like something's not set up properly in your 
version of ad.tcl, or that it's not being sourced by your 
nsd.tcl file when you fire up AOLserver. 

The "non-numeric arg to &&" error is an indication that a 
blank was returned when it tried to pick up a value using
ad_parameter, leading to a statement like 'if { "" && something }"
or 'if { $something && "" }'. 
Question: how do I find the blank? I've looked in webmail, which looks like a likely culprit, and it's exactly the same as the original ad.tcl Anywhere else I can look? The source doesn't seem to point me where it is..
Collapse
Posted by Dan Wickstrom on
The problem is probably not in webmail. You can go into webmail-defs.tcl and insert this debug code:

# Schedule the filter to process the incoming mail queue
ns_share -init {set webmail_queue_processing_enabled_p 0} webmail_queue_processing_enabled_p

ns_log Debug "init = $webmail_queue_processing_enabled_p, enabled = [ad_parameter WebmailEnabledP webmail 0]" # <--- debug code

if {! $webmail_queue_processing_enabled_p && [ad_parameter WebmailEnabledP webmail 0] } {

    ns_share wm_queue
    set      wm_queue(processingP) 0
    set      wm_queue(lock)        [ns_mutex create]

    set wm_interval [ad_parameter ProcesssQueueInterval webmail 60]
    ad_schedule_proc -thread t $wm_interval wm_process_queue

    ns_schedule_daily -thread 3 30 wm_cleanup_outgoing_messages

    set webmail_queue_processing_enabled_p 1
}

Now fire up aolserver and look in the log file for something like:

08/Sep/2000:15:26:08][12436.1][-main-] Notice: nsd.tcl: sourcing: /home/unix/wickstrom/web/acs-pg/tcl/webmail-defs.tcl
[08/Sep/2000:15:26:08][12436.1][-main-] Debug: init = 0, enabled = 1
[08/Sep/2000:15:26:09][12436.1][-main-] Notice: Scheduling proc wm_process_queue
[08/Sep/2000:15:26:09][12436.1][-main-] Notice: nsd.tcl: sourcing: /home/unix/wickstrom/web/acs-pg/tcl/wp-defs.tcl
[
If init or enabled is blank that is your problem. Since webmail_queue_processing_enabled_p is defined in webmail-defs.tcl, I doubt that it is the problem. Most likely the call to ad_parameter is returning a blank. If so look in your nsd.tcl file for the problem.