Centos – TracError: Unsupported version control system “svn”: cannot import name fs

centospythonsvntrac

I started out with a duplicate database entry error, and in trying to fix it am no longer able to resync my Trac database at all. Unable to import all the history I tried to upgrade from 0.12 to 1.0.1, however now when i run the sync either nothing happens or I get the error TracError: Unsupported version control system "svn": cannot import name fs.

Try to resync all repositories does nothing

[/var/trac/repo]# trac-admin . repository resync "*"
Done.

Specifying a repo returns an error

[/var/trac/repo]# trac-admin . repository resync "MyRepo"
TracError: Unsupported version control system "svn": cannot import name fs

The error originally said "svn" but running pip install svn got me where I am now, but pip install fs won't get me past this error.

Tried:

  • changing to an older Trac with easy_install Trac==0.12 and back with easy_install Trac==1.0.1
  • install dependencies with pip: pip install svn, pip install fs
  • tried running both "resync" and "sync" commands.

System:

  • CentOS 5.10
  • python 2.7.5
  • Trac 1.0.1

Best Answer

I was finally able to get this working by completely removing Trac 0.12 from both the system default python 2.4 site-packages as well as my python2.7. I used pip to remove Trac and svn and yum to remove subversion. At this point I had to build pcre, swig, subversion, and svn-python from source to get it to work.

Source files:

This assumes that python2.7 is install under /usr/local/bin/python2.7 with libraries under /usr/local/lib/python2.7/site-packages.

Install PCRE:

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
tar -xzvf pcre-8.36.tar.gz
cd pcre-8.36
./configure
make && make install

Install SWIG (specify --with-python=/path/to/python2.x):

wget http://prdownloads.sourceforge.net/swig/swig-3.0.2.tar.gz
tar -xzvf swig-3.0.2.tar.gz
cd swig-3.0.2
./configure --with-python=/usr/local/bin/python2.7
make && make install

Install Subversion (specify PYTHON=/path/to/python2.x)

wget http://archive.apache.org/dist/subversion/subversion-1.7.9.tar.gz
tar -xzvf subversion-1.7.9.tar.gz
cd subversion-1.7.9
./configure PYTHON=/usr/local/bin/python2.7
make && make install

make swig-py
make check-swig-py
make install-swig-py
echo /usr/local/lib/svn-python \
           > /usr/local/lib/python2.7/site-packages/subversion.pth
ldconfig

Install Trac

pip2.7 install trac

Once completed I was able to successfully resync my repository. Don't forget to enable svn in your Trac config, it is no longer on by default in 1.0+.

[root@dev1 ~]# trac-admin /var/trac/myrepo repository resync "MyRepo"
Resyncing repository history for MyRepo... 
5827 revisions cached.
Done.