trac won't install due to Genshi issue.

I've tried to install trac on CentOS 6.3 with VirtualMin Pro. This is a clean installation of Virtualmin -- no other tweaks or control panel software has been installed.

I get this error:

Trac source install failed :

Traceback (most recent call last):
  File "setup.py", line 156, in <module>
    **extra
  File "/usr/lib64/python2.6/distutils/core.py", line 113, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 221, in __init__
    self.fetch_build_eggs(attrs.pop('setup_requires'))
  File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 245, in fetch_build_eggs
    parse_requirements(requires), installer=self.fetch_build_egg
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 550, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (Genshi 0.5.1 (/usr/lib64/python2.6/site-packages), Requirement.parse('Genshi>=0.6,<0.7dev'))

CentOS 6.3 doesn't have an option to install Genshi at the right level, and I'm wary of using foreign repos with VirtualMin installed.

Help!

Status: 
Closed (fixed)

Comments

You may be out of luck then ... if CentOS doesn't include a new enough Genshi package for Trac to work, the only option is to install an updated version from some other source.

So, I installed EPEL, removed the Genshi that came with CentOS 6, then upgraded to Genshi 0.6.

The installer proceeded to re-install the old Genshi, and then tell me it doesn't work with the same error as before.

Any ideas?

It installed the old genshi .. that shouldn't happen. What output did you see during the install process that indicated that genshi was downgraded?

First, I did this:

[root@dev ~]# yum search genshi
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: centos.mirror.rafal.ca
* epel: mirror.seas.harvard.edu
* extras: centos.mirror.rafal.ca
* updates: centos.aol.com
================================================================================
python-genshi.x86_64 : Toolkit for stream-based generation of output for the web
python-genshi06.noarch : Toolkit for stream-based generation of output for the w

  Name and summary matches only, use "search all" for everything.
[root@dev ~]# yum remove python-genshi.x86_64
Loaded plugins: fastestmirror, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package python-genshi.x86_64 0:0.5.1-7.1.el6 will be erased
--> Finished Dependency Resolution
epel/metalink                                                                                                                                                         | 9.1 kB     00:00
epel                                                                                                                                                                  | 4.0 kB     00:00
epel/primary_db                                                                                                                                                       | 4.6 MB     00:01

Dependencies Resolved

=============================================================================================================================================================================================
Package                                          Arch                                      Version                                           Repository                                Size
=============================================================================================================================================================================================
Removing:
python-genshi                                    x86_64                                    0.5.1-7.1.el6                                     @base                                    2.7 M

Transaction Summary
=============================================================================================================================================================================================
Remove        1 Package(s)

Installed size: 2.7 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : python-genshi-0.5.1-7.1.el6.x86_64                                                                                                                                        1/1
  Verifying  : python-genshi-0.5.1-7.1.el6.x86_64                                                                                                                                        1/1

Removed:
  python-genshi.x86_64 0:0.5.1-7.1.el6

Complete!
[root@dev ~]#

Then, I went through the Virtualmin installer, and this is what happened:

Found http://ftp.edgewall.com:80/pub/trac/Trac-0.12.3.tar.gz in cache ..
Found http://www.saddi.com:80/software/flup/dist/flup-1.0.tar.gz in cache ..

Python module genshi is required ..
Installing package python-genshi ..

    Installing package(s) with command yum -y install python-genshi ..

    Loaded plugins: fastestmirror, security
    Loading mirror speeds from cached hostfile
     * base: centos.mirror.rafal.ca
     * epel: fedora.mirror.nexicom.net
     * extras: centos.mirror.rafal.ca
     * updates: centos.aol.com
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package python-genshi.x86_64 0:0.5.1-7.1.el6 will be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    ================================================================================
     Package               Arch           Version                Repository    Size
    ================================================================================
    Installing:
     python-genshi         x86_64         0.5.1-7.1.el6          base         429 k

    Transaction Summary
    ================================================================================
    Install       1 Package(s)

    Total download size: 429 k
    Installed size: 2.7 M
    Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : python-genshi-0.5.1-7.1.el6.x86_64                           1/1
      Verifying  : python-genshi-0.5.1-7.1.el6.x86_64                           1/1

    Installed:

    Complete!

    .. install complete.

.. done

Applying web server configuration ..
.. done

