Modify

Opened 6 years ago

Closed 5 years ago

#12960 closed defect (fixed)

'Internal server error 500'

Reported by: ntmlod Owned by: ejucovy
Priority: normal Component: WorkflowActionButtonsPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

No issue on other pages but the site went down when browsing a ticket, here is the error message:

malformed header from script 'trac.cgi': Bad header: <trac.ticket.default_workflow.

Attachments (0)

Change History (11)

comment:1 Changed 6 years ago by Jun Omae

Please post the details of your system information and trac.log after enabling TracLogging with DEBUG level.

comment:2 Changed 6 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

Please reopen if you can provide more information.

comment:3 Changed 5 years ago by ntmlod

Resolution: worksforme
Status: closedreopened

I get back to this issue but I do not have any worthy additional information. I'm running 0.2 version of the plugin (under /tags) on 1.0.1 Trac release. As I already wrote, nothing happens until I browse to a ticket.

During my first try, I edited web_ui.py

  • workflow_actionbuttons/web_ui.py

     
    1111
    1212    # ITemplateProvider methods
    1313    def get_templates_dirs(self):
    14         return [resource_filename(__name__, 'templates')]
     14        #return [resource_filename(__name__, 'templates')]
     15    return []
    1516
    1617    def get_htdocs_dirs(self):
    1718        return [

because

2017-04-24 16:27:51,255 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 233, in dispatch
    content_type)
  File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 975, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 933, in load_template
    self.get_all_templates_dirs(), auto_reload=self.auto_reload,
  File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 649, in get_all_templates_dirs
    dirs.extend(provider.get_templates_dirs() or [])
  File "build/bdist.linux-x86_64/egg/workflow_actionbuttons/web_ui.py", line 14, in get_templates_dirs
    return [resource_filename(__name__, 'templates')]
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 945, in resource_filename
    self, resource_name
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1634, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1653, in _extract_resource
    timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])
KeyError: 'workflow_actionbuttons/templates'

Then I got the same crash with the server.

On trac.log there is unfortunately nothing really obvious, the plugin is added and loaded and I emphasize on the following extract only which seems to be related to 'workflow' between numerous lines for permission checkings:

...
2017-04-24 16:28:30,853 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/ticket/1831'">
2017-04-24 16:28:30,853 Trac[api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow', 'TicketWorkflowNotifier']
2017-04-24 16:28:30,854 Trac[api] DEBUG: ResourceWorkflowSystem - parsing config section peerreview-resource_workflow
2017-04-24 16:28:30,855 Trac[api] DEBUG: ResourceWorkflowSystem - parsing config section peerreviewer-resource_workflow
...
2017-04-24 16:28:30,913 Trac[default_workflow] DEBUG: render_ticket_action_control: action "leave"
...
2017-04-24 16:28:30,916 Trac[default_workflow] DEBUG: render_ticket_action_control: action "reopen"
...
2017-04-24 16:28:31,341 Trac[default_workflow] DEBUG: render_ticket_action_control: action "leave"
2017-04-24 16:28:31,343 Trac[default_workflow] DEBUG: render_ticket_action_control: action "reopen"
...

But no error message on the log until failure.

comment:4 Changed 5 years ago by Ryan J Ollos

Please install the latest version from master of the github repository.

comment:5 Changed 5 years ago by ntmlod

Well I switch to the trunk, no more server crash but the plugin does not work. In the log, I got this issue

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/trac/loader.py", line 68, in _load_eggs
    entry.load(require=True)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build/bdist.linux-x86_64/egg/workflow_actionbuttons/__init__.py", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/workflow_actionbuttons/web_ui.py", line 8, in <module>
  File "build/bdist.linux-x86_64/egg/workflow_actionbuttons/api.py", line 5, in <module>
ImportError: cannot import name tag

I found a fix for this retro-compatibility issue (Trac v1.0.1)

  • workflow_actionbuttons/api.py

     
    22
    33from trac.config import ConfigSection
    44from trac.core import Component
    5 from trac.util.html import Markup, tag
     5from trac.util.html import Markup, html as tag
    66from trac.ticket.api import TicketSystem
    77
    88

Then I got

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 605, in process_request
    in provider.get_htdocs_dirs() or []
  File "build/bdist.linux-x86_64/egg/workflow_actionbuttons/web_ui.py", line 21, in get_htdocs_dirs
    ('fontawesome', resource_filename(__name__, 'htdocs/fontawesome')),
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 945, in resource_filename
    self, resource_name
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1634, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1653, in _extract_resource
    timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])
