Thursday, August 26, 2010

Upgrading KnowledgeTree - just kill me now

I hope the title doesn't give it away too much, but I'm not having the greatest of luck with upgrading our KnowledgeTree 3.5.2b (to evade this bug).

Even when I took the drastic step of reading the documentation, I haven't had much luck.

To get a 3.5.2b test server up and running, I did the following:
  1. Set up a VM and install Ubuntu server 8.04 on it
  2. download ktdms-oss-3.5.2b-linux-installer.bin from here and install it
  3. run ktree and make sure I can log in as default admin/admin
  4. stop ktree, and untar our existing backup over it (contain s a DB backup, documents, config.ini and plugins
  5. start just mysql ( start mysql)
  6. cd /opt/ktdms/mysql/bin
  7. ./mysqladmin --socket=../tmp/mysql.sock -udmsadmin -p drop dms
  8. ./mysqladmin --socket=../tmp/mysql.sock -u dmsadmin -p create dms
  9. ./mysql -u dmsadmin -p dms < ../backup/backup.mysqldump
  10. chown nobody:root /opt/ktdms/Documents/
  11. /opt/ktdms/ restart
So far, so good! I test and I can login using my LDAP credentials. Documents are there, I can get to the admin pages, it all looks okay.

Now, to upgrade to 3.5.3:
  1. Run ./ktdms-oss-3.5.3-linux-upgrade-installer.bin
  2. Once that's complete, browse to http://server-name/setup/upgrade.php - this wants us to log in as an administrative user before it will complete the DB upgrade - which makes sense... BUT none of the admin logins work. Every single one gets the "Could not authenticate administrative user" error message. LDAP user accounts, builtin admin account.. even when I did an echo -n 'password' | md5sum and poked that into the DB manually - nada! Soooo.....
  3. Edit /opt/ktdms/knowledgeTree/setup/upgrade.php and comment out lines 298 - 303:
if (!$authenticated)
loginFailed(_kt('Could not authenticate administrative user'));

And hey presto, I can upgrade it! Then after the DB upgrade has finished, it goes to re-scan our plugins, POW! The wheels fall off once again:

Fatal error: Class 'KTFolderAction' not found in /opt/ktdms/knowledgeTree/plugins/WemagTreeBrowsePlugin/WemagTreeBrowsePlugin.php on line 34

Well colour me impressed. OK then...
rm -rf /opt/ktdms/knowledgeTree/plugins/WemagTreeBrowsePlugin/

And... now...

Fatal error: Call to undefined method PEAR_Error::getAuthenticator() in /opt/ktdms/knowledgeTree/lib/authentication/ on line 67

Arg. OK, maybe a restart:

/opt/ktdms/ restart

Nope, after doing the setup/upgrade.php again, it started complaining about another Wemag plugin, so...

rm -rf /opt/ktdms/knowledgeTree/plugins/WemagSidebarManagement/

Do the dance again... and this time I can get to the login screen. The documents are there, so that's nice. Of course, the Wemag tree browse plugin is gone, which is okay, since I had to remove it.

But before we get too excited, when I log on as me, I initially get my usual "Philip Yarra" account... but once I try to manage anything I get the built-in Administrator account... and when I go to "DMS Administration" get I get "Permission denied" and "If you feel that this is incorrect, please report both the action and your username to a system administrator". I do feel that this is incorrect - hell yes, I'll call the sysadmin and... oh yeah, I am the System Administrator.

If I log in as the built in admin account, same deal - cannot administer ktree.

Overall, I'd call this a failure of an upgrade.

Monday, August 2, 2010

Solaris mounting Linux NFS shares: nfs mount: mount: /mount_point: Not owner

In a supreme example of why programmers can sometimes write error messages that make prefect sense to them, but are absolute gibberish to everyone else, and don't really help isolate the problem, I present today's bafflement:

bash-3.00# mount -F nfs /Backup_PRC/
nfs mount: mount: /Backup_PRC: Not owner
bash-3.00# ls -ld /Backup_PRC/
drwxr-xr-x 2 root root 512 Aug 3 10:10 /Backup_PRC/

Well, yes, I am the owner, thanks for asking. The real cause? Solaris 10 NFS defaults to using NFSv4, and Linux doesn't support it properly (or so the story goes). The solution is real simple: use NFSv3:

bash-3.00# mount -F nfs -o vers=3 /Backup_PRC/
bash-3.00# mount | grep Back
/Backup_PRC on remote/read/write/setuid/devices/vers=3/soft/bg/xattr/dev=4a80006 on Tue Aug 3 10:14:35 2010