Modify

Opened 5 years ago

Closed 4 years ago

#10320 closed defect (duplicate)

Deleted repos break search

Reported by: ejucovy Owned by: ejucovy
Priority: high Component: MultiRepoSearchPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

If a repository's contents have been cached by the sqlindexer component, and the repository is subsequently removed from Trac, future searches will continue to return that repository's contents, resulting in an error like AttributeError: 'NoneType' object has no attribute 'get_node'.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by ejucovy

Here's a workaround:

  • multireposearch/search.py

    diff --git a/multireposearch/search.py b/multireposearch/search.py
    index 9609ad5..7e8a3de 100644
    a b class MultiRepoSearchPlugin(Component): 
    8686
    8787        for filename, reponame in self.search_backend.find_words(query):
    8888            repo = self.env.get_repository(reponame=reponame, authname=req.authname)
     89            if repo is None:
     90                continue
    8991            node = repo.get_node(filename)
    9092
    9193            if node.kind == Node.DIRECTORY:

comment:2 Changed 4 years ago by ejucovy

Resolution: duplicate
Status: newclosed

Whoops, I just duplicated this ticket as #10792. I decided that the "workaround" is actually the correct fix, and implemented it. Fixed in version 0.4 which I just released.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ejucovy.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.