Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12602 closed defect (duplicate)

AttributeError: 'Environment' object has no attribute 'get_db_cnx'

Reported by: lukasz.matecki@… Owned by: Tetsuya Morimoto
Priority: normal Component: TracTicketReferencePlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

How to Reproduce

While doing a POST operation on /ticket/11, Trac issued an internal error.

Ticket reference plugin is enabled. If disabled, no such thing happens on ticket commit action.

Request parameters:

{u'__FORM_TOKEN': u'b41a05aba7068a2bf87b0b56',
 u'action': u'resolve',
 u'action_resolve_resolve_resolution': u'wontfix',
 u'comment': u'',
 u'field_cc': u'',
 u'field_component': u'MATES-DIO3-MK2 pcb',
 u'field_description': u'Jakby\u015bmy w przysz\u0142o\u015bci chcieli podpi\u0105\u0107 jakie\u015b urz\u0105dzenie na I2C. Je\u015bli mo\u017cna ich nie wykorzysta\u0107 to nale\u017cy je zostawi\u0107 wolne.',
 u'field_keywords': u'',
 u'field_milestone': u'MATES-DIO3-MK1.2 projekt do KONO',
 u'field_priority': u'trivial',
 u'field_reporter': u'Lukasz',
 u'field_summary': u'W miar\u0119 mo\u017cliwo\u015bci zostawi\u0107 piny I2C nieu\u017cywane',
 u'field_ticketref': u'',
 u'field_type': u'enhancement',
 u'field_version': u'MK2.0 (prototyp)',
 'id': u'11',
 u'replyto': u'',
 u'start_time': u'1448740226959000',
 u'submit': u'Zapisz zmiany',
 u'view_time': u'1448740226959000'}

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0

System Information

Trac 1.1.6
Babel 0.9.6
Genshi 0.7 (without speedups)
Pygments 1.6
pysqlite 2.6.0
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
pytz 2011c
RPC 1.1.2
setuptools 12.0.1
SQLite 3.6.21
Subversion 1.7.5 (r1336830)
jQuery 1.8.3
jQuery UI 1.9.2
jQuery Timepicker 1.1.1

Enabled Plugins

AllAttachments r14371
teamcityplugin 0.3.3
tracfilelist 0.1
trachtmlnotificationplugin 0.12.0.1
tracticketreferenceplugin 0.4.0
tracxmlrpc 1.1.2

Interface Customization

shared-htdocs
shared-templates
site-htdocs teamcity, viresco_00.jpg
site-templates

Python Traceback

Traceback (most recent call last):
  File "c:\Python27\lib\site-packages\trac\web\main.py", line 587, in _dispatch_request
    dispatcher.dispatch(req)
  File "c:\Python27\lib\site-packages\trac\web\main.py", line 246, in dispatch
    resp = chosen_handler.process_request(req)
  File "c:\Python27\lib\site-packages\trac\ticket\web_ui.py", line 176, in process_request
    return self._process_ticket_request(req)
  File "c:\Python27\lib\site-packages\trac\ticket\web_ui.py", line 661, in _process_ticket_request
    self._do_save(req, ticket, action)
  File "c:\Python27\lib\site-packages\trac\ticket\web_ui.py", line 1435, in _do_save
    replyto=req.args.get('replyto'))
  File "c:\Python27\lib\site-packages\trac\ticket\model.py", line 413, in save_changes
    listener.ticket_changed(self, comment, author, old_values)
  File "build\bdist.win32\egg\ticketref\api.py", line 78, in ticket_changed
    links = TicketLinks(self.env, ticket)
  File "build\bdist.win32\egg\ticketref\model.py", line 44, in __init__
    self.db = env.get_db_cnx()
AttributeError: 'Environment' object has no attribute 'get_db_cnx'

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by Tetsuya Morimoto

Sorry, that's compatibility issues. I have no time to fix now. Could anyone fix it?

comment:2 Changed 6 years ago by Ryan J Ollos

Resolution: duplicate
Status: newclosed

Closing issue since author has requested issues be reported on BitBucket. Patch provided in BitBucket issue 8, but needs more testing.

comment:3 Changed 6 years ago by Tetsuya Morimoto

I finally released new version 0.5.0 supporting new db api. Sorry for too late action and I appreciate rjollos creating great patch.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Tetsuya Morimoto.
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.