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!

No comments:

Post a Comment