Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#7666 closed defect (fixed)

KeyError: 'announcer/locale' on email notification

Reported by: Crunk Owned by: Steffen Hoffmann
Priority: normal Component: AnnouncerPlugin
Severity: critical Keywords: i18n backwards-incompatible
Cc: Robert Corsaro Trac Release: 0.12


I am using Trac 0.12 and moved from Announcer-Plugin 1.0-a1 to (trunk).

Now, each time a ticket is changed Trac experiences an error. I attached the error information page.

AnnouncerPlugin is configured as follows:

announcer.api.announcementsystem = enabled
announcer.distributors.mail.emaildistributor = enabled
announcer.formatters.ticket.ticketformatter = enabled = enabled
announcer.pref.announcerpreferences = enabled
announcer.producers.attachment.attachmentchangeproducer = enabled
announcer.producers.ticket.ticketchangeproducer = enabled = enabled
announcer.resolvers.sessionemail.sessionemailresolver = enabled
announcer.subscribers.ticket_compat.carboncopysubscriber = enabled
announcer.subscribers.ticket_compat.legacyticketsubscriber = enabled
announcer.subscribers.ticket_components.ticketcomponentsubscriber = enabled
announcer.subscribers.ticket_custom.ticketcustomfieldsubscriber = enabled
announcer.subscribers.watch_users.userchangesubscriber = enabled
announcer.subscribers.watchers.watchsubscriber = enabled
admit_domains =
always_notify_component_owner = false
always_notify_owner = false
always_notify_reporter = false
always_notify_updater = false
default_email_format = text/html
email_address_resolvers = SpecifiedEmailResolver, SessionEmailResolver
ignore_domains =
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = true
smtp_from = trac-no-reply@*****.com
smtp_from_name = Trac
smtp_password =
smtp_port = 25
smtp_replyto = no-reply@*****.com
smtp_server = smtp.*****.com
smtp_subject_prefix = __default__
smtp_timeout = 30
smtp_user =
ticket_email_header_fields = owner, reporter, milestone, component, priority, severity.
ticket_email_subject = Ticket #${}: ${ticket['summary']}.
ticket_subject_template = $prefix $ $summary
use_public_cc = false
use_short_addr = false
use_tls = false

If you need further information... let me know

Attachments (1)

Oops...txt (16.5 KB) - added by Crunk 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Crunk

Attachment: Oops...txt added

comment:1 Changed 8 years ago by Robert Corsaro

Owner: changed from Robert Corsaro to Steffen Hoffmann
Priority: normalhighest
Severity: majorcritical

comment:2 Changed 8 years ago by Steffen Hoffmann

Cc: Robert Corsaro added; anonymous removed
Keywords: i18n backwards-incompatible added
Priority: highestnormal
Summary: Internal error on Email NotificationKeyError: 'announcer/locale' on email notification

Oh well. You're aware, that we added i18n stuff lately, right? So you need to take care about the fancy additional command

python ./ compile_catalog

before packaging. The error you present suggests that something went wrong and directory announcer/locale (holding translatable strings catalogs in different languages) never got created (inside the Python egg). You have Babel >= 0.9.5 installed, don't you?

Most probably it is related to this, so need to push it up to highest prio. :-) Still we might, and possibly we will resort to a more backwards-compatible implementation soon. Until then you'll be out of luck, if you don't take care for this additional dependency, even for native-English applications. Sorry for that, there is a learning curve with developers too. And thanks for taking care and reporting back. Would like to see you continuing your feedback.

comment:3 Changed 8 years ago by Crunk

Hello again.

Now, I am not getting crashes any more.

After killig and repairing my complete Trac installation after installing Babel (I did not have installed Babel on Trac installation) (see Trac Bug #9439 and solution AnnouncerPlugin still did not work as intended.

After one more hour of investigation I found out that the option email_enabled = true also has to be set, and it worked. As mentioned in other Bugs this parameter should be better documented.

AnnouncerPlugin sends mail on correct events... but not using the configured smtp server as it seems... I will keep investigating....

comment:4 Changed 8 years ago by Steffen Hoffmann

Status: newassigned

I've just finished a major rewrite of AnnouncerPlugin's wiki page and hope, that you'll find it easier now to get relevant information for a quick start. Any comments are still appreciated.

comment:5 Changed 8 years ago by Robert Corsaro

Resolution: fixed
Status: assignedclosed

I've turned email_enabled to true by default. I've also changed the way install works so that locales are automatically compiled. You'll still need to make sure Babel is installed before installing TracAnnouncer

comment:6 Changed 7 years ago by Steffen Hoffmann

My recent comment on #7314 applies here as well.

comment:7 Changed 7 years ago by Steffen Hoffmann

(In [10920]) AnnouncerPlugin: Refactor i18n in a more compatible way, refs #7314, #7666, #7380, #8062 and #9192.

Lessons learned meanwhile with other plugins, so the code applied here has actually been tested and proven to work. This reverts [8409] effectively, but let's keep proper Babel and Trac versions for i18n explicitly as an extra.

After these changes the plugin finally loads cleanly in Trac 0.11 again.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.