Some users, including admin cannot login after restart

Hi,
I migrated my spark server from an old version to the newest at the time 4.4.1, and transferred it to a new server which seems to have worked, but whenever I restart the server, I cannot login to the admin console, I have to use the workaround with the SecretToken.
Whilst this occurs, it seems a portion of our users also are unable to login to spark with incorrect username or password errors, I reset their passwords to what they have always been and it seems fine. But whenever I restart the server we’re back to square 1 and I need to use the secretToken to login and set these user passwords again, it’s not a big deal as we only have 40 users, but I hope there’s an easy fix, any suggestions?

Are you using LDAP integration? What OS you use and how do you run Openfire (manually, service/daemon)?

Hi wroot,
Apologies for not providing that before, we are not using LDAP and are using Microsoft SQL Server 2014, we are using Windows Server 2016, Openfire is set to run as a service

I don’t remember such issue when i was testing Openfire in Windows Server 2016/2019. But i was using embedded database. Usually such issue would indicate some permissions issues when Openfire process is not able to save changes. So it hold everything in the cache, but when it is being shutdown it fails to store everything in the database. Is it only the passwords though? Maybe some other information is lost also, like groups, name changes, group chats, history? You can check the logs at Openfire\logs\all.log for some clues. And if you up for testing, i would try to manually stop Openfire, then stop SQL, then start SQL and then Openfire and see how it works this way. I’m guessing maybe database is not shutting down or turning on at the right moment for Openfire.

That definitely seems the case, Openfire is holding everything in cache, it is not only passwords affected, but some settings like the default group are also not saving.
We only restart the server monthly in line with Microsoft’s updates, is it worth running the setup again and ensuring it can write to the database? It seemed fine when I first migrated Openfire though.
In the openfire console > Server > Server Manager > Database does report “In read-only mode: No”

I think this only indicates if read only mode is enabled explicitly, not when there are issues with permissions to write changes.

You can try running the setup and then change some settings or say add new group chat room and then try to find them in the database, say using SSMS. After some time, because it won’t flush changes to a database immediately.

I was able to add a group, in the OpenFireAdmin.OfGroup table the new group I added has appeared just fine.

Anything that looks like related in the logs?

There’s nothing in the logs that I can see that would be related

its likely you didn’t migrate all the files required. how did you migrate to a new server?

That is likely a lot of the problem, I only took the Database, restored it to the new server, ran the setup, hooked it up to the old DB and changed the XMPP Domain name to reflect the new server

I also copied the Conf folder come to think of it.

are you running the embedded db or an external database?

sounds like your encryption key is currupt or didn’t get copied over.

simple thing to do would be to just copy over the whole contents of openfire from the old server to the new server…then change the xml setup flag to false…start openfire, and then thru the wizard again. please check out @wroot post here.

We’re running an external database, luckily we still have the old server kicking about, so I can give this a try, thanks.