no such file config.pck updating to 2.1b1
Hi,
I am trying to update from 2.1a2 to 2.1b1 (on a SUN Sparc Solaris7
machine), unfortunately with some hundreds of users waiting.
When I updated python from 1.5.2 to 2.2.1c1, mailman 2.1a2 broke
immediately with "ImportError: No module named mimelib.Parser". The
installation of 2.1b1 abended in the Makefile of the bin subdirectory with
a syntax error on
for f in $(NONSCRIPTS);
do
$(INSTALL) -m $(FILEMODE) $$f $(SCRIPTSDIR);
done;
fi
because "NONSCRIPTS= ". After I commented these lines out the
installation continued but stopped in bin/update with the line
OSError: [Errno 2] No such file or directory: '/h/mailman/lists/test/config.pck'
because the configuration is stored as config.db.
How do I convert the config.db to config.pck ?
Best wishes Georg
---------------- output of bin/updated --------------- Upgrading from version 0x20100a2 to 0x20100b1 getting rid of old source files removing /h/mailman/Mailman/Cookie.py removing /h/mailman/scripts/mailcmd removing /h/mailman/scripts/mailowner removing /h/mailman/mail/wrapper removing directory /h/mailman/Mailman/pythonlib and everything underneath removing /h/mailman/cgi-bin/archives Updating mailing list: test Traceback (most recent call last): File "bin/update", line 542, in ? errors = main() File "bin/update", line 424, in main errors = errors + dolist(listname) File "bin/update", line 184, in dolist mlist = MailList.MailList(listname, lock=0) File "/h/mailman/Mailman/MailList.py", line 102, in __init__ self.Load() File "/h/mailman/Mailman/MailList.py", line 534, in Load dict, e = self.__load(file) File "/h/mailman/Mailman/MailList.py", line 496, in __load mtime = os.path.getmtime(dbfile) File "/usr/local/lib/python2.2/posixpath.py", line 144, in getmtime st = os.stat(filename) OSError: [Errno 2] No such file or directory: '/h/mailman/lists/test/config.pck'
-------------- output of http://ourhost/mailman/listinfo --------
Traceback (most recent call last): File "/h/mailman/scripts/driver", line 82, in run_main main() File "/h/mailman/Mailman/Cgi/listinfo.py", line 42, in main listinfo_overview() File "/h/mailman/Mailman/Cgi/listinfo.py", line 85, in listinfo_overview mlist = MailList.MailList(name, lock=0) File "/h/mailman/Mailman/MailList.py", line 102, in __init__ self.Load() File "/h/mailman/Mailman/MailList.py", line 534, in Load dict, e = self.__load(file) File "/h/mailman/Mailman/MailList.py", line 496, in __load mtime = os.path.getmtime(dbfile) File "/usr/local/lib/python2.2/posixpath.py", line 144, in getmtime st = os.stat(filename) OSError: [Errno 2] No such file or directory: '/h/mailman/lists/accstaff/config.pck'
--
Georg Koch (koch@cochrane.de) | Phone: +49 761 203 6710 German Cochrane Centre | Fax: +49 761 203 6712 Mail: Institute of Medical Biometry and Medical Informatics Stefan-Meier-Strasse 26, D-79104 Freiburg, Germany "All you need in this life is ignorance and confidence, and then success is sure." (Mark Twain)
"GK" == Georg Koch <gorg@sun31.imbi.uni-freiburg.de> writes:
GK> I am trying to update from 2.1a2 to 2.1b1 (on a SUN Sparc
GK> Solaris7 machine), unfortunately with some hundreds of users
GK> waiting. When I updated python from 1.5.2 to 2.2.1c1, mailman
GK> 2.1a2 broke immediately with "ImportError: No module named
GK> mimelib.Parser".
Not surprising. Until recently, the email package was installed in your Python's site-library, which changes with each Python version. MM2.1b1 fixes this.
GK> The installation of 2.1b1 abended in the
GK> Makefile of the bin subdirectory with a syntax error on
| for f in $(NONSCRIPTS); \
| do \
| $(INSTALL) -m $(FILEMODE) $$f $(SCRIPTSDIR); \
| done; \
| fi
GK> because "NONSCRIPTS= ". After I commented these lines out the
GK> installation continued but stopped in bin/update with the line
Fixed in CVS.
GK> OSError: [Errno 2] No such file or directory:
GK> '/h/mailman/lists/test/config.pck'
GK> because the configuration is stored as config.db.
GK> How do I convert the config.db to config.pck ?
You don't. While the error message is misleading, your config.db file will be automatically updated to config.pck the first time you load your list (via web, qrunner, or command line script).
-Barry
GK> OSError: [Errno 2] No such file or directory: GK> '/h/mailman/lists/test/config.pck' GK> because the configuration is stored as config.db. GK> How do I convert the config.db to config.pck ?
You don't. While the error message is misleading, your config.db file will be automatically updated to config.pck the first time you load your list (via web, qrunner, or command line script).
Hi Barry,
but I cannot, because MailList.py stops with an uncatched exception first. __load is called from load like this: for file in (pfile, plast, dfile, dlast): dict, e = self.__load(file) so in __load the mtime of non-existing config.pck is asked and yields the exception which is not handled. I am in no way a python developer, so I moved some lines in the definition of __load in MailList.py (see below) and could see the web page http://ourhost/mailman/listinfo without an error - but it was empty! (The right thing would probably be to catch the exception).
Georg
if dbfile.endswith('.db') or dbfile.endswith('.db.last'):
loadfunc = marshal.load
elif dbfile.endswith('.pck') or dbfile.endswith('.pck.last'):
loadfunc = cPickle.load
else:
assert 0, 'Bad database file name'
# moved lines # mtime = os.path.getmtime(dbfile) # if mtime <= self.__timestamp: # # File is not newer # return None, None try: fp = open(dbfile) except IOError, e: if e.errno <> errno.ENOENT: raise return None, e # moved to here mtime = os.path.getmtime(dbfile) if mtime <= self.__timestamp: # File is not newer return None, None
--
Georg Koch (koch@cochrane.de) | Phone: +49 761 203 6710 German Cochrane Centre | Fax: +49 761 203 6712 Mail: Institute of Medical Biometry and Medical Informatics Stefan-Meier-Strasse 26, D-79104 Freiburg, Germany "All you need in this life is ignorance and confidence, and then success is sure." (Mark Twain)
--
Georg Koch (koch@cochrane.de) | Phone: +49 761 203 6710 German Cochrane Centre | Fax: +49 761 203 6712 Mail: Institute of Medical Biometry and Medical Informatics Stefan-Meier-Strasse 26, D-79104 Freiburg, Germany "All you need in this life is ignorance and confidence, and then success is sure." (Mark Twain)
"GK" == Georg Koch <gorg@sun31.imbi.uni-freiburg.de> writes:
GK> but I cannot, because MailList.py stops with an uncatched GK> exception first. __load is called from load like this: | for file in (pfile, plast, dfile, dlast): | dict, e = self.__load(file) GK> so in __load the mtime of non-existing config.pck is asked and GK> yields the exception which is not handled. Feh, I'm a big dummy. Please try the attached patch. -Barry Index: MailList.py =================================================================== RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v retrieving revision 2.67 retrieving revision 2.68 diff -u -r2.67 -r2.68 --- MailList.py 1 Apr 2002 16:31:25 -0000 2.67 +++ MailList.py 5 Apr 2002 14:43:28 -0000 2.68 @@ -493,14 +493,21 @@ loadfunc = cPickle.load else: assert 0, 'Bad database file name' - mtime = os.path.getmtime(dbfile) - if mtime <= self.__timestamp: - # File is not newer - return None, None try: + # Check the mod time of the file first. If it matches our + # timestamp, then the state hasn't change since the last time we + # loaded it. Otherwise open the file for loading, below. If the + # file doesn't exist, we'll get an EnvironmentError with errno set + # to ENOENT (EnvironmentError is the base class of IOError and + # OSError). + mtime = os.path.getmtime(dbfile) + if mtime <= self.__timestamp: + # File is not newer + return None, None fp = open(dbfile) - except IOError, e: + except EnvironmentError, e: if e.errno <> errno.ENOENT: raise + # The file doesn't exist yet return None, e try: try:
At 04:09 PM 4/4/02 -0500, Barry A. Warsaw wrote:
GK> OSError: [Errno 2] No such file or directory: GK> '/h/mailman/lists/test/config.pck' GK> because the configuration is stored as config.db. GK> How do I convert the config.db to config.pck ?
You don't. While the error message is misleading, your config.db file will be automatically updated to config.pck the first time you load your list (via web, qrunner, or command line script).
Ah hah. And you didn't believe me when I posted the comment a while back that it really shouldn't do that...
"RJ" == Ron Jarrell <jarrell@vt.edu> writes:
>> You don't. While the error message is misleading, your
>> config.db file will be automatically updated to config.pck the
>> first time you load your list (via web, qrunner, or command
>> line script).
RJ> Ah hah. And you didn't believe me when I posted the comment a
RJ> while back that it really shouldn't do that...
I apologize, because I don't remember that conversation.
But I don't see it as being much different than writing the config.db file when we (used to) save. We're just doing it in a more robust data file format (marshal == bad, pickle == good).
-Barry
At 01:12 AM 4/6/02 -0500, Barry A. Warsaw wrote:
"RJ" == Ron Jarrell <jarrell@vt.edu> writes:
>> You don't. While the error message is misleading, your >> config.db file will be automatically updated to config.pck the >> first time you load your list (via web, qrunner, or command >> line script). RJ> Ah hah. And you didn't believe me when I posted the comment a RJ> while back that it really shouldn't do that...
I apologize, because I don't remember that conversation.
But I don't see it as being much different than writing the config.db file when we (used to) save. We're just doing it in a more robust data file format (marshal == bad, pickle == good).
Not that using the pickle file was bad, the fact that during the upgrade your error log fills with dire warnings about your db files being bad.
The other thing I mentioned, which I'll mention again, since you haven't been in email mode is that dropping the placeholder page into the archives for lists that already *had* working archives was a really bad move...
participants (3)
-
barry@zope.com
-
Georg Koch
-
Ron Jarrell