Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'tracsubtickets/htdocs' #6

Open
white-space opened this issue Jul 18, 2010 · 6 comments
Open

KeyError: 'tracsubtickets/htdocs' #6

white-space opened this issue Jul 18, 2010 · 6 comments

Comments

@white-space
Copy link

I like this plugin but it seems to interfere with other plugins.

Using trac 0.12 with TracSubTicketsPlugin 0.1.0 makes TracTags 0.6 output look like without CSS rendered and TracWysiwyg 0.12.0.2 toggle switch is like removed.

This is a snippet from trac.log:

KeyError: 'tracsubtickets/htdocs'
2010-07-17 05:50:23,634 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/trac/web/chrome.py", line 439, in process_request
    in provider.get_htdocs_dirs() or []
  File "build/bdist.linux-x86_64/egg/tracsubtickets/web_ui.py", line 51, in get_htdocs_dirs
    return [('subtickets', resource_filename(__name__, 'htdocs'))]
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 841, in resource_filename
    self, resource_name
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1311, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1322, in _extract_resource
    zip_stat = self.zipinfo[zip_path]
@t64
Copy link

t64 commented Aug 3, 2010

I also love this plugin but have the same issue but in my case it's with the TracWysiwygPlugin.
Its radio buttons won't appear when this plugin is enabled.
If I first disable and then enable this plugin it will work for a while, haven't quite figured out when it stops working, but it seems that when I have a session running while the this plugin is disabled and then enabled it will work. When I start a new session it stops...
Seems that something is cached in the session.
I essentially get the same output in trace.log as white-space.

I'm using trac 0.12, tracsubticketsplugin 0.1.0 and tracwysiwyg 0.12.0.2.

@FlorianLudwig
Copy link

This can be solved by creating an empty directory "htdocs" within the .egg, for example:
unzip TracSubTicketsPlugin-0.1.0-py2.5.egg
mkdir tracsubtickets/htdocs
zip -r TracSubTicketsPlugin-0.1.0-py2.5.egg tracsubtickets

@matthew-f
Copy link

Hi. I tried the above recommendation, but got the following error listed at the end of this comment. I have given full access to the user, and have even tried granting write access to user, group and other, but it still can't extract the egg after adding the htdocs directory.

I'm afraid I'm a novice at apache/python. Any recommendations would be greatly appreciated.

Error log

2011-01-07 14:31:26,978 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/pkg/lib/python2.6/site-packages/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/pkg/lib/python2.6/site-packages/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/pkg/lib/python2.6/site-packages/trac/web/chrome.py", line 439, in process_request
    in provider.get_htdocs_dirs() or []
  File "build/bdist.netbsd-4.0_STABLE-i386/egg/tracsubtickets/web_ui.py", line 51, in get_htdocs_dirs
    return [('subtickets', resource_filename(__name__, 'htdocs'))]
  File "/usr/pkg/lib/python2.6/site-packages/pkg_resources.py", line 882, in resource_filename
    self, resource_name
  File "/usr/pkg/lib/python2.6/site-packages/pkg_resources.py", line 1352, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "/usr/pkg/lib/python2.6/site-packages/pkg_resources.py", line 1359, in _extract_resource
    manager, os.path.join(zip_path, name)
  File "/usr/pkg/lib/python2.6/site-packages/pkg_resources.py", line 1406, in _extract_resource
    manager.extraction_error()  # report a user-friendly error
  File "/usr/pkg/lib/python2.6/site-packages/pkg_resources.py", line 928, in extraction_error
    raise err
ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  [Errno 21] Is a directory

The Python egg cache directory is currently set to:

  /usr/tracconfig/eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
ExtractionError: Can't extract file(s) to egg cache

@sosada
Copy link

sosada commented Jan 26, 2011

I was able to solve this issue by creating a new dir /htdocs/css/ under the following build directory (/build/lib/tracsubtickets/). I then added this file to the dir:
https://github.com/tonin/trac-subtickets-plugin/blob/master/tracsubtickets/htdocs/css/subtickets.css

Finally, I rebuilt the egg file and that solved the issue.

@inequation
Copy link

Confirming both bug and solution.

@rjollos
Copy link
Contributor

rjollos commented Oct 23, 2012

I'm not sure that the initial WysiwygPlugin issues are related to the issues reported near the end of this ticket, however to address the latter issues, I wonder if someone could described how they created and installed the egg, so that I can try to reproduce. I haven't had any luck reproducing the issue so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants