Great Circle Associates Majordomo-Users
(August 1998)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: A problem fixed (newconfig refused with obscure error message)
From: Chiaki Ishikawa <Chiaki . Ishikawa @ personal-media . co . jp>
Date: Tue, 18 Aug 1998 18:43:06 +0900 (JST)
To: majordomo-users @ greatcircle . com

X-PMC-CI-e-mail-id: 8766 

(I sent the attached text to majordomo-workers, but I realized now
I sent the previous e-mail to majordomo-users. So here it goes again.)

- 1st e-mail ---------------------------------------
>From ishikawa Wed Aug 12 07:53:05 +0900 1998
To:  majordomo-workers@greatcircle.com.
Subject: A problem solved (majordomo failing to accept newconfig...)

X-PMC-CI-e-mail-id: 8738 

A few months ago,  I reported a problem of
majordomo not accepting "newconfig list password" anymore.

I had not used that feature for several months then
and so was not quite sure what went wrong.

I even checked the perl versions and re-ran the
configuration checker to no avail.



The returned error message was  something like the following.
>>>> newconfig sample foobar  
The new config file for sample was NOT accepted because:
close at line 384 is not a valid value.
Valid values are: open;closed;auto;open+confirm;closed+confirm;auto+confirm


*BUT* there was *NO* `close' (note misspelling) or whatever in the new
config contents I tried sending back to majordomo account.


Well, now I am on summer vacation and guess what.
I used my first day
to track down the problem and found there seems to be
a problem in config_parse.pl.

After adding a more context information such as the $key value
to the error message,
I found that it was choking on
`subscribe_policy' line.
This was way off the line reported by majordomo.

