id summary reporter owner description type status priority milestone component version severity resolution keywords cc branch changelog apichanges internalchanges 9978 Guard against pkg_resources.resource_filename errors Christian Boos "During a trac-svn-hook resync (`trac-admin ... changeset added /var/svn/trac 10433`): {{{ [pid 1052 139942713288416] 2011-01-14 18:46:06,498 Trac[env] INFO: -------------------------------- environment startup [Trac 0.13dev-r10426] ------------------------ -------- [pid 1052 139942713288416] 2011-01-14 18:46:09,926 Trac[console] ERROR: Exception in trac-admin command: Traceback (most recent call last): ... File ""build/bdist.linux-x86_64/egg/trac/versioncontrol/admin.py"", line 95, in _do_changeset_added rm.notify('changeset_added', reponame, revs) File ""build/bdist.linux-x86_64/egg/trac/versioncontrol/api.py"", line 620, in notify repositories = self.get_repositories_by_dir(dir) ... File ""build/bdist.linux-x86_64/egg/tracext/hg/backend.py"", line 210, in __init__ locale_dir = pkg_resources.resource_filename(__name__, 'locale') ... File ""/usr/local/virtualenv/0.13dev/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/pkg_resources.py"", line 887, in extraction_error raise err ExtractionError: Can't extract file(s) to egg cache [Errno 17] File exists: '/var/www/.python-eggs/TracMercurial-0.13.0.1dev_r10432-py2.5.egg-tmp/tracext/hg/locale' }}} So a duplicate of #9107 for the TracMercurial plugin. We can fix that particular occurrence, but I wonder if it wouldn't make sense to add a wrapper for the pkg_resources stuff (in `trac.utils.dist`?) and use that. That wrapper should be ""process safe"" not only thread-safe, so using a lock won't cut it. Maybe trapping such errors and restarting the call //once// after a random amount of time between .3 to 1s would be enough." defect new normal next-major-releases general 0.13dev normal setuptools