Trac 插件不工作

发布于 2024-11-26 20:11:15 字数 1110 浏览 1 评论 0原文

在工作中,我们在几个内部 wiki 和一个外部 wiki 上使用 Trac。最近我们发现需要一个新插件。在学习了一些教程后,我们安装了一个插件以确保它可以工作。事实并非如此。我们一直在试图弄清楚。下面我将列出我在尝试让它工作时所做的步骤和各种事情。

1)我去了trac-hacks网站并下载了他们的helloworld插件,我认为使用他们的代码我不会犯错误。

2)我在安装了trac的机器上使用python setup.py bdist_egg编译并制作了一个egg,以确保它使用的是相同的Python版本。

3)然后我将其复制到 /directory/where/trac/is/plugins/ 文件夹并 chmod 755 文件 Egg 文件。

4)然后我重新启动了http,无法找到重新启动trac的更好方法,所以这可能就是我的问题所在。它不起作用。所以我删除了plugins中的egg文件夹

5)通过trac->administration->plugins上传它并再次重新启动httpd。没有什么。

6) 我意识到我必须编辑 trac.ini 文件并添加 helloworld.* = 在组件下启用并重新启动 Web 服务器。

很可能是我,但任何帮助将不胜感激!

它是来自 trachack 的 helloworld 插件,主要显示 hello world 并且有一个按钮。没有提供错误消息,因此谷歌搜索很困难。

我假设它正在使用root,这就是我构建它的用户。我会看看是否有其他人,只是快速浏览一下,尽管我没有看到任何其他人可以使用它。我只将egg文件复制到plugins文件夹中,我在其他地方设置了另一个文件夹并构建它并cp到plugins文件夹中。我很高兴知道我这样做是正确的,因为查找有关如何重新启动 trac 的文档几乎什么也没找到,他们只是说重新启动 trac 或重新启动 apache。明天晚些时候我会查看日志。感谢您的回复!我们还使用 trac .12.1。

因此,在查看日志文件后,似乎它甚至没有加载插件,找不到任何地方表明它正在加载或有任何错误。现在我们有一些用于各种项目的 trac 站点,其中一个站点已经安装了插件,所以我去了那里,将测试插件放在那里并检查了日志,但它也不起作用。所以我只想得出结论,这是插件或我们已经安装的东西,而不是我。我相信我会尝试制作一个并进行测试。感谢您的帮助!

At work we are using Trac on several internal wiki's and an external wiki. REcently we found the need for a new plugin. After we going through a few tutorials we went to install a plugin to make sure it would work. It didn't. We've been going through trying to figure out. Below I will list the steps and various things I did while trying to get it to work.

1) I went to trac-hacks website and downloaded their hellow world plugin, figured I couldn't make a mistake using their code.

2) I compiled and made an egg using python setup.py bdist_egg on the machine where trac is installed, to make sure it's the same Python version being used.

3) I then copied it over to /directory/where/trac/is/plugins/ folder and chmod 755 the file egg file.

4) I then restarted http, unable to find a better way of restaring trac so this may be where my problem is. It didn't work. So I deleted the egg folder in plugins

5) Uploaded it via trac->administration->plugins and restarted httpd again. Nothing.

6) I realized I had to edit the trac.ini file and added helloworld.* = enabled under component and restarted the web server.

It's quite possible it's me but any help would be greatly appreciated!

Its the helloworld plugin from trachack, essentially displays hello world and theres a button. There are no error messages provided, hence why googling was hard.

I'm assuming that it's using root and that's the user I built it with. I will look into seeing if it's anybody else, just taking a quick look though I don't see anything else that could be using it. I only copied the egg file to the plugins folder, I set up another folder elsewhere and built it and cp to the plugins folder. I'm glad to know I was doing that right because looking up documentation on how to restart trac turns up practically nothing, they just say restart trac or restart apache. I will look into the logs later on tomorrow. Thanks for the replies! Also we are using trac .12.1.

