Can anyone tell me what I've done? Trac is now broken...

41 views
Skip to first unread message

Ron Kyle

unread,
Nov 22, 2014, 5:46:15 AM11/22/14
to trac-...@googlegroups.com
Hello. I'm new to this group and to Trac, so please bear with me if this is a really stupid question or I don't seem to make sense.

Basically, I was trying to install a plugin, TracAccountManager 0.4.4. Our Trac web interface had a nice little button for installing plugins, so I tried it. Unfortunately, (at least I think this is where I went wrong) I then pointed this plugin installed to the setup.py in the directory I unzipped the .tar.gz to. I never built an .egg out of it.
BTW, I've got Trac running with Apache on an Ubuntu Virtual Machine.

Now anytime I go to any of the project addresses, such as 192.168.1.X/projects/myproject or 192.168.1.X/projects/myproject/login, I get this python error:

MOD_PYTHON ERROR

ProcessId:      2389
Interpreter:    'main_interpreter'

ServerName:     'localhost'
DocumentRoot:   '/var/www/'

URI:            '/projects'
Location:       '/projects'
Directory:      None
Filename:       '/var/www/projects'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'trac.web.modpython_frontend'

Traceback (most recent call last):

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "build/bdist.linux-i686/egg/trac/web/modpython_frontend.py", line 149, in handler
    gateway.run(dispatch_request)

  File "build/bdist.linux-i686/egg/trac/web/wsgi.py", line 89, in run
    response = application(self.environ, self._start_response)

  File "build/bdist.linux-i686/egg/trac/web/main.py", line 411, in dispatch_request
    env_paths)

  File "build/bdist.linux-i686/egg/trac/web/main.py", line 682, in send_project_index
    use_cache=not environ['wsgi.run_once'])

  File "build/bdist.linux-i686/egg/trac/env.py", line 655, in open_environment
    env = env_cache.setdefault(env_path, open_environment(env_path))

  File "build/bdist.linux-i686/egg/trac/env.py", line 661, in open_environment
    env = Environment(env_path)

  File "build/bdist.linux-i686/egg/trac/env.py", line 216, in __init__
    self.setup_config()

  File "build/bdist.linux-i686/egg/trac/env.py", line 429, in setup_config
    load_components(self, plugins_dir and (plugins_dir,))

  File "build/bdist.linux-i686/egg/trac/loader.py", line 116, in load_components
    loadfunc(env, search_path, auto_enable=plugins_dir)

  File "build/bdist.linux-i686/egg/trac/loader.py", line 92, in _load_py_files
    module = imp.load_source(plugin_name, plugin_file)

  File "/usr/local/trac/projects/myproject/plugins/setup.py", line 66, in <module>
    **extra

  File "/usr/lib/python2.6/distutils/core.py", line 140, in setup
    raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg

