Saturday, July 25, 2009

JSPWiki RCSFileProvider exception

I've been using JSPWiki for atleast 5 years now. One problem I've had which I've just worked out is an RCS exception (when using the RCSFileProvider to version pages) that frankly pissed me off! It seemed to come up and for no reason. It looks like:


JSPWiki has detected an error

Error Message
RCS checkin failed
Exception
com.ecyrd.jspwiki.providers.ProviderException
Place where detected
com.ecyrd.jspwiki.providers.RCSFileProvider.putPageText(), line 430

If you have changed the templates, please do check them. This error message may show up because of that. If you have not changed them, and you are either installing JSPWiki for the first time or have changed configuration, then you might want to check your configuration files. If you are absolutely sure that JSPWiki was running quite okay or you can't figure out what is going on, then by all means, come over to jspwiki.org and tell us. There is more information in the log file (like the full stack trace, which you should add to any error report).

And don't worry - it's just a computer program. Nothing really serious is probably going on: at worst you can lose a few nights sleep. It's not like it's the end of the world.


The problem for me was that I was previously running Tomcat as root and since then have started running it as user www (a user that has no admin rights to any other part of the server thus reducing likelihood of security issues). And root had the page locked. The solution is simple.

* For page do the following when you try and edit and save a page and the above error is shown.
** For example the page is "useful_commands" which has the corresponding RCS file "useful_commands.txt,v"


$ cd /where/wiki/pages/are/attachments
$ sudo rcs -u useful_commands.txt,v # this unlocks the page owned by root - use sudo -u if not root (see next)
$ sudo -u www rcs -l useful_commands.txt,v # this locks the page as www (tomcat running as www)
Now hit refresh in your browser and the changes made should be saved


Alternatively you could unlock any files locked by root with an:


sudo rcs -u *v


But I've not tried this. I assume on files not owned by root it will do nothing. I leave the verification to you as an exercise!

Saturday, July 18, 2009

GNUPG / Pinentry-mac paste problem

This caught me out after installing Mac GPG 2 which includes pinentry (as in pin entry). I could not paste my passphrase into it. I googles for ages and tried installing pinentry separately. I looked for configuration files.

Hours later I found out you can right-click to paste!

Sunday, March 1, 2009

Subversion and case-insensitive file systems

And solutions to problems this can cause



I work on MacOSX and it along with Windows has a case-insensitive file system. This has caused me pain on a number of occassions.

It looks like this:

> svn st
? Apache2
! apache2


Caused by renaming the file.

This is usually easily solved by renaming the file back again, but if you do some commits or other commands it can seem to cause a problem where Subversion claims it is locked but 'clean' doesn't have any effect. But not all is lost.



However I don't have a linux box (something that will change soon) and the second didn't work for me. This worked:


> cd .. # parent directory
> mv <parentdir_name> <parentdir_name>x
> svn up <parentdir_name>


Then fix up any changed files from the directory that has the same (case-insensitive) file name. And delete the <parentdir_name>x.

Doneski.

This will lead on to me posting one day about how I use Subversion as my backup mechanism and to help manage my home directory across multiple machines.

Let me know if you are keen for me to write this up.

Purpose

Why are we here?



This is my 6th blog and despite being a Software Engineer and geek, I've hardly blogged against my black art.

Can't wait to get started ...