[Bug 543620] [NEW] command mailman info fails when Database url does not exist

Public bug reported: The command "mailman info" crashes if the database path "url" points to a location that does not exist yet: root@mailman:~/mailman/bin# ./mailman info Traceback (most recent call last): File "./mailman", line 32, in <module> mailman.bin.mailman.main() File "/root/mailman/src/mailman/bin/mailman.py", line 98, in main initialize(config_file) File "/root/mailman/src/mailman/core/initialize.py", line 175, in initialize initialize_2(propagate_logs=propagate_logs) File "/root/mailman/src/mailman/core/initialize.py", line 146, in initialize_2 database.initialize(debug) File "/root/mailman/src/mailman/database/stock.py", line 64, in initialize self._create(debug) File "/root/mailman/src/mailman/database/stock.py", line 98, in _create touch(url) File "/root/mailman/src/mailman/database/stock.py", line 141, in touch fd = os.open(path, os.O_WRONLY | os.O_NONBLOCK | os.O_CREAT, 0666) OSError: [Errno 2] No such file or directory: '/opt/mailman/data/mailman.db' ** Affects: mailman Importance: Undecided Status: New ** Tags: 3.0 mailman -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

** Changed in: mailman Milestone: None => 3.0.0a6 -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

Can you post your mailman.cfg file? 'bin/mailman info' will try to create the mailman.db file if it doesn't exist, but of course that could fail if say the process doesn't have permission to create the paths, e.g. -----mailman.cfg----- [mailman] layout: foo [paths.foo] var_dir: /foo/mailman ---------- % bin/mailman info Traceback (most recent call last): File "bin/mailman", line 31, in <module> mailman.bin.mailman.main() File "/home/barry/projects/mailman/3.0/src/mailman/bin/mailman.py", line 98, in main initialize(config_file) File "/home/barry/projects/mailman/3.0/src/mailman/core/initialize.py", line 174, in initialize initialize_1(config_path) File "/home/barry/projects/mailman/3.0/src/mailman/core/initialize.py", line 117, in initialize_1 mailman.config.config.load(config_path) File "/home/barry/projects/mailman/3.0/src/mailman/config/config.py", line 106, in load self._post_process() File "/home/barry/projects/mailman/3.0/src/mailman/config/config.py", line 126, in _post_process Switchboard.initialize() File "/home/barry/projects/mailman/3.0/src/mailman/queue/__init__.py", line 94, in initialize config.switchboards[name] = Switchboard(name, path) File "/home/barry/projects/mailman/3.0/src/mailman/queue/__init__.py", line 119, in __init__ makedirs(self.queue_directory, 0770) File "/home/barry/projects/mailman/3.0/src/mailman/utilities/filesystem.py", line 66, in makedirs os.makedirs(path, mode) File "/usr/lib/python2.6/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.6/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.6/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.6/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/foo' -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

** Changed in: mailman Assignee: (unassigned) => Barry Warsaw (barry) ** Changed in: mailman Status: New => Incomplete ** Also affects: mailman/3.0 Importance: Undecided Assignee: Barry Warsaw (barry) Status: Incomplete ** Tags added: mailman3 ** Tags removed: 3.0 mailman -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

When the error occured /opt/mailman existed AND /etc/mailman.cfg used to be like this: p@mailman:~$ cat /etc/mailman.cfg [mailman] site_owner: postmaster@state-of-mind.de # Which paths.* file system layout to use. layout: dev [paths.master] var_dir: /opt/mailman # [database] # The class implementing the IDatabase. # class: mailman.database.stock.StockDatabase # Use this to set the Storm database engine URL. You generally have one # primary database connection for all of Mailman. List data and most rosters # will store their data in this database, although external rosters may access # other databases in their own way. This string supports standard # 'configuration' substitutions. # url: sqlite:///opt/mailman/data/mailman.db # debug: no -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

I just noticed a problem with the mailman.cfg file you posted. You've set the layout to be 'dev' but you're overriding var_dir in the [paths.master] section. That doesn't match, so it's not picking that up. You can verify by running bin/mailman info -p See if s/paths.master/paths.dev/ fixes your problem. -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

* Barry Warsaw <543620@bugs.launchpad.net>:
I just noticed a problem with the mailman.cfg file you posted. You've set the layout to be 'dev' but you're overriding var_dir in the [paths.master] section. That doesn't match, so it's not picking that up. You can verify by running
bin/mailman info -p
See if
s/paths.master/paths.dev/
fixes your problem.
I noticed that too when I posted the config to you. The problem probably is - which is good in this case - that I am not an experienced python user nor developer and the relation between the two didn't strike me. I think I've even looked for a correlation in the original mailman/../mailman.cfg and didn't find one. Anyway. I will change it and see what happens. p@rick
-- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a direct subscriber of the bug.
Status in GNU Mailman: Incomplete Status in GNU Mailman 3.0 series: Incomplete
Bug description: The command "mailman info" crashes if the database path "url" points to a location that does not exist yet:
root@mailman:~/mailman/bin# ./mailman info Traceback (most recent call last): File "./mailman", line 32, in <module> mailman.bin.mailman.main() File "/root/mailman/src/mailman/bin/mailman.py", line 98, in main initialize(config_file) File "/root/mailman/src/mailman/core/initialize.py", line 175, in initialize initialize_2(propagate_logs=propagate_logs) File "/root/mailman/src/mailman/core/initialize.py", line 146, in initialize_2 database.initialize(debug) File "/root/mailman/src/mailman/database/stock.py", line 64, in initialize self._create(debug) File "/root/mailman/src/mailman/database/stock.py", line 98, in _create touch(url) File "/root/mailman/src/mailman/database/stock.py", line 141, in touch fd = os.open(path, os.O_WRONLY | os.O_NONBLOCK | os.O_CREAT, 0666) OSError: [Errno 2] No such file or directory: '/opt/mailman/data/mailman.db'
To unsubscribe from this bug, go to: https://bugs.launchpad.net/mailman/+bug/543620/+subscribe
-- state of mind Digitale Kommunikation http://www.state-of-mind.de Franziskanerstraße 15 Telefon +49 89 3090 4664 81669 München Telefax +49 89 3090 4666 Amtsgericht München Partnerschaftsregister PR 563 -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

* Barry Warsaw <543620@bugs.launchpad.net>:
I just noticed a problem with the mailman.cfg file you posted. You've set the layout to be 'dev' but you're overriding var_dir in the [paths.master] section. That doesn't match, so it's not picking that up. You can verify by running
bin/mailman info -p
See if
s/paths.master/paths.dev/
fixes your problem.
It fixed the problem. p@rick -- state of mind Digitale Kommunikation http://www.state-of-mind.de Franziskanerstraße 15 Telefon +49 89 3090 4664 81669 München Telefax +49 89 3090 4666 Amtsgericht München Partnerschaftsregister PR 563 -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

BTW I am going to change 'bin/mailman info --paths/-p' to '--verbose/-v' in the trunk ;) -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

Cool, let me know. I do think we could use better documentation for the configuration options. ;/ -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.

** Changed in: mailman/3.0 Status: Incomplete => Invalid -- command mailman info fails when Database url does not exist https://bugs.launchpad.net/bugs/543620 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.
participants (2)
-
Barry Warsaw
-
Patrick Ben Koetter