Now installing Trac version 0.12.3 ..

    Trac source install failed :

    Traceback (most recent call last):
      File "setup.py", line 156, in <module>
        **extra
      File "/usr/lib64/python2.6/distutils/core.py", line 113, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 221, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 245, in fetch_build_eggs
        parse_requirements(requires), installer=self.fetch_build_egg
      File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 550, in resolve
        raise VersionConflict(dist,req) # XXX put more info here
    pkg_resources.VersionConflict: (Genshi 0.5.1 (/usr/lib64/python2.6/site-packages), Requirement.parse('Genshi>=0.6,<0.7dev'))

.. failed! See the error message above for the reason why.

Applying web server configuration ..
.. done

How did you upgrade to Genshi 0.6 though? If it was from an RPM, the Genshi 0.5.1 RPM shouldn't have replaced it ..

I upgraded by adding the EPEL repo and using yum.

Ok .. so if you upgrade to 0.6 and then re-run the Trac installer in Virtualmin, does it downgrade to 0.5.7?

I'm not sure why you ran yum remove python-genshi.x86_64 before installing Trac.

When I didn't remove it the 0.5.7 version beforehand, it ran with it, and ignored the new version. When I removed it, it installed the old version, and ignored the new version.

What if you upgraded to the 0.6 version and then ran the Trac install?

Also, do the 0.5.7 and 0.6 versions have the same package name?

I did upgrade, in both cases, prior to running the install. When 0.5.7 was present, the 0.6 version was ignored. When it wasn't present, 0.6 was ignored, and it installed 0.5.7.

The packages have different names:

0.5.7 -- python-genshi.x86_64 0.6 -- python-genshi06.noarch

The different package names explain this - does epel have a genshi package without that 06 suffix?

Nope, unfortunately. I'll uninstall it and root around for a repo that matches the name. I'll keep you posted, in case someone else has this problem....or if the next repo doesn't fix it, either.

Alternately, have you tried installing the older 0.12.1 version of Trac, which is also supported by Virtualmin? We included that older version to support users with this Genshi issue.

So, I removed EPEL and installed RPMForge. Uninstalled the default Genshi, installed the RPMForge Genshi.

It gave me this error:

Now installing Trac version 0.12.3 ..

    Project initialization install failed :

    Initenv for '/home/dev/public_html/eventsage' failed.
    Failed to create environment.
    unsupported operand type(s) for /: 'int' and 'NoneType'
    Traceback (most recent call last):
      File "/home/dev/public_html/lib/python/Trac-0.12.3-py2.6.egg/trac/admin/console.py", line 437, in do_initenv
        options=options)
      File "/home/dev/public_html/lib/python/Trac-0.12.3-py2.6.egg/trac/env.py", line 214, in __init__
        self.create(options)
      File "/home/dev/public_html/lib/python/Trac-0.12.3-py2.6.egg/trac/env.py", line 402, in create
        DatabaseManager(self).init_db()
      File "/home/dev/public_html/lib/python/Trac-0.12.3-py2.6.egg/trac/db/api.py", line 146, in init_db
        connector.init_db(**args)
      File "/home/dev/public_html/lib/python/Trac-0.12.3-py2.6.egg/trac/db/mysql_backend.py", line 106, in init_db
        for stmt in self.to_sql(table, utf8_size=utf8_size):
      File "/home/dev/public_html/lib/python/Trac-0.12.3-py2.6.egg/trac/db/mysql_backend.py", line 155, in to_sql
        utf8_size=utf8_size))
      File "/home/dev/public_html/lib/python/Trac-0.12.3-py2.6.egg/trac/db/mysql_backend.py", line 119, in _collist
        limit_col = 767 / utf8_size
    TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'
    Creating and Initializing Project

.. failed! See the error message above for the reason why.

Applying web server configuration ..
.. done

So I installed the 0.12.1 version of trac, and problem solved.

That seems like the best solution - Trac 0.12.3 seems to have a lot of hard-to-support dependencies. I will make it's status clearer in the next Virtualmin release.

I had a look into this some more, and found that the unsupported operand type error with Trac 0.12.3 actually happens when the MySQL database Trac uses isn't using a UTF-8 character set! To work around this, I have released a new version of the Trac installer.

To get it, go to System Settings -> Script Installers -> Installer Updates, and click the Save button.

Automatically closed -- issue fixed for 2 weeks with no activity.