Opened 6 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#13034 closed defect (duplicate)

function env.get_db_cnx() is no longer available with trac 1.2

Reported by: rothan@… Owned by:
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Trac Release:


I've running trac 1.2 with the AnnouncerPlugin (trunk, rev 16171) and get the following errors:

The first one occurs when a message should be send via email:

2017-01-09 14:45:00,158 Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/announcer/", line 576, in _real_send
  File "/usr/lib/python2.7/dist-packages/announcer/distributors/", line 278, in distribute
    address = resolver.get_address_for_name(name, authed)
  File "/usr/lib/python2.7/dist-packages/announcer/", line 58, in get_address_for_name
    db = self.env.get_db_cnx()
AttributeError: 'Environment' object has no attribute 'get_db_cnx'

the second one occurs when a user visits his user preferences, Announcement tab.

File "/usr/lib/python2.7/dist-packages/trac/web/", line 613, in _dispatch_request
File "/usr/lib/python2.7/dist-packages/trac/web/", line 253, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib/python2.7/dist-packages/trac/prefs/", line 109, in process_request
  chosen_provider.render_preference_panel(req, panel_id)
File "/usr/lib/python2.7/dist-packages/announcer/", line 87, in render_preference_panel
  for name, label, template, data in self._get_boxes(req):
File "/usr/lib/python2.7/dist-packages/announcer/", line 82, in _get_boxes
File "/usr/lib/python2.7/dist-packages/announcer/", line 107, in render_announcement_preference_box
  specified = self.setting.get_user_setting(req.session.sid)[1] or ''
File "/usr/lib/python2.7/dist-packages/announcer/util/", line 51, in get_user_setting
  db = self.env.get_db_cnx()

Attachments (0)

Change History (1)

comment:1 Changed 6 weeks ago by Jun Omae

Resolution: duplicate
Status: newclosed

See #12120 and #12982.

Last edited 6 weeks ago by Jun Omae (previous) (diff)

Modify Ticket

as closed The ticket will remain with no owner.
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.