如何修复开始出现与 PYTHON_EGG_CACHE 相关错误的 Trac 安装?

发布于 2024-07-07 04:01:45 字数 803 浏览 7 评论 0原文

我们一直在使用 Trac 进行任务/缺陷跟踪,一切进展顺利,但今天早上它开始出现 500 错误。 查看 Apache error_log,我得到一个堆栈跟踪,最终结果为:

PythonHandler trac.web.modpython_frontend:
  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 13] Permission denied: '/.python-eggs'

The Python egg cache directory is currently set to:

  /.python-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

因此,我将 PYTHON_EGG_CACHE 显式设置为 /srv/trac/plugin-cache。 我重新启动了阿帕奇。 但我遇到了同样的错误(它仍然显示“egg 缓存目录当前设置为:\n\n /.python_eggs。”)

我应该如何继续? 重新安装 Trac 是最简单的方法吗? 如果我走这条路,我需要采取哪些步骤来确保不会丢失现有数据?

We've been using Trac for task/defect tracking and things were going well enough, but this morning it started serving up a 500 error. Looking in the Apache error_log, I get a stack trace that culminates in:

PythonHandler trac.web.modpython_frontend:
  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 13] Permission denied: '/.python-eggs'

The Python egg cache directory is currently set to:

  /.python-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

So I explicitly set PYTHON_EGG_CACHE to /srv/trac/plugin-cache. I restarted Apache. Yet I get the same error (it still says "egg cache directory current set to: \n\n /.python_eggs.")

How should I proceed? Is the simplest thing to do to reinstall Trac? If I go that route, what steps do I need to take to ensure that I don't lose existing data?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

岁月如刀 2024-07-14 04:01:45

根据他们的错误跟踪系统,这个问题应该在 0.11 中修复。

如果不是这种情况,您应该尝试将环境变量传递给 apache,因为在配置文件中执行 SetEnv 不起作用。 添加类似的内容应该可以。

export PYTHON_EGG_CACHE=/tmp/python_eggs

在用于启动 apache 的脚本中

That should be fixed in 0.11 according to their bug tracking system.

If that's not the case you should try to pass the environment var to apache, since doing a SetEnv in the configuration file doesn't work. Adding something like

export PYTHON_EGG_CACHE=/tmp/python_eggs

to the script you use to start apache should work.

陪我终i 2024-07-14 04:01:45

今年早些时候,我从 Trac 10.4 升级到 0.11 时遇到了同样的问题。 一定是某些东西发生了变化,这个问题才突然出现——更新了 Python 或 Apache 安装?

我不记得我试图解决这个问题的所有排列,但我最终不得不使用 SetEnv PYTHON_EGG_CACHE /.python-eggs 并创建具有 777 权限的 /.python-eggs 。 这可能不是最好的解决方案,但它解决了问题。

我从来没有调查过根本原因是什么。 作为 agnul 说,这可能已在后续的 Trac 版本中得到修复。

I ran into the same problem when upgrading from Trac 10.4 to 0.11 earlier this year. Something must have changed for this problem to have just suddenly appeared -- an updated Python or Apache installation?

I don't remember all of the permutations I tried to solve this, but I ended up having to use SetEnv PYTHON_EGG_CACHE /.python-eggs and create /.python-eggs with 777 permissions. This might not be the best solution, but it fixed the problem.

I never investigated what the root cause was. As agnul says, this may have been fixed in a subsequent Trac release.

送君千里 2024-07-14 04:01:45

我与 PYTHON_EGG_CACHE 进行了多次斗争,但我从未找到设置它的正确方法 - apache 的 envvars、httpd.conf (SetEnv 和 PythonOption),没有任何效果。 最后我只是手动解压了所有的蟒蛇蛋,反正只有两三个——问题就解决了。 我一直不明白为什么人们首先压缩重量不超过几千字节的文件......

I have wrestled many a battle with PYTHON_EGG_CACHE and I never figured out the correct way of setting it - apache's envvars, httpd.conf (SetEnv and PythonOption), nothing worked. In the end I just unpacked all python eggs manually, there were only two or three anyway - problem gone. I never understood why on earth people zip up files weighting no more than a few kilobytes in the first place...

同尘 2024-07-14 04:01:45

我有同样的问题。 就我而言,该目录不存在,因此我创建了该目录并将其 chown 给 apache 用户(我的 centos 4.3 机器上为 apache)。 然后确保它对该目录具有读写权限。 如果拥有该目录的组包含 apache 用户,则可以通过授予该目录的 rw 权限来实现。 如果您不知道,一个简单的 ps aux|grep httpd 应该会显示您的服务器正在运行的帐户。 如果您无法找到该目录,请记住 ls 命令中的 -a,因为它是一个“隐藏”目录。

I had the same problem. In my case the directory wasn't there so I created and chown'ed it over to the apache user (apache on my centos 4.3 box). Then made sure it had read-write permissions on the directory. You could get by with giving rw rights to the directory if the group that owns the directory contains the apache user. A simple ps aux|grep httpd should show you what account your server is running under if you don't know it. If you have trouble finding the directory remember the -a on the ls command since it is a "hidden" directory.

早乙女 2024-07-14 04:01:45

我发现在站点配置中使用 PythonOption 指令不起作用,但 SetEnv 起作用。 环境变量路由也可以工作。

I found that using the PythonOption directive in the site config did not work, but SetEnv did. The environment variable route will also work though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文