[bug_report] Database metadata doesn't get set if openfire is started before the database

The database metadata such as Database Type doesn’t get set if the openfire service is started before the database service. Mainly this is an issue when the computer restarts and both the openfire service and the database service are both set to automatic. Looking at the logs it looks like openfire does 10 attempts to connect before shutting down if the database is started within these 10 attempts then openfire starts but the metadata isn’t set.

This causes an issue where some code doesn’t work correctly because the databasetype is “unknown” instead of “sqlserver”. Example is that the monitoring plugin errors because it use “LIMIT” in the sql which is invalid syntax for SQL Server because it doesn’t see it as being connected to an SQL Server.

Openfire version: 4.4.4
OS: Windows 7
Database: SQL Server 2014 (SQLExpress)
LDAP: No

Thanks for your feedback. That’s certainly a problem, but I’m thinking that’s more of a consequence of a larger issue: if the database is not available while Openfire is operating, a lot more issues could occur. Openfire will simply expect the database to be present.

I’m wondering that, instead of trying this very specific issue, it would be better to simply disallow Openfire to boot, when no database connection can be made.

1 Like