Modify

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#9786 closed defect (fixed)

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

Reported by: patrick Owned by: ejucovy
Priority: normal Component: MultiRepoSearchPlugin
Severity: normal Keywords:
Cc: Ryan J Ollos Trac Release: 0.12

Description (last modified by Ryan J Ollos)

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 (1)

0.12-compat.diff (1.7 KB) - added by ejucovy 13 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 13 years ago by ejucovy

Status: newassigned

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.

comment:2 Changed 13 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed
Description: modified (diff)

Changed 13 years ago by ejucovy

Attachment: 0.12-compat.diff added

comment:3 Changed 13 years ago 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 :)

comment:4 Changed 13 years ago 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".

comment:5 in reply to:  4 Changed 13 years ago 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.

comment:6 Changed 13 years ago 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:

comment:7 Changed 13 years ago by anonymous

Resolution: fixed
Status: assignedclosed

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

comment:8 Changed 13 years ago 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.

Modify Ticket

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