No handlers could be found for logger "bzr"

Bug #393037 reported by Reuben Firmin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bzr-email-notifier
Fix Committed
Medium
Nicholas Allen

Bug Description

For one of our repositories, we don't get email, and the following error is printed to the log:

No handlers could be found for logger "bzr"

Revision history for this message
Nicholas Allen (nick-allen) wrote : Re: [Bug 393037] [NEW] No handlers could be found for logger "bzr"

This sounds like it could be a bazaar installation problem as it seems
an exception is thrown by bzrlib. Does it work if you turn off the diff
attachment by setting diff-line-limit=0 in your config file? If you pull
the latest changes to bzr-email-notifier you can pass a -v argument on
the command line and it will print more information about what it is
doing. You could use this option to find which revision is causing the
problem and, as a workaround, set the last_revision_mailed option in the
.bzr/branch/branch.conf file to this revision.

I would also suggest posting on the Bazaar mailing list about this as a
Bazaar developer may be able to shed more light on what is happening here.

Changed in bzr-email-notifier:
status: New → Incomplete
Revision history for this message
Martitza (martitzam) wrote :

I am also seeing this problem. This is my first time trying to set up bzr-email-notifier, so I could be making a silly mistake.

Environment: Ubuntu Jaunty
Python 2.6.2
Cheetah 2.0.1-2ubuntu3
bzr 2.0.0-1~bazaar~jaunty

My bzr repos and branches are stored in subdirectories of ~/Projects.
(My ~/Projects is *not* a shared repo, just an ordinary directory.)

Here is my example.conf, where everything in <angle brackets> has actually been replaced with valid data, including email addresses and passwords with all necessary permissions.

[DEFAULT]
state-file=last-emailed-revisions.txt
update-working-tree=False
pull-from-parent=False
to=<email_1 redacted for security>
from=<email_2 redacted for security>

[smtp]
server=<smtp_server redacted for security>
user=<user redacted for security>
password=<password redacted for security>

[commits]
to=<email_1 redacted for security>
from=$revision.committer
subject=$relative_path: $revision_number $summary
body=templates/plain/commit-message.txt
diff-line-limit=0

[template-settings]
branch_base=~/Projects

Note that diff-line-limit=0 as suggested elsewhere in this thread, and when I run

./bzr_email_notifier.py -v -c example.conf ~/Projects/

as myself (the owner of the bzr branches) I get

No handlers could be found for logger "bzr"
No 'new-branches' section in configuration - emails won't be sent when new branches are created
No 'removed-branches' section in configuration - emails won't be sent when branches are deleted

The last two messages are expected for my config file. The first message is not expected. I have run bzr break-locks on all of my branches. No problems found.

Revision history for this message
Nicholas Allen (nick-allen) wrote :

It seems this could be a problem if bzr doesn't have permission to write to its .bzr.log file (see https://bugs.launchpad.net/gentoo/+bug/296445)

Do you get this message if you just run bzr version?

Changed in bzr-email-notifier:
status: Incomplete → Confirmed
importance: Undecided → Medium
assignee: nobody → Nicholas Allen (nick-allen)
Revision history for this message
Martitza (martitzam) wrote :

Nicholas asks: "Do you get this message if you just run bzr version?"

Maritza answers: 'bzr version' works fine. I use bzr every day.

Revision history for this message
Nicholas Allen (nick-allen) wrote :

I found a possible workaround here: http://excid3.com/2009/06/no-handlers-could-be-found-for-logger/

As I am unable to reproduce this bug myself could you try adding the following lines to the import section in bzr_email_notifier.py (as suggested by link above) and let me know if this makes any difference?

import logging
logging.basicConfig()

Revision history for this message
Martitza (martitzam) wrote :

I think we are making progress. I read http://excid3.com/2009/06/no-handlers-could-be-found-for-logger/ and placed the suggested code at the end of the import and before def main(). Here is the diff:

=== modified file bzr_email_notifier.py
--- bzr_email_notifier.py 2009-10-15 09:22:47 +0000
+++ bzr_email_notifier.py 2009-10-19 03:28:08 +0000
@@ -30,6 +30,9 @@
 from configuration import Configuration, SendEmailError
 ###

+import logging
+logging.basicConfig()
+
 def main():

     try:

when I run

bzr-email-notifier$ ./bzr_email_notifier.py -v -c example.conf ~/Projects/

I no longer get the 'no handlers' error. But now I see this, which is probably unrelated:

WARNING:bzr:unknown command "revert"
WARNING:bzr:Unable to load plugin 'explorer' from '/home/martitza/.bazaar/plugins'
No 'new-branches' section in configuration - emails won't be sent when new branches are created
No 'removed-branches' section in configuration - emails won't be sent when branches are deleted

The first message is scary. Does that mean bzr-email-notifier is trying to 'bzr revert' my branches?!?!?

The second message is odd, because I run bzr-explorer all the time. I seem to recall that by design Bazaar Explorer is stored in .../plugins/explorer but the actual name of the plugin is explore. Originally, it had to be invoked as 'bzr explore' but 'bzr explorer' was recently registered as an alias. (Or maybe I got that backward.) Anyway, if I temporarily uninstall bzr-explorer, I get just these last two messages:

No 'new-branches' section in configuration - emails won't be sent when new branches are created
No 'removed-branches' section in configuration - emails won't be sent when branches are deleted

These messages are expected (because those sections of example.conf are empty).

So I think the logger problem is solved, and we have discovered an incompatibility with bzr-explorer. It is very interesting that the 'revert' warning went away when I removed bzr-explorer.

Changed in bzr-email-notifier:
status: Confirmed → Fix Committed
Revision history for this message
Luis Arias (kaaloo) wrote :

Hi, this was happenning to me again after upgrading to bzr 2.3.0. I patched bzr-email-notifier on my lp:~kaaloo/+junk/log-fix branch (sorry there was a repository format error when I tried to push to lp:~kaaloo/bzr-email-notifier/log-fix).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.