Nexus on Tomcat 5.5 on Ubuntu Hardy March 6, 2009

Posted by idimmu in linux, java.
I'm trying out this Continuous Integration fun at the moment.

My end game is to get Hudson, Maven and Nexus working together to continuously build and run unit tests against code, which then gets turned in to Deb packages. A new Xen VM will then be created and configured using Puppet which the new Deb package is then deployed to. Finally Selenium will then be run to automate testing of the deployment.

Thats the plan anyway ..

I've been deploying everything on Ubuntu Hardy for the time being, and the latest app I am working on is Nexus. I'm deploying it as a War under Tomcat 5.5 and for a while was just getting the following error:


06-Mar-2009 20:29:08 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus.war
06-Mar-2009 20:29:12 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
06-Mar-2009 20:29:12 org.apache.catalina.core.StandardContext start
SEVERE: Context [/nexus] startup failed due to previous errors


I hate that error. It's rubbish. To make it a little more verbose I edited /var/lib/tomcat5.5/webapps/nexus/WEB-INF/log4j.properties and changed the rootLogger to DEBUG and fixed the appender path to go somewhere sensible (/var/log/tomcat55/nexus.log) and restarted Tomcat! This logged the following interesting error:


2009-03-06 20:42:01.066 ERROR [main:] - org.sonatype.nexus.configuration.application.source.ApplicationConfigurationSource:file:
******************************************************************************
* Could not create configuration file [ /usr/share/tomcat5.5/sonatype-work/nexus/conf/nexus.xml]!!!! *
* Nexus cannot start properly until the process has read+write permissions to this folder *
******************************************************************************
2009-03-06 20:42:01.091 ERROR [main:] - org.sonatype.nexus.Nexus:default: Could not start Nexus, bad IO exception!
java.io.FileNotFoundException: /usr/share/tomcat5.5/sonatype-work/nexus/conf/nexus.xml (No such file or directory)


Not exactly rocket science to se what is going on here!! And really easy to fix!


mkdir /usr/share/tomcat5.5/sonatype-work
chown tomcat55: /usr/share/tomcat5.5/sonatype-work


A quick restart of tomcat, after turning the logging back down to INFO and ta da! A working Nexus repo!

BGP: Building Reliable Networks with the BGP February 20, 2009

Posted by idimmu in reviews.


I recently had to learn BGP in order to fully understand what I was doing when migrating from our Linux based Zebra routers (crappy and unstable) to our nice shiny new Juniper routers.

We had a couple of books at work, but by far the best was BGP: Building Reliable Networks with the Border Gateway Protocol. It hasn't changed much since it was released in 2003, but neither has BGP so that really isn't an issue, and with the recent BGP issues that keep occuring, a good knowledge of it is pretty important to any network admins out there, especially those like me with their own AS numbers!

The book is full of real world examples and was all I needed to use in my migration.

The book is a bit of a bore to read though, it's not a comic, or a fun adventure book with a twist at the end. It's a solid information transmission system which will inject in to your brain how the many networks that make up the Internet actually talk to each other and how traffic flows between them, which is exactly what I wanted and why I give it a solid 8/10.

BGP: Building Reliable Networks with the Border Gateway Protocol is by Iljitsch van Beijnum and published by O'Reilly.

svn: Aborting commit: remains in conflict February 11, 2009

Posted by idimmu in linux.
I got this annoying SVN error today, that I hadn't come across before. Even after resolving the conflict in the file, highlighted by lots of <<<<<<<, I still couldn't get my commit to work!


idimmu@boosh:~/work/systems/trunk/dns$ svn ci idimmu.net -m "new funky domain"
svn: Commit failed (details follow):
svn: Aborting commit: '/home/rus/work/systems/trunk/dns/idimmu.net' remains in conflict


After some reading it was easy to resolve!

