Jabberd database error

Read on if you’ve recently upgraded Jabberd2 and are seeing a heap of error messages about a database table that doesn’t exist.

I was getting these errors in my log, at a fairly cracking pace:

  jabberd/sm: mysql: sql select failed: Table ‘jabberd2.status’ doesn’t exist

I’d recently upgraded jabberd2, and the config now includes a “status” module.  It would seem that this new module wants a table in the database, but the Jabberd people didn’t get around to updating the database definition!  Oops!

No worries…  If you want to use this module, one way to avoid the errors is to override the database definition for that module.  Add the following to sm.xml, in the <storage> section:

  <driver type=’status’>db</driver>

You could use sqlite as well…  Just anything that doesn’t require the database definition up-front.  Whichever you use, make sure you have an appropriate configuration section in the <storage> section of sm.xml (like you had to create a MySQL section) that defines where the database will live.

Stop and start jabberd2, and the “status” module will write to the alternative database instead of MySQL.

Of course, now we should be able to see what’s in the table, and create a MySQL table to suit, and remove the <driver> line from sm.xml.  But I’d rather wait for upstream to get it fixed. 🙂  That way I don’t risk creating the table incorrectly, with the wrong data types, or field sizes, or whatever.

If that all sounds like hard work, I guess you could also remove the “status” module from the session manager config.  Don’t know what “status” does, but if it’s a new addition that we’ve done without then we won’t miss it a bit longer.  Problem would arise if it provides an existing function that used to be contained in a different module.

Leave a comment