So after looking at the log files it seems that it doesn't even load the plugin, can't find anywhere that says it's loading or any errors with it. Now we have a few trac sites for various projects and one of the sites already has plugins installed so I went there and and put the test plugin there and checked logs and it didn't work either. So I'm just going to conclude it's the plugin or something we already have in place and it's not me. I believe I'm going to try and make one and test it. Thanks for the help!

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

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

发布评论

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

评论(3

温柔女人霸气范 2024-12-03 20:11:15

听起来你建造的鸡蛋是正确的。将其复制到插件文件夹后,更改文件的所有者和组(我假设您使用的是 Linux,因为您提到了 chmod)以匹配您的网络服务器使用的帐户。我不确定这是否绝对必要,但这对我来说一直有效。

我可能误读了你的#4,但听起来你将整个 Egg 文件夹复制到了你的插件目录中。只需要复制 .egg 文件,它是一个独立的包。我认为 Trac 不会在子目录中查找 .egg 文件。

重新启动网络服务器是重新启动 Trac 的最简单方法。事实上,我不知道还有什么其他方法可以做到这一点。

当涉及到插件问题时,Trac 的日志通常是非常好的信息来源。我建议将 Trac 的日志级别设置为 DEBUG,然后关闭 Web 服务器。清除 Trac 日志文件的内容,然后启动 Web 服务器并在服务器完全恢复联机后复制 Trac 日志文件。执行此过程两次:一次安装插件,一次不安装插件。日志文件中的差异应该可以很好地表明问题所在。一旦您习惯了日志通常的样子,您将能够就地读取日志,而无需清除日志并生成它的两个版本。

顺便问一下,您使用的 Trac 版本是什么?

It sounds like you built the egg correctly. After you copy it into your plugins folder, change the file's owner and group (I'm assuming you're on Linux since you mentioned chmod) to match the account that your webserver uses. I'm not sure if that's strictly necessary, but it's what's always worked for me.

I may be misreading your #4, but it sounds like you copied the whole egg folder to your plugins directory. Only the .egg file needs to be copied over, it's a self-contained package. I don't think Trac looks for .egg files in subdirectories.

Restarting your webserver is the easiest way to restart Trac. Actually, I'm not aware of any other way to do it.

When it comes to plugin problems, Trac's log is usually a very good source of information. I recommend setting Trac's log level to DEBUG, then shut down the web server. Clear out the contents of Trac's log file, then start the web server and make a copy of Trac's log file after the server has completely come back online. Do this process twice: once with the plugin installed and once without it installed. The difference in the logfiles should give you a good indication of what the problem is. Once you get accustomed to what your logs normally look like, you'll be able to read the log in place without clearing it out and generating two versions of it.

By the way, what Trac version are you using?

等往事风中吹 2024-12-03 20:11:15

检查 Trac 版本和下载的插件
相反 python setup.py bdist_egg 尝试 python setup.py install

Check the Trac version and downloaded plugin
instead python setup.py bdist_egg try python setup.py install

醉城メ夜风 2024-12-03 20:11:15

这是一个相当老的线程,但因为我曾经遇到过同样的问题:

请确保使用与运行 Trac 相同的 Python 版本构建 .egg!
之间的向后兼容性Python 版本在这里并不重要,因为 Trac 在加载 .egg 文件之前会从 .egg 文件中读取有关 Python 版本的信息,以确保它是兼容的。

(小版本号应该不重要,因此当使用 2.7.3 构建时,您应该能够使用 Python 2.7.10 运行 .egg,但当使用 2.6.x 构建时则不行。查看版本号写入 .egg 文件名。)

Quite an old thread, but since I ran into the same problem at one point:

Make sure you build the .egg with the same Python version that you use to run Trac with!
Backwards compatibility between Python versions does not matter here, because Trac reads information about the Python version out of the .egg file before it even loads it, to make sure it is compatible.

(Small version numbers should not matter, so you should be able to run a .egg with Python 2.7.10 when it was built with 2.7.3, but not when it was built with 2.6.x. Look at the Version number that is written into the .egg file name.)

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