SystemExit: usage: mod_python [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: mod_python --help [cmd1 cmd2 ...]
   or: mod_python --help-commands
   or: mod_python cmd --help

error: no commands supplied


Can anyone tell me what the heck is wrong, or really just how to go about fixing it? I think I somehow broke the project, but I really have no idea. I've been searching and I've learned a bit, but I still can't seem to figure it out yet.

Also, don't know if it's important, but my trac-admin only offers me two commands. Somewhere I saw that this was caused by the project being "broken", but I don't really know if the example would even apply to me. That's where I got the notion that I "broke the project", BTW.

Any help or explanation would be most appreciated. Thanks.


Steffen Hoffmann

unread,
Nov 22, 2014, 8:10:53 AM11/22/14
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22.11.2014 11:46, Ron Kyle wrote:
> Can anyone tell me what the heck is wrong, or really just how to go about fixing it?

You did not provide much to us yet, and I really hope you know more than
you told us by now.

To "fix the project" you'll need to go to the place, where most project
content lives by default: the Trac environment directory. It is right,
if you see folders like /config, /db, /log, /files (or /attachments for
older Trac versions) /plugins and /templates inside it.

Go to /plugins and try to delete anything not looking like a Python egg
or simple Python skript file (*.py). Something like 'setup.cfg' or
'setup.cfg' certainly doesn't belong there. Restart you web server, and
you should be already back in the comfort zone.

And never try "installing" Trac plugins without a clue on the underlying
system layout again but read more on TracPlugins ASAP.

Steffen Hoffmann


[1] http://trac.edgewall.org/wiki/TracPlugins
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlRwi1IACgkQ31DJeiZFuHfATACguqz+km9bkHEd4Y0KWvYVV1bF
bJcAoJPBi95zHKJw0CH7/J+NwmGdx/xA
=AVmj
-----END PGP SIGNATURE-----

RjOllos

unread,
Nov 22, 2014, 12:06:33 PM11/22/14
to trac-...@googlegroups.com


On Saturday, November 22, 2014 5:10:53 AM UTC-8, hasienda wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22.11.2014 11:46, Ron Kyle wrote:
> Can anyone tell me what the heck is wrong, or really just how to go about fixing it?

You did not provide much to us yet, and I really hope you know more than
you told us by now.

To "fix the project" you'll need to go to the place, where most project
content lives by default: the Trac environment directory. It is right,
if you see folders like /config, /db, /log, /files (or /attachments for
older Trac versions) /plugins and /templates inside it.

Go to /plugins and try to delete anything not looking like a Python egg
or simple Python skript file (*.py). Something like 'setup.cfg' or
'setup.cfg' certainly doesn't belong there. Restart you web server, and
you should be already back in the comfort zone.

Even more specifically, it sounds like he uploaded a "setup.py", so that file needs to be removed from the "plugins" dir.

Same issue was recently reported here:

RjOllos

unread,
Nov 22, 2014, 1:24:01 PM11/22/14
to trac-...@googlegroups.com
Opened a ticket for this frequently occurring issue:

Ron Kyle

unread,
Nov 23, 2014, 7:30:51 AM11/23/14
to trac-...@googlegroups.com
Wow, I really just have to delete the setup.py from the /plugins directory? I didn't think it mattered cause it wasn't an .egg...
"And never try "installing" Trac plugins without a clue on the underlying
system layout again but read more on TracPlugins ASAP."

Haha, you said it there. I've been reading up on it a bit and was wondering a few things...
All this easy_install stuff is just downloading the egg and putting it in the plugins directory, right? If I put an .egg in /plugins and enable it in the trac config file then it's installed? Just reset the server and go?
I
If I have the source, I just bulid the .egg, put it in /plugins and enable it? I know, pretty much same question...
Thanks for the help

RjOllos

unread,
Nov 23, 2014, 7:46:06 AM11/23/14
to trac-...@googlegroups.com


On Sunday, November 23, 2014 4:30:51 AM UTC-8, Ron Kyle wrote:
Wow, I really just have to delete the setup.py from the /plugins directory? I didn't think it mattered cause it wasn't an .egg...

Yes, it sounds like you just need to delete the file. Trac can also load single-file plugins, which are just a single .py file, and that's why it's trying to load setup.py. It's likely that Trac should be more robust and it should not bring the whole application down when the .py file is not a valid single-file plugin. That is the reason why #11846 was opened.
 
"And never try "installing" Trac plugins without a clue on the underlying
system layout again but read more on TracPlugins ASAP."

Haha, you said it there. I've been reading up on it a bit and was wondering a few things...
All this easy_install stuff is just downloading the egg and putting it in the plugins directory, right? If I put an .egg in /plugins and enable it in the trac config file then it's installed? Just reset the server and go?
I
If I have the source, I just bulid the .egg, put it in /plugins and enable it? I know, pretty much same question...
Thanks for the help

Both of the scenarios you describe should work. You can also install plugins in the Python site-packages directory, so it is not even required to drop them into the "plugins" dir. Some advise against doing this, but it may not matter in your case, and in particular if you are using a virtual environment that is dedicated to your Trac instance.

 

Golden john

unread,
Nov 24, 2014, 2:00:51 AM11/24/14
to trac-...@googlegroups.com
mod-python is not supported anymore , You just go with another mod_wsgi option, because  mod-python is no longer support , i was using  mod_wsgi is working .

Thanks & Regards
Golden John S

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To post to this group, send email to trac-...@googlegroups.com.
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

RjOllos

unread,
Nov 24, 2014, 6:58:30 PM11/24/14
to trac-...@googlegroups.com
On Sunday, November 23, 2014 11:00:51 PM UTC-8, goldenjohn51 wrote:
mod-python is not supported anymore , You just go with another mod_wsgi option, because  mod-python is no longer support , i was using  mod_wsgi is working .

Thanks & Regards
Golden John S

While mod_python has not been recommended by the Trac project for some time, this needs to be reassessed in light of the resurrection of the mod_python project. See the following thread for more info:

Ron Kyle

unread,
Nov 25, 2014, 12:45:31 AM11/25/14
to trac-...@googlegroups.com
Well, I deleted the .py files and that pretty much worked, but the web login page wasn't coming up. Reinstalling the Trac account manager plugin fixed it though. 
Thanks for your help and everything; now, I wanted to ask what you're talking about. Mod-python is how Trac works with Python on top of Apache? What's the benefit of mod_msgi as compared to mod-python, why was mod-python support dropped in its favor and why has it been resurrected? Just curious; don't feel you have to answer if you don't want to since I'll figure it out sooner or later reading about it.
Thanks again :)

