Changes between Version 10 and Version 11 of TracSlimTimerPlugin


Ignore:
Timestamp:
Apr 27, 2007, 9:42:06 AM (8 years ago)
Author:
tst
Comment:

Moving installation instructions to a separate page.

Legend:

Unmodified
Added
Removed
Modified
  • TracSlimTimerPlugin

    v10 v11  
    8787== Installation ==
    8888
    89 Most of all read [http://trac.edgewall.org/wiki/TracPlugins TracPlugins]. Also, if you get stuck [http://trac.edgewall.org/wiki/TracDev/PluginDevelopment PluginDevelopment] is very useful.
    90 
    91  1. Install the plugin. If you want to run it from source you might use something like,
    92 
    93 {{{
    94 /opt/trac/0.10.3/install/bin/python setup.py develop -md /var/trac/0.10.3/var/trac/plugins
    95 }}}
    96 
    97 Otherwise you can can make the egg and use `easy_install`. e.g.
    98 
    99 {{{
    100 /opt/trac/0.10.3/install/bin/python setup.py bdist_egg
    101 }}}
    102 
    103 Then run `/opt/trac/0.10.3/install/bin/easy_install <egg>` where `<egg>` is whatever got dumped in your `dist` directory.
    104 
    105 You might have some trouble with dependencies. If you do check below under [#dependencies Dependencies] below.
    106 
    107  2. Enable the plugin in trac.ini. For example, in `/var/trac/0.10.3/var/trac/conf/trac.ini.` you should add `tracslimtimer.* = enabled` under `[components]`, e.g.
    108 
    109 {{{
    110 ...
    111 [components]
    112 ...
    113 tracslimtimer.* = enabled
    114 }}}
    115 
    116  3. Upgrade (setup) the environment for the plugin by running trac-admin, e.g.
    117 
    118 {{{
    119 /opt/trac/0.10.3/install/bin/trac-admin /var/trac/0.10.3/var/trac upgrade
    120 }}}
    121 
    122 This adds the slimtimer_id custom ticket field. If you skip this step you'll probably get an error in the error.log (see below for more information on troubleshooting).
    123 
    124 {{{
    125 [Tue Apr 24 12:50:34 2007] [error] [client 10.0.10.177] PythonHandler trac.web.modpython_frontend: TracError: The Trac Environment needs to be upgraded. Run trac-admin /var/trac/0.10.3/var/trac upgrade", referer: ...
    126 }}}
    127 
    128  4. Restart the trac server, e.g.
    129 
    130 {{{
    131 /opt/trac/0.10.3/install/etc/init.d/httpd restart
    132 }}}
    133 
    134 {{{
    135 #!html
    136 <a name="dependencies"/>
    137 }}}
    138 == Dependencies ==
    139 
    140 If you have trouble with installation it may well be because of the dependencies. There are two dependencies: !ElementTree and MySQL-python aka MySQLdb.
    141 
    142 The main dependency of is !ElementTree. It is listed as a dependency in `setup.py` file so if you're  lucky simply installing the egg might result in the !ElementTree module being downloaded. Chances are though you will have trouble here. The best option is just to `easy_install` it.
    143 
    144 You can learn all about `easy_install` at: http://peak.telecommunity.com/DevCenter/EasyInstall
    145 
    146 Make sure you use trac's version of `easy_install`, e.g.
    147 
    148 {{{
    149 e.g. /opt/trac/0.10.3/install/bin/easy_install
    150 }}}
    151 
    152 Running this version of `easy_install` will mean the packages are installed in the appropriate site-packages folder so trac's version of Python can find them.
    153 
    154 So just try something like:
    155 
    156 {{{
    157 /opt/trac/0.10.3/install/bin/easy_install elementtree
    158 }}}
    159 
    160 After installing, you'll need to restart the trac server. This can be done like so:
    161 
    162 {{{
    163 /opt/trac/0.10.3/install/etc/init.d/httpd restart
    164 }}}
    165 
    166 The other dependency is MySQL-python. This module can also be installed using `easy_install` and implements the Python DB-API for MySQL.
    167 
    168 NOTE: The latest version of MySQL-python that is compatible with Python 2.3 does not support the authentication protocol used by some MySQL servers. You must use at least Python 2.4 so that you can use the most recent version of MySQL-python.
    169 
    170 For more information about this module see:
    171 
    172  * The cheese shop page: http://cheeseshop.python.org/pypi/MySQL-python/1.2.2
    173 
    174 == Troubleshooting ==
    175 
    176 '''1. Just disable the plugin'''
    177 
    178 If you run in to trouble the easiest thing to do so you can keep working is just to disable the !TracSlimTimer plugin. Go to the admin page in trac, Plugins, !TracSlimTimer 0.1.0. Then untick the "Enable" box next to each component (although it is probably only the `TracSlimTimerTicketChangeListener` component that will get in your way). Select "Apply Changes" and restart trac.
    179 
    180 '''2. Inspect the logs'''
    181 
    182 If you actually want to fix the problem you should start with the logs:
    183 
    184  * `/var/trac/0.10.3/log/httpd/trac.log` — This is usually the most helpful log. You can set the logging level to 'debug' under the Administration page (see 'General', 'Logging'). The !TracSlimTimer plugin writes quite a few things to this log so it's worth a look.
    185  * `/var/trac/0.10.3/log/httpd/error.log` — Sometimes errors show up here. I think these are mostly errors encountered while loading plugins like syntax errors.
    186 
    187 '''3. But I've got nothing'''
    188 
    189 I came across one occasion where the whole web server would just crash with no log, nothing, just a seg fault. The problem seemed to be that Apache's version of expat (1.95.7) was conflicting with Python's (1.95.8). It would happen whenever a module was loaded that used expat (e.g. elementtree and I think genshi too). The solution was simply to upgrade the system (and also Apache's) expat to 1.95.8. See [http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash this article] for details.
    190 
    191 '''4. Restart'''
    192 
    193 So you've changed the code and yet you're still getting the problem? I don't know how Python/trac's caching works but often it doesn't reload the file properly. One way to ensure the file is reloaded is to restart trac:
    194 
    195 {{{
    196 /opt/trac/0.10.3/install/etc/init.d/httpd restart
    197 }}}
    198 
    199 == Summary of important paths ==
    200 
    201 On my setup here are the places to look:
    202 
    203 `/opt/trac/0.10.3/install/bin` — trac's version of Python, easy_install etc.
    204 
    205 `/var/trac/0.10.3/var/trac/plugins` — trac plugins (eggs)
    206 
    207 `/var/trac/0.10.3/var/trac/conf` — trac configuration (including trac.ini and !TracSlimTimer's users.xml)
    208 
    209 `/var/trac/0.10.3/log/httpd` — trac logs (and logs from the module)
    210 
    211 `/var/trac/0.10.3/log/time_report.log` — reporting module log
    212 
    213 `/opt/trac/0.10.3/install/etc/init.d/httpd restart` — The command to restart trac (including Apache)
     89See the separate [TracSlimTimerPluginInstallation installation page].
    21490
    21591== Developers Guide ==