KeyError: 'workflow_actionbuttons/htdocs/fontawesome'

I remember getting the same kind of error with 'locale' dir without Babel installation but here I can't figure out what is missing

comment:6 Changed 5 years ago by ejucovy

Hrm. What commands/tools/method are you using to install the plugin? (downloading an egg, git clone + python setup.py develop, git clone + python setup.py install, something with pip, something with easy_install, something with wheels, ........?)

comment:7 Changed 5 years ago by Ryan J Ollos

Looks like some of the resources aren't included in a bdist_egg or bdist_wheel.

(pve) ~/Documents/Workspace/trac-dev/src/trac-WorkflowActionButtonsPlugin$python setup.py bdist_egg
...
(pve) ~/Documents/Workspace/trac-dev/src/trac-WorkflowActionButtonsPlugin/dist$cd dist/
(pve) ~/Documents/Workspace/trac-dev/src/trac-WorkflowActionButtonsPlugin/dist$unzip trac_WorkflowActionButtons-0.3-py2.7.egg
Archive:  trac_WorkflowActionButtons-0.3-py2.7.egg
  inflating: EGG-INFO/dependency_links.txt  
  inflating: EGG-INFO/entry_points.txt  
  inflating: EGG-INFO/not-zip-safe   
  inflating: EGG-INFO/PKG-INFO       
  inflating: EGG-INFO/SOURCES.txt    
  inflating: EGG-INFO/top_level.txt  
  inflating: workflow_actionbuttons/__init__.py  
  inflating: workflow_actionbuttons/__init__.pyc  
  inflating: workflow_actionbuttons/api.py  
  inflating: workflow_actionbuttons/api.pyc  
  inflating: workflow_actionbuttons/web_ui.py  
  inflating: workflow_actionbuttons/web_ui.pyc  
  inflating: workflow_actionbuttons/htdocs/main/actionbuttons.css  
  inflating: workflow_actionbuttons/htdocs/main/actionbuttons.js 

Investigating ...

I highly recommend updating to at least Trac 1.0.13.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:8 Changed 5 years ago by Ryan J Ollos

Okay, submitted a pull request. With changes:

$unzip trac_WorkflowActionButtons-0.3-py2.7.egg
Archive:  trac_WorkflowActionButtons-0.3-py2.7.egg
  inflating: EGG-INFO/dependency_links.txt  
  inflating: EGG-INFO/entry_points.txt  
  inflating: EGG-INFO/not-zip-safe   
  inflating: EGG-INFO/PKG-INFO       
  inflating: EGG-INFO/SOURCES.txt    
  inflating: EGG-INFO/top_level.txt  
  inflating: workflow_actionbuttons/__init__.py  
  inflating: workflow_actionbuttons/__init__.pyc  
  inflating: workflow_actionbuttons/api.py  
  inflating: workflow_actionbuttons/api.pyc  
  inflating: workflow_actionbuttons/web_ui.py  
  inflating: workflow_actionbuttons/web_ui.pyc  
  inflating: workflow_actionbuttons/htdocs/fontawesome/css/font-awesome.css  
  inflating: workflow_actionbuttons/htdocs/fontawesome/css/font-awesome.min.css  
  inflating: workflow_actionbuttons/htdocs/fontawesome/fonts/fontawesome-webfont.eot  
  inflating: workflow_actionbuttons/htdocs/fontawesome/fonts/fontawesome-webfont.svg  
  inflating: workflow_actionbuttons/htdocs/fontawesome/fonts/fontawesome-webfont.ttf  
  inflating: workflow_actionbuttons/htdocs/fontawesome/fonts/fontawesome-webfont.woff  
  inflating: workflow_actionbuttons/htdocs/fontawesome/fonts/FontAwesome.otf  
  inflating: workflow_actionbuttons/htdocs/jquery.modal/close.png  
  inflating: workflow_actionbuttons/htdocs/jquery.modal/jquery.modal.css  
  inflating: workflow_actionbuttons/htdocs/jquery.modal/jquery.modal.min.js  
  inflating: workflow_actionbuttons/htdocs/main/actionbuttons.css  
  inflating: workflow_actionbuttons/htdocs/main/actionbuttons.js 

comment:9 Changed 5 years ago by Ryan J Ollos

Please try the latest master, changes have been committed to address both issues.

comment:10 Changed 5 years ago by ntmlod

@ejucovy svn checkout + python setup.py

@rjollos yeah I know that v1.0.1 is a bit outdated now but I'm just the admin of our project and not of the global forge so I undergo the situation.

Thanks for the patch, it works now.

comment:11 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: reopenedclosed

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.