Ryan Ollos

unread,
Nov 25, 2014, 12:48:10 AM11/25/14
to trac-...@googlegroups.com
On Mon, Nov 24, 2014 at 9:45 PM, Ron Kyle <adol...@gmail.com> wrote:
Well, I deleted the .py files and that pretty much worked, but the web login page wasn't coming up. Reinstalling the Trac account manager plugin fixed it though. 
Thanks for your help and everything; now, I wanted to ask what you're talking about. Mod-python is how Trac works with Python on top of Apache? What's the benefit of mod_msgi as compared to mod-python, why was mod-python support dropped in its favor and why has it been resurrected?

I don't have a good answer for the other questions, but the reason mod_python support was dropped in Trac is that the mod_python project was no longer being maintained. It appears that someone forked it on GitHub and has started to maintain it in the past year or so. See text at top of page: http://trac.edgewall.org//wiki/TracModPython
 
Just curious; don't feel you have to answer if you don't want to since I'll figure it out sooner or later reading about it.
Thanks again :)

On Monday, November 24, 2014 6:58:30 PM UTC-5, RjOllos wrote:
On Sunday, November 23, 2014 11:00:51 PM UTC-8, goldenjohn51 wrote:
mod-python is not supported anymore , You just go with another mod_wsgi option, because  mod-python is no longer support , i was using  mod_wsgi is working .

Thanks & Regards
Golden John S

While mod_python has not been recommended by the Trac project for some time, this needs to be reassessed in light of the resurrection of the mod_python project. See the following thread for more info:

--

Cooke, Mark

unread,
Nov 25, 2014, 2:32:02 AM11/25/14
to trac-...@googlegroups.com
Hello,

> -----Original Message-----
> From: trac-...@googlegroups.com [mailto:trac-...@googlegroups.com] On
> Behalf Of Ron Kyle
>
> Well, I deleted the .py files and that pretty much worked, but the web login
> page wasn't coming up. Reinstalling the Trac account manager plugin fixed it
> though.
> Thanks for your help and everything; now, I wanted to ask what you're talking
> about. Mod-python is how Trac works with Python on top of Apache? What's the
> benefit of mod_msgi as compared to mod-python, why was mod-python support
> dropped in its favor and why has it been resurrected? Just curious; don't
> feel you have to answer if you don't want to since I'll figure it out sooner
> or later reading about it.

mod_python had not been actively developed for a while when it was "donated" to the apache foundation who formed Quetzalcoatl. This did not appear to gather much activity and it was moved to the Apache "Attic" in June 2010:

http://attic.apache.org/projects/quetzalcoatl.html

The more recent history is in the project home page:

http://modpython.org/

~ mark c

> Thanks again :)
>
> On Monday, November 24, 2014 6:58:30 PM UTC-5, RjOllos wrote:
>
> On Sunday, November 23, 2014 11:00:51 PM UTC-8, goldenjohn51 wrote:
>
> mod-python is not supported anymore , You just go with another
> mod_wsgi <http://trac.edgewall.org/wiki/TracModWSGI> option, because mod-
> python is no longer support , i was using mod_wsgi is working .
>
>
> Thanks & Regards
> Golden John S
>
>
> While mod_python has not been recommended by the Trac project for some
> time, this needs to be reassessed in light of the resurrection of the
> mod_python project. See the following thread for more info:
> https://groups.google.com/d/msg/trac-dev/k6k13HDeOzA/ULwPUiVtC1cJ
> <https://groups.google.com/d/msg/trac-dev/k6k13HDeOzA/ULwPUiVtC1cJ>
>

Reply all
Reply to author
Forward
0 new messages