Thursday, September 20, 2012

SVN upgrade errors and solutions

I ran into some Subversion issues while upgrading an old Subversion instance from 1.5.5 to 1.7. The process also involved moving the repositories from a 32bit 1CPU 2GB virtual server to a 64bit 2CPU 4GB virtual server.  I’m also running Subversion Edge, as the svn user and apache as the apache user.
Subversion (SVN): Can’t open file ‘db/txn-current-lock’: Permission denied
Discussion: Ownership on the repository db directory is incorrect
# ls -ld /<repo-path>/<repo>/db
drwxrwsr-x 6 svn svn 4096 Sep 20 12:45 db

Solution:  Change ownership
                # chown –R svn:apache db

Subversion (SVN): Can’t write activity db

Discussion: Ownership on the repository dav directory is incorrect
# ls -ld /<repo-path>/<repo>/dav
drwxrwxr-x 3 svn apache 4096 Sep 19 17:04 dav

Solution: Change ownership of the dav directory
          # cd /<repo-path>/<repo>/
    # chown –R apache:apache dav


Subversion (SVN): “attempt to write a readonly database”

Discussion: The file “rep-cache.db” has the incorrect permissions
#ls -l rep-cache.db
-rw-r--r-- 1 svn apache 81920 Sep 20 13:09 rep-cache.db

Solution: Change ownership on rep-cache.db
    # cd /<repo-path>/<repo>/db
    # chmod 664 rep-cache.db

Tuesday, September 18, 2012

Port Forwarding with Putty

It has been a few years since I last updated my Subversion repository. I'm currently on version 1.5.5 and I need to update it to 1.7.x. My repository is on the other side of an internal company firewall, the only ports that are open are 80,8080,443 and 22.  Subversion Edge has an admin screen that is hosted on port 3343. 

Scenario:  Need to reach port 3343 (Subversion Edge) on a Linux server behind a firewall which only allows ports 80,8080,443 and 22 from windows system (Windows XP, Windows Vista, Windows 7)

  1. Open putty, enter the IP address of the server you wish to connect to. 
  2. Select SSH-> Tunnels
  3. Select an unused source port above 1024, in this example enter 3343. For Destination enter the IP address and the port you want to connect to on that server.
Source port: 3343

Select Add

Then Open your connection, You are now port forwarding port 3343 from your PC to port 3343 on your Linux server.

Open your browser, then enter the following in your browser, you should be forwarded to the Admin Screen