Edgewall Software

Opened 7 years ago

Closed 6 years ago

#5632 closed defect (fixed)

Non-egg plugins show up multiple times in a multi-project setup

Reported by: Dave Abrahams <dave@…> Owned by: osimons
Priority: normal Milestone: 0.10.5
Component: general Version: devel
Severity: critical Keywords: plugin
Release Notes:
API Changes:


For simple, single-python-file plugins, my admin panel shows N checkboxes where N is the number of trac instances in my multi-project environment.

Attachments (1)

plugins.png (134.0 KB) - added by Dave Abrahams <dave@…> 7 years ago.
Screeshot of Admin panel

Download all attachments as: .zip

Change History (10)

comment:1 Changed 7 years ago by Dave Abrahams <dave@…>

  • Severity changed from normal to critical

I take it back; N is seemingly random. And this is not a benign presentation bug; the plugins will take effect N times. That can result in N transformations of the same wiki text, for example, where only one was intended.

comment:2 follow-up: Changed 7 years ago by cboos

  • Milestone changed from 0.11 to 0.10.5

N corresponds to the number of environments that have been activated so far and that contain a version of the plugin.

It's a serious issue but I don't think it's 0.11 specific. Can someone checks if this happens on 0.10-stable as well?

comment:3 in reply to: ↑ 2 Changed 7 years ago by Dave Abrahams <dave@…>

Replying to cboos:

N corresponds to the number of environments that have been activated so far and that contain a version of the plugin.

I'm pretty sure it's not that, unless I don't understand what you mean by "activated so far." My setup has 9 trac environments. The attached screenshot is just the first of 5 similar pages!

Changed 7 years ago by Dave Abrahams <dave@…>

Screeshot of Admin panel

comment:4 Changed 7 years ago by Dave Abrahams <dave@…>

FWIW I am using [inherit] to share a single plugins directory.

comment:5 Changed 7 years ago by cboos

  • Keywords plugin added

Well, when I start a server with two environments, each containing a few single file plugins in <env>/plugins, then everything is fine for the first environment I visit (/admin/plugins lists the expected plugins). Then, I go to the second environment and there I see the expected plugins, plus the ones already loaded by the first environment. Going back to the first env now will also show all mixed plugins.

This is with 0.10.5dev. I somehow have the impression this is old news, but I can't find a pre-existing ticket.

In your case, there could be additional issues…

comment:6 Changed 7 years ago by osimons <simon-code@…>

I think the problem could be fixed by the changes in the plugin loader made at [6016:6017].

Could you please verify?

comment:7 Changed 6 years ago by osimons

  • Owner changed from jonas to osimons

In case we want this for 0.10 (which is probably a good idea), I've tested this patch on that branch as well (as of r 6233):

  • 0.10-stable/trac/loader.py

    4949                if plugin_name not in loaded_components: 
    5050                    env.log.debug('Loading file plugin %s from %s' % \ 
    5151                                  (plugin_name, plugin_file)) 
    52                     module = imp.load_source(plugin_name, plugin_file) 
     52                    if plugin_name not in sys.modules: 
     53                        module = imp.load_source(plugin_name, plugin_file) 
    5354                    loaded_components.append(plugin_name) 
    5455                    if auto_enable and plugin_name + '.*' \ 
    5556                            not in env.config['components']: 

Think it should be correct - works fine for me, but more testing is welcome.

comment:8 follow-up: Changed 6 years ago by cboos

+1 for backporting this

comment:9 in reply to: ↑ 8 Changed 6 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

Replying to cboos:

+1 for backporting this

Ported in [6256]. Closes ticket.

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from osimons to the specified user.

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

Note: See TracTickets for help on using tickets.