Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13306 closed defect (worksforme)

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

Reported by: joakim Owned by: Ryan J Ollos
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

How to Reproduce

While doing a GET operation on /wiki, Trac issued an internal error.

This issue is rather easy to reproduce tracd -V 1.2.2 and updated pip install --upgrade TracTags then enabled the TracTags from both /admin and directly in TracIni.

Track is running standalone on tracd behind nginx reverse_proxy

Request parameters:

{}

User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0

System Information

Trac 1.2.2
Babel 2.5.1
Genshi 0.7 (with speedups)
Pygments 2.2.0
pysqlite 2.6.0
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609]
pytz 2017.2
setuptools 36.6.0
SQLite 3.11.0
jQuery 1.11.3
jQuery UI 1.11.4
jQuery Timepicker 1.5.5

Enabled Plugins

TracTags 0.7.dev0
TracWysiwyg 0.12.0.3
WikiAutoComplete 1.3

Interface Customization

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 623, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 259, in dispatch
    iterable=chrome.use_chunked_encoding)
  File "/usr/local/lib/python2.7/dist-packages/trac/web/chrome.py", line 1129, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "/usr/lib/python2.7/dist-packages/genshi/core.py", line 133, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "/usr/local/lib/python2.7/dist-packages/trac/web/chrome.py", line 1442, in inner
    data)
  File "/usr/lib/python2.7/dist-packages/tractags/wiki.py", line 101, in filter_stream
    return self._wiki_view(req, stream)
  File "/usr/lib/python2.7/dist-packages/tractags/wiki.py", line 167, in _wiki_view
    tags = self._page_tags(req)
  File "/usr/lib/python2.7/dist-packages/tractags/wiki.py", line 162, in _page_tags
    tags = sorted(tag_system.get_tags(req, resource))
  File "/usr/lib/python2.7/dist-packages/tractags/api.py", line 238, in get_tags
    .get_resource_tags(req, resource))
  File "/usr/lib/python2.7/dist-packages/tractags/model.py", line 98, in resource_tags
    db = _get_db(env, db)
  File "/usr/lib/python2.7/dist-packages/tractags/model.py", line 113, in _get_db
    return db or env.get_db_cnx()
AttributeError: 'Environment' object has no attribute 'get_db_cnx'

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

You are running 0.7dev. The latest is 0.9 (see pypi:TracTags). The issue is fixed in 0.9.

Try pip uninstall TracTags followed by pip install TracTags. If it doesn't work, please give output of pip install TracTags. Be sure to stop your webserver while un-installing/re-installing the package.

Last edited 7 years ago by Ryan J Ollos (previous) (diff)

comment:2 Changed 7 years ago by joakim

Thx, that actually did it :) just sad I didn't think of this myself :/

Modify Ticket

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