Modify

Opened 14 years ago

Closed 14 years ago

Last modified 13 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

Description

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

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

AnnouncerPlugin is configured as follows:

[components]
announcer.api.announcementsystem = enabled
announcer.distributors.mail.emaildistributor = enabled
announcer.formatters.ticket.ticketformatter = enabled
announcer.formatters.wiki.wikiformatter = enabled
announcer.pref.announcerpreferences = enabled
announcer.producers.attachment.attachmentchangeproducer = enabled
announcer.producers.ticket.ticketchangeproducer = enabled
announcer.producers.wiki.wikichangeproducer = 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
[announcer]
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.id}: ${ticket['summary']}.
ticket_subject_template = $prefix $ticket.id: $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 14 years ago.

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by Crunk

Attachment: Oops...txt added

comment:1 Changed 14 years ago by Robert Corsaro

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

comment:2 Changed 14 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 ./setup.py 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 14 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 http://trac.edgewall.org/ticket/9439 and solution http://trac.edgewall.org/ticket/9439#comment:16 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 14 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 14 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 13 years ago by Steffen Hoffmann

My recent comment on #7314 applies here as well.

comment:7 Changed 13 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
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.