idimmu@boosh:~/work/systems/trunk/dns$ svn resolved idimmu.net
Resolved conflicted state of 'idimmu.net'
rus@boosh:~/work/systems/trunk/dns$ svn ci idimmu.net -m "new funky domain"
Sending idimmu.net
Transmitting file data .
Committed revision 14281.


A lesson in regular svn updateing I guess :)

rpmdb: Lock table is out of available locker February 9, 2009

Posted by idimmu in linux.
I had a crazy weird bug today whilst running Puppet on one of our CentOS boxes where no packages were being installed. A quick investigation with yum yielded the following scenario!

Id I tried to use yum as root or with sudo it gave the following error ..


[idimmu@server ~]$ sudo yum check-update
rpmdb: Lock table is out of available locker entries
error: db4 error(22) from db->close: Invalid argument
error: cannot open Providename index using db3 - Cannot allocate memory (12)
Repository update is listed more than once in the configuration
Repository base is listed more than once in the configuration
Setting up repositories
http://www.mirrorservice.org/sites/mirror.centos.org/Null/updates/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Cannot open/read repomd.xml file for repository: update
failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try.
Error: failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try.


But worked fine if I did it as a non root user ..


[idimmu@server ~]$ yum check-update
Repository update is listed more than once in the configuration
Repository base is listed more than once in the configuration
Setting up repositories
Reading repository metadata in from local files

acl.i386 2.2.23-5.4.el4 base
apr-util.i386 0.9.4-22.el4 base
at.i386 3.1.8-82.el4 base
audit.i386 1.0.16-3.el4 base
<snip>


I did a little bit of investigating with Google as to how yum works and discovered a few things..


http://www.mirrorservice.org/sites/mirror.centos.org/Null/updates/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found


The Null in the URl stood out as an obvious case of "there's something wrong here", so looking at the yum.conf file ..


baseurl=http://www.mirrorservice.org/sites/mirror.centos.org/$releasever/os/$basearch/


You can see that the NULL is coming from the $releasever variable. So, how is that variable set?

At the top of the yum.conf there is


distroverpkg=centos-release


What yum does is check which version of the package specified by distroverpkg is installed, and assign that to $releasever.

Great, but why does yum think the version is NULL? Well, a search for the first error ..


rpmdb: Lock table is out of available locker entries


resulted in this site which explained everything!

Basically RPM uses a Berkley database and due to too many instances of rpm dieing (the server is an old server) it left locks on the database that were never cleared. In order to fix the problem we have to remove the locks, by unfortunately, deleting the database and recreating it!

Backup the database directory /var/lib/rpm first:

tar cvzf rpmdb-backup.tar.gz /var/lib/rpm


Delete the locked Berkeley databases that rpm uses:

rm /var/lib/rpm/__db.00*


Force rpm to rebuild the databases

rpm --rebuilddb


Now, check the database to make sure it has been rebuilt correctly:

rpm -qa | sort


Problem solved, my database is no longer corrupt and Puppet is installing packages again!

File Roller and 7zip August 12, 2008

Posted by idimmu in linux.
I recently needed to extract a file with the new, popular 7zip compression, which Ubuntu's File Roller doesn't support out of the box. Enabling 7zip support in File Roller was as simple as:


apt-get install p7zip-full
  1  2  3  4  5  6  7  8  9 

Tags

Friends

twitter

    lastfm

    • Therapy? – A Moment Of Clarity
    • Therapy? – Unbeliever
    • Therapy? – Die Laughing
    • Finger Eleven – Swallowtail
    • Equilibrium – Mana
    • Equilibrium – Dämmerung
    • Equilibrium – Ruf in Den Wind
    • Equilibrium – Des Sängers Fluch
    • Equilibrium – Die Weide und der Fluß
    • Equilibrium – Heiderauche

    IdleRPG Stats

    • 1 Stu| 44
    • 3 HRH_H_Crab 43
    • 8 Jeekay 43
    • 12 Appocomaster 43
    • 27 Kumquatt 36
    • 36 idimmu 17