Ticket #9786 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

'Environment' object has no attribute 'db_query' trying to do a multireposearch reindex_all

Reported by: patrick Assigned to: ejucovy
Priority: normal Component: MultiRepoSearchPlugin
Severity: normal Keywords:
Cc: rjollos Trac Release: 0.12

Description (Last modified by rjollos)

I'm running Trac 0.12.2 (which is an upgrade from 0.11). There is an SVN repo and a git repo attached and I would like to be able to search both.

The installation process went fine but when trying to run "multireposearch reindex_all" i get an error:

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

I'm running this on Arch linux and python 2.7. Please let me know if there is any more info I can provide.

Attachments

0.12-compat.diff (1.7 kB) - added by ejucovy on 02/11/12 15:48:04.

Change History

02/10/12 23:10:53 changed by ejucovy

  • status changed from new to assigned.

Thanks for the report. Looks like I accidentally used a Trac database API which is new in the unreleased 0.13 line -- which is what I developed the plugin against. (http://trac.edgewall.org/wiki/TracDev/DatabaseApi#Trac0.13API)

The fix for this should be simple, but I suspect I did this in other places in the code as well -- so I'll try to catch them all and post a patch here shortly.

02/11/12 05:48:58 changed by rjollos

  • cc set to rjollos.
  • description changed.

02/11/12 15:48:04 changed by ejucovy

  • attachment 0.12-compat.diff added.

02/11/12 15:52:26 changed by ejucovy

I've uploaded a patch to use the 0.12-compatible database API: http://trac-hacks.org/attachment/ticket/9786/0.12-compat.diff (it's generated from git diff so it should be applied with patch -p1 < 0.12-compat.diff)

Please give this a try and let me know if it works for you. I don't have a 0.12 installation available at the moment so I only tested that the patch didn't break my 0.13 install :)

(follow-up: ↓ 5 ) 02/13/12 15:35:53 changed by anonymous

Thanks for the patch; unfortunately I'm still getting the same error. I ran "grep db_query *" in /usr/lib/python2.7/site-packages/trac_MultiRepoSearchPlugin-0.1-py2.7/egg/multireposearch and it returned 0 results, so I'm not sure where it's getting that from.

I tried running an upgrade on the environment and got the message, "Database is up to date, no upgrade necessary".

(in reply to: ↑ 4 ) 02/13/12 15:48:53 changed by anonymous

Replying to anonymous:

Thanks for the patch; unfortunately I'm still getting the same error. I ran "grep db_query *" in /usr/lib/python2.7/site-packages/trac_MultiRepoSearchPlugin-0.1-py2.7/egg/multireposearch and it returned 0 results, so I'm not sure where it's getting that from.

That's ... really strange. Could you try editing the code inside the egg by hand, to confirm whether simple edits are reflected in the running code? For example, try adding import pdb; pdb.set_trace() at the beginning of the reindex_all method in /usr/lib/python2.7/site-packages/trac_MultiRepoSearchPlugin-0.1-py2.7/egg/multireposearch/search.py (around line 27) -- and see whether the PDB breakpoint is activated when you run trac-admin multireposearch reindex_all again.

02/13/12 16:02:25 changed by ejucovy

(Previous comment was by me also.)

You might also try simply reinstalling the plugin. I've created a tag of the plugin's codebase containing this patch. You can download and install it in ZIP or TAR.GZ format here:

* https://github.com/boldprogressives/trac-MultiRepoSearchPlugin/tarball/th-9786 * https://github.com/boldprogressives/trac-MultiRepoSearchPlugin/zipball/th-9786

02/13/12 17:28:34 changed by anonymous

  • status changed from assigned to closed.
  • resolution set to fixed.

I reinstalled using the tarball and that appears to have fixed it; the reindex is in progress. Thanks again!

02/13/12 17:35:36 changed by ejucovy

Great! I've just merged the patch back to the trunk and cut a 0.2 release with the change. (http://pypi.python.org/pypi/trac-MultiRepoSearchPlugin/0.2) Thanks again for the bug report.


Add/Change #9786 ('Environment' object has no attribute 'db_query' trying to do a multireposearch reindex_all)




Change Properties
Action