Trouble witn TicketNotifyEmail deprecated

14 views
Skip to first unread message

Theodor Norup

unread,
Feb 12, 2023, 1:48:17 PM2/12/23
to Trac Users
Hi all

I'm looking into upgrading  "my" plugins to Trac 1.4 and (eventuallly) 1.6, testing the upgrades both on clean installations and on a clone of my production system with a lot of other plugins installed.

On the production clone I run into these log messages

.... Skipping ... ImportError: cannot import name TicketNotifyEmail

and

.... Skipping ... ImportError: cannot import name Context

I have set the log level to DEBUG, but that does not indicate where the import is attempted. The clean installations seem to work, so apparently the cause lies with two or more plugins being in conflict - but it is probable worth noticing that the production system has been online since 2013, so something could be hidden in the update history...

I have tried to disable any plugin that taste just a bit of tickets, but no luck so far.

My production system clone is Trac 1.2.5, upgraded to 1.4.3 as part of the test.

I have no clue where to continue the search. Any hint or pointer would be most appreciated.

Thanks in advance

Theodor

Markus Rosjat

unread,
Feb 12, 2023, 2:48:39 PM2/12/23
to trac-...@googlegroups.com
hi theodor.

this is usually a hint that the code in the plugin has some trouble with the python or trac version you running so you might need to  look into the logs for tracebacks that point to the errors you mentions.
in a debug setting you should get pretty good logs to figure where the code stops the import of a plugin. I guess something in the trac code changed from 1.2.x to 1.4.x that your plugin code wants to import but cant
so you might need to look for a newer version of your plugin.

cheers

Markus

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/731123e8-1c5d-412e-8dd1-cbc2e845edebn%40googlegroups.com.

Theodor Norup

unread,
Feb 12, 2023, 4:38:09 PM2/12/23
to Trac Users
Hi Markus

Thanks, so far. The trouble is that the error is reported during Trac initialisation, ie. when plugins are loaded. That is, the import exception is caught by some handler and the only debug info in the log is the line shown in the first post.

However, I've found the offending lines in trac-subticketsplugin (which I'm maintaining):

try:
    TicketNotifyEmail = None

    from trac.notification.api import NotificationSystem

    from trac.ticket.notification import TicketChangeEvent

except ImportError:

    NotificationSystem = TicketChangeEvent = None

    from trac.ticket.notification import TicketNotifyEmail

Ie. the problem is that the NotificationSystem import falls, whereafter the plugin falls back to importing TicketNotifyEmail. I can see in the admin panel that the notification system *is* enabled - so I wonder why I can't import it..

BR Theodor

Markus Rosjat

unread,
Feb 12, 2023, 4:53:51 PM2/12/23
to trac-...@googlegroups.com
well as i said before it seems some code is trying to import stuff that isnt there anymore.
So in Trac 1.4.x there is no TicketNotifyEmail in trac.ticket.notification so the plugin that is throwing the 
error is looking for code that got either moved or replaced with something else. 

api ref 1.4

so we are back to the point where you need to look for a plugin version that is compatible with trac 1.4

cheers

MArkus

Theodor Norup

unread,
Feb 13, 2023, 6:59:30 AM2/13/23
to Trac Users

No, the problem was in a completely different corner:

My production clone was running with a very old version of IniAdmin which made the notificatio plugin fail.  The only hint was that trac.ticket.notification's admin panel came up completely blank, followed by a stack trace in trac.log. The exception happened during IniAdmin processing. Upgrade IniAdmin -> the notification component works -> my original problem gone.

Apparently, IniAdmin must have made notification fail already during Trac  core initialisation which shortly thereafter made SubTickets fail during plugin load, first being unable to import trac.ticket.notification and then falling back to TicketEmailProvider - which also failed.

Case closed.

BR and thanks

Theodor

Markus Rosjat

unread,
Feb 13, 2023, 7:03:08 AM2/13/23
to trac-...@googlegroups.com
nice that you could resolve your problem, after upgrading everything in the plugins folder most of the problems are gone or the plugin cant be used without working on the code.

cheers

Markus


Reply all
Reply to author
Forward
0 new messages