And again, I had not used
`close'on this line!

Then after looling at the code in grab_enum routine in config_parse,
I noticed that there is a strange eval() code.
So I checked the setting of subscribe_policy key:

        'subscribe_policy',	"open\001closed\001auto\001open+confirm\001closed+confirm\001auto+confirm\001#!\$default_subscribe_policy ? \$default_subscribe_policy : 'open'",


Ok, so majordomo tries to eval
$default_subscribe_policy ? $default_subscribe_plicy : 'open'


My conclusion, this $default_subscribe_policy is
misset somewhere in my configuration as 'close' as opposed to
'closed'.

But the nasty problem is config_parse.pl doesn't report this
properly!

My brutal fix to config_parse.pl.
Force default_subscribe_policy.pl to "closed" in
grab_enum() to err on the safe side.

diff -c config_parse.pl{.save,}
*** config_parse.pl.save	Wed Aug 12 07:25:39 1998
--- config_parse.pl	Wed Aug 12 07:25:49 1998
***************
*** 1009,1016 ****
--- 1009,1020 ----
  	$value = pop(@enum);
  
  	if ( $value =~ s/^#!// ) {
+ 	    #
+ 	    $default_subscribe_policy = "closed";
+ 
  	    $value = eval("$value");
  	    push(@errors, $@) if $@ ne "";
+ 
  	}
  
      } else {
***************
*** 1021,1027 ****
  	return $value if $value eq $i;
      }
      push(@errors, "$value at line $. is not a valid value.\n" .
! 	 "Valid values are: " . join(';', @enum) . "\n");
      return "";
  }
  
--- 1025,1033 ----
  	return $value if $value eq $i;
      }
      push(@errors, "$value at line $. is not a valid value.\n" .
! 	 "Valid values are: " . join(';', @enum) . "\nlist was $list" . " the key was $key " . "\n" . "installing_default was $installing_defaults" . "\n");
! 
! 
      return "";
  }
  


Yes, the culprit was

----
egrep close majordomo.cf
$config'default_subscribe_policy = "close";
----

The above line ought to read "closed".

But, config_parse.pl ought to be capable of analysing the
buggy situation a little better, I think.

Thank you for some hints and tips after I reported the problem.
The problem and cause was as outlined above and
my fixed majordomo happiliy accepts the
newconfig command.

= 2nd e-mail =======================================
To: majordomo-workers@greatcircle.com.
Subject: Better patch ( A problem solved (majordomo failing to accept newconfig...) )

X-PMC-CI-e-mail-id: 8759 

A few days ago I reported a problem of config_parse.pl, namely
it didn't explain the error caused by an incorrect default value
set inside majordomo.cf very well.
As a result, the newconfig command returns an error message which
was hard to decipher.

I then showed a very crude quick/dirty patch then, but it only worked
for a very limited set of errors namely caused by the incorrect value
assigned to default_subscribe_policy.

Now I am back to the office and here is a better patch which should
work for all problems for default value setup and an example error
message returned by majordomo is shown.

Hope this helps.

Please let me know if this is the right mailing list for reporting
the problem/bug, etc..

Chiaki Ishikawa


PATCH for config_parse.pl:

majordomo# diff -c config_parse.pl.save config_parse.pl
*** config_parse.pl.save	Wed Aug 12 07:25:39 1998
--- config_parse.pl	Mon Aug 17 18:13:03 1998
***************
*** 1001,1006 ****
--- 1001,1007 ----
  sub grab_enum {
      local($value, $list, $key) = @_;
      local($i, @enum) = "";
+     local($default_value) = "";
  
      if ($installing_defaults) { # the value when installing defaults is
  				# the entire enumerated list, with the
***************
*** 1008,1018 ****
--- 1009,1046 ----
  	@enum = split(/\001/, $value);
  	$value = pop(@enum);
  
+ 	$default_value = $value;
+ 
  	if ( $value =~ s/^#!// ) {
+ 	    #
+ 	    # kludge: $default_subscribe_policy = "closed";
+ 	    #
+ 
+ 	    $default_value = $value;
+ 
  	    $value = eval("$value");
  	    push(@errors, $@) if $@ ne "";
+ 
  	}
  
+ 	#
+ 	# duplicate here for better error message during
+ 	# default setup.
+ 	#
+ 	foreach $i (@enum) {
+ 	    return $value if $value eq $i;
+ 	}
+ 	push(@errors, "$value at line $. is not a valid value.\n" .
+ 	     "This value was taken from the default list.\n" .
+ 	     "It was produced by $default_value\n" . 
+ 	     "So it is likely to be taken from majordomo.cf.\n" .
+ 	     "BTW, the line number shown here is the line number of the last line and not relevant.\n" .
+ 	     "The key to which the value was assigned was $key " . "\n" .
+ 	     "Valid values are: " . join(';', @enum) . "\nlist was $list" );
+ 
+ 	return "";
+ 
+ 
      } else {
  	@enum = split(/\001/, $known_keys{$key});
  	pop(@enum);
***************
*** 1021,1027 ****
  	return $value if $value eq $i;
      }
      push(@errors, "$value at line $. is not a valid value.\n" .
! 	 "Valid values are: " . join(';', @enum) . "\n");
      return "";
  }
  
--- 1049,1059 ----
  	return $value if $value eq $i;
      }
      push(@errors, "$value at line $. is not a valid value.\n" .
! 	 "Valid values are: " . join(';', @enum) . "\nlist was $list" . 
!          " the key was $key " . "\n" . 
!          "installing_default was $installing_defaults" . "\n");
! 
! 
      return "";
  }

======Error example: =========================

The following error was caused by incorrect value for
default_subscribe_policy: 'close' as opposed to the correct 'closed'.
This is set inisde majordomo.cf

----------------------------------------
majordomo# ed majordomo.cf
10482
/close/
$config'default_subscribe_policy = "close";
	...

----------------------------------------

I sent newconfig sample foobar and received this error which
is much easier to understand now.

========================================
Date: Mon, 17 Aug 1998 18:13:17 +0900 (JST)
To: ishikawa
From: Majordomo@majordomo.yk.rim.or.jp
Subject: Majordomo results
Reply-To: Majordomo@majordomo.yk.rim.or.jp

--

>>>> newconfig sample foobar
The new config file for sample was NOT accepted because:
close at line 385 is not a valid value.
This value was taken from the default list.
It was produced by $default_subscribe_policy ? $default_subscribe_policy : 'open'
So it is likely to be taken from majordomo.cf.
BTW, the line number shown here is the line number of the last line and not relevant.
The key to which the value was assigned was subscribe_policy 
Valid values are: open;closed;auto;open+confirm;closed+confirm;auto+confirm
list was sample.new>>>> 
>>>> 
>>>> 
>>>> 
>>>> 



  





-- 
     Ishikawa, Chiaki        ishikawa@personal-media.co.jp.NoSpam  or         
 (family name, given name) Chiaki.Ishikawa@personal-media.co.jp.NoSpam
    Personal Media Corp.      ** Remove .NoSpam at the end before use **     
  Shinagawa, Tokyo, Japan 142-0051






Indexed By Date Previous: majordomo and approve
From: claudio minutella <minutella@tic.ch>
Next: Re: MAJORDOMO ABORT
From: Jeff Rose <jrose@elug.org>
Indexed By Thread Previous: Re: majordomo and approve
From: Jeffrey Kaplan <jkaplan@world.std.com>
Next: Question on reply to a list???
From: wnpauls@WIND.WINONA.MSUS.EDU

Google
 
Search Internet Search www.greatcircle.com