Edgewall Software
Modify

Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#9053 closed defect (worksforme)

debug log does not list macro load error

Reported by: mbuisman@… Owned by:
Priority: low Milestone:
Component: general Version: 0.11.7
Severity: minor Keywords: log macro bitesized
Cc: Thijs Triemstra Branch:
Release Notes:
API Changes:
Internal Changes:

Description

observed behaviour: wikipage gives "Error: Failed to load processor XXX, No macro or processor named 'XXX' found", when trying to use macro XXX. The errorlog, in DEBUG level, only mentions "Loading file plugin XXX…".

expected behaviour: when an error like this is shown on the wikipage, more details about the error can be found in the log file.

Context I'm trying to get the Anchor macro to work in 0.11.7, and I moved it to the environments plugins directory, with 777 and www-data user, but to no avail. The log file is not helping, while I think it should. (note that version 0.11.7 is not in the version popup)

Attachments (0)

Change History (10)

comment:1 by Remy Blank, 14 years ago

Keywords: bitesized added

comment:2 by Thijs Triemstra, 13 years ago

Version: 0.11.7

comment:3 by Thijs Triemstra, 13 years ago

Cc: Thijs Triemstra added
Keywords: needinfo added

I'm not able to reproduce this with 0.12 or 0.13.

A macro with a syntax-error gets logged:

2011-10-10 21:00:29,644 Trac[loader] ERROR: Failed to load plugin from /home/thijs/workspaces/opensource/test-trac/plugins/helloworld_sample.py: 
Traceback (most recent call last):
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/loader.py", line 90, in _load_py_files
    module = imp.load_source(plugin_name, plugin_file)
  File "/home/thijs/workspaces/opensource/test-trac/plugins/helloworld_sample.py", line 5
    class HelloWorldMacro(WikiMacroBase)::
                                         ^
SyntaxError: invalid syntax (helloworld_sample.py, line 5)

Macro with unimplemented expand_macro:

2011-10-10 21:07:55,221 Trac[formatter] DEBUG: Executing Wiki macro HelloWorld by provider <helloworld_sample.HelloWorldMacro object at 0x7f915c9a1690>
2011-10-10 21:07:55,222 Trac[formatter] ERROR: Macro HelloWorld(None) failed: 
Traceback (most recent call last):
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/wiki/formatter.py", line 734, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/wiki/formatter.py", line 334, in process
    text = self.processor(text)
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/wiki/formatter.py", line 321, in _macro_processor
    text)
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/wiki/macros.py", line 78, in expand_macro
    raise NotImplementedError
NotImplementedError: 

And another syntax error:

2011-10-10 21:11:21,662 Trac[formatter] DEBUG: Executing Wiki macro HelloWorld by provider <helloworld_sample.HelloWorldMacro object at 0x7f915cd25450>
2011-10-10 21:11:21,662 Trac[formatter] ERROR: Macro HelloWorld(None) failed: 
Traceback (most recent call last):
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/wiki/formatter.py", line 734, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/wiki/formatter.py", line 334, in process
    text = self.processor(text)
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/wiki/formatter.py", line 318, in _macro_processor
    text, self.args)
  File "/home/thijs/workspaces/opensource/test-trac/plugins/helloworld_sample.py", line 32, in expand_macro
    (Markup.escape(texts), Markup.escape(repr(args)))
NameError: global name 'texts' is not defined

Looks more like a permissions problem?

comment:4 by Remy Blank, 13 years ago

Milestone: next-minor-0.12.x
Resolution: worksforme
Status: newclosed

I think we added some logging code in 0.12.x, in particular, the traceback when loading plugins. To the OP, please reopen if you can reproduce the issue with 0.12.x.

comment:5 by Thijs Triemstra, 13 years ago

Keywords: needinfo removed

comment:6 by anonymous, 12 years ago

I'm using trac 0.12.x version and trying to integrate addcommentmacro. Here is the exception that I'm getting. Any help would be appreciated. Thanks in advance

2012-07-02 15:03:58,032 Trac[formatter] ERROR: Macro AddComment(None) failed: 
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 720, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 304, in process
    text = self.processor(text)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 291, in _macro_processor
    text)
  File "build\bdist.win32\egg\trac\wiki\macros.py", line 68, in expand_macro
    raise NotImplementedError
NotImplementedError: 
2012-07-02 15:03:58,033 Trac[formatter] DEBUG: Executing Wiki macro AddComment by provider <addcomment.macro.AddCommentMacro object at 0x0A6265F0>
2012-07-02 15:03:58,033 Trac[formatter] ERROR: Macro AddComment(None) failed: 
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 720, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 304, in process
    text = self.processor(text)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 291, in _macro_processor
    text)
  File "build\bdist.win32\egg\trac\wiki\macros.py", line 68, in expand_macro
    raise NotImplementedError
NotImplementedError: 
Last edited 12 years ago by Jun Omae (previous) (diff)

comment:8 by anonymous, 12 years ago

Resolution: worksforme
Status: closedreopened

comment:9 by Jun Omae, 12 years ago

Resolution: worksforme
Status: reopenedclosed

Your issue is a PluginIssue. Please don't reopen for it, please ask on the MailingList and / or IrcChannel.

comment:10 by Remy Blank, 12 years ago

More specifically, the macro you are trying to run doesn't override expand_macro(). I looked at the code of th:AddCommentMacro, and the 0.11 version does have that method. Did you happen to install an earlier version (0.10 and earlier don't have the method)?

Anyway, please follow-up on the MailingList or IrcChannel. Thank you.

in reply to:  9 comment:11 by anonymous, 12 years ago

Replying to jomae:

Your issue is a PluginIssue. Please don't reopen for it, please ask on the MailingList and / or IrcChannel.

Sorry about reopening the ticket, I was not aware of MailingList. Thanks

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.