Upgrade from 4.6.2 to 4.6.4 failed on Ubuntu 18.04

Hi,

I tried to upgrade openfire from 4.6.2 to 4.6.4 on Ubuntu 18.04 but failed. When I login to the admin console I can see version number as 4.6.4 on the top right corner but thee logs suggest that the DB upgrade has failed. Can you help me resolve this please?

I performed the following steps:

  1. Backed up DB (MySQL 5.7.32)
  2. Backed up folder /usr/share/openfire
  3. Backup up folder /etc/openfire
  4. Stopped openfire service
  5. Downloaded deb: wget -O openfire.deb http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_4.6.4_all.deb
  6. Installed openfire: dpkg -i openfire.deb
  7. The logs are suggesting that the DB upgrade failed from 29 to 32 due to two exceptions:

java.sql.SQLSyntaxErrorException: Unknown column ‘fmucEnabled’ in ‘field list’

java.sql.SQLIntegrityConstraintViolationException: Duplicate entry ‘27’ for key ‘PRIMARY’

  1. After upgrade failed I logged into admin console and see version number as 4.6.4 on the top right corner but the ofVersion table still showing 29.

Please refer upgrade logs and suggest how this can be sorted.

Thank you very much in advance.
Manish
[Openfire failed upgrade from 4.6.2 to 4.6.4 on 211221|attachment](upload://sdVyA0bv9qWs8OSxkd3AraF7N4g.4 on 21122) (35.5 KB)

Hi Manish,

That’s not good. I have tried to reproduce this, by installing Openfire 4.6.2 on a clean Ubuntu 18.04 virtual machine, interact with it a little bit, then upgrade it to 4.6.4. I did use the embedded database, not MySQL, but I don’t think that this is relevant here. In any case, I was unable to reproduce the problem. I suspect that your Openfire instance, as it has been in use longer, has more database content changes.

Sadly, something went wrong when you tried to upload the log file, so we can’t quite see what’s going on.

the error java.sql.SQLIntegrityConstraintViolationException: Duplicate entry ‘27’ for key ‘PRIMARY’ seems to be caused by update script 30. This makes sense, as your database version remains on 29 (which indicates that script 30 can not complete).

The relevant part of script 30 is this:

INSERT INTO ofID (idType, id) VALUES (27, (SELECT coalesce(max(messageID), 1) FROM ofMucConversationLog) );

Apparently, your database already has a row with idType 27 in ofID. I’m not sure how that happened. You could experiment with removing that one row before trying to upgrade. Be sure to make a backup before you do though!

The line java.sql.SQLSyntaxErrorException: Unknown column ‘fmucEnabled’ in ‘field list’ is probably caused by code that’s trying to use the database, assuming that the upgrade was successful. Update script 32 adds that column - but you obviously do not have that yet.

As an aside, I strongly advise you to upgrade to the latest version in the 4.6 branch, as opposed to 4.6.4. Newer versions include fixes for the recent log4j vulnerability!

Hi Guus,

Thanks for the response.

I deleted the existing entry for 27 and got it upgraded eventually. The other exception for column ‘fmucEnabled’ also vanished since.

I’ll soon upgrade to 4.6.4 as well.

Thanks again.
Manish

1 Like

4.6.6! (or later)