Unable to login after restart

Essentially what i’m doing is attempting a proof of concept running Windows Server2003 SP2 and SQL Server 2005 Express. I am able to go through all the setup options using SQL Express as the external database and Active Directory as my user authentication DB. Every check a long the way works great and as soon as i’m done the config and it’s saved, all works well. When i restart the application, i am unable to login anymore. When this happened, i uninstalled completely, purged the install folder, deleted and re-created the database and tried again; same problem. Next i tried using the internal database for configuration and SQLExpress for user authentication and the same problem occurs. Lastly, I tried using the internal database for both configuration and user authentication and that WORKS. A couple of things to point out:

  1. When i setup the user database to use SQL, the encrypted password has a value and plain password is NULL. If i change plainPassword to admin and encrypted password to NULL i am able to login. Seems to be a problem reading the encrypted password?

  2. In the error logs i get this message: Violation of PRIMARY KEY constraint ‘ofProperty_pk’. Cannot insert duplicate key in object ‘dbo.ofProperty’. Additionally, when i run the Microsoft SQL script to configure the database, i get a message regarding the key length being to big. Exact error =

Warning! The maximum key length is 900 bytes. The index ‘ofRoster_jid_idx’ has maximum length of 2048 bytes. For some combination of large values, the insert/update operation will fail.
Warning! The maximum key length is 900 bytes. The index ‘ofSASLAuthorized_pk’ has maximum length of 4128 bytes. For some combination of large values, the insert/update operation will fail.

I have attached the logs and config files for review. Please help. Thanks.
error.log (9243 Bytes)
info.log (49675 Bytes)
openfire.xml (1807 Bytes)
warn.log (17210 Bytes)

Yeah…this happened to me a handful of times when I was getting things worked out initially too. It was driving me nuts. Really, it just kinda stopped doing it after a while. And I haven’t a clue why. I had a ‘good’ SQL backup that I was able to restore to and logon again. Although, I was unable to find any differences between the ‘good’ database, and the ‘evil’ backup I made prior to restore.

The only thing I can really recommend here is to get a ‘good’ backup of the database - as soon as it lets you logon, as desired and keep it handy. You may also want to check out the ofProperty table in the DB - specifically the admin.authorizedJIDs field. At least one time, deleting that allowed me to log back in using default admin credentials.

I can always login with the default admin credentials, the problem is that i want to use LDAP authentication. If i log in w/ the default admin account, none of those settings are available and I cannot change them.I’ll give the SQL backup and restore option a try and see what happens. Thanks.

Right. If LDAP settings are not available - I think you need to change the true in your openfire.xml to false. Which should allow you to then setup the LDAP piece when you log onto the Admin Console. And during that setup, you are forced into picking the admin accounts from LDAP.

And yes, the Backups are a good idea.

No Dice. So i uninstalled openfire and deleted the database. I re-created a blank database and started the openfire install. After the install, i launched openfire admin console. I go through all the steps and configure it to use SQL Express and Active Directory authentication. As soon as the openfire configuration completes and I get the prompt to login to the console, i took a full database backup. I can log into the console. After a restart of the openfire service, i’m unable to login w/ my active directory account. I stop the service and delete the database and proceed to restore it from backup. once restored, i restart the openfire service and give it about 30seconds to start up. I then attempt to login to the console and it does not let me in. So i stop the service, modify the config file (openfire.xml) and change true to false. I restart the service and go through the whole install again. I’m able to login, but once i restart the service again, i’m unable to login. I still keep seeing this error in the error.log file and have no clue what’s up: java.sql.SQLException: Violation of PRIMARY KEY constraint ‘ofProperty_pk’. Cannot insert duplicate key in object ‘dbo.ofProperty’. Now i know databases, but have no clue why the application is trying to insert a record into the ofProperty table. If anything, it should be updating the table w/ information. Either way, i’m unable to get this to work after a restart. Any suggestions?

I think you need to take a look at the ofProperty table. I’m fairly certain quite a few of the settings from the openfire.xml are moved into the ofProperty table when you start up the service. You may notice some of those will be removed from the openfire.xml after you’ve restarted the service.

On startup of the openfire service, the application automatically wants to add 2 keys that are already in the database. xmpp.session.conflict-limit and update.lastcheck. As stated previously, these keys should be updated versus just blindly being added, especially since [name] is a pk.

The last thing i did was this. Deleted the database, re-created a blank database, uninstalled openfire and deleted all files in the directory, reinstalled openfire and as soon as everything was saved, i backed up the openfire install directory and the database, logged in successfully, restarted service, failed to log me in, deleted all contents of openfire install directory, restored database, restarted openfire service, still fails… Regarding the openfire.xml file, once the install is complete, that file does not change. Ultimately ma_geek you are correct, my problem lies w/ in the ofProperty table or the inability of the application to read the parameters correctly.

The only thing I can deduce is that the code to connect to the databse initially, is not the same code used to connect to the database during production. The fact that I get unknown source and java.lang.null exception in the error log point to that possibility.:

2009.05.01 11:57:16 [org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:346)
]
java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at java.util.Properties.setProperty(Unknown Source)
at org.jivesoftware.database.DefaultConnectionProvider.start(DefaultConnectionProv ider.java:92)
at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectio nManager.java:490)
at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:85)
at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:335)
at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:73)
at org.jivesoftware.util.JiveProperties$JivePropertyHolder.(JiveProperties .java:40)
at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:52)
at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:532)
at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:298)
at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:415)
at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:161)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:106)
at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)

Not sure if i mentioned this before but i’m using openfire 3.6.3, maybe i’ll try the previous version next.

Have you tried just removing those two rows with the conflict?

When I delete them, they are recreated up restart of the server…so it seems worth a shot.

Sorry, forgot to post that fact. Yes i did remove these 2 rows but only** xmpp.session.conflict** gets added back into the table where update.lastcheck did not. But even after i did this, i still get the java.lang.null exception and i’m unable to login.

Temporary solution, or permanent depending on how you want to look at it, is to use the embedded HSQLDB and use LDAP for authentication. After restarting the service, i am still able to login w/ ldap credentials. It seems that the code for Microsoft SQL Server support may not be 100% yet so for the time being, i will use the HSQLDB. There should not be too many people hitting the server, but maybe by the time they do, version 3.6.4 will be out. Either way, HSQLDB should be a decent alternative that works. Thanks ma_geek for your suggestions and time

know this is an old post, but wanted to add to the discussion in case it helps someone else…

I had this same issue where I could not login to the admin console after a restart. The only way was by changing the config file, setting the stup flag to false and then going through the install steps again. By the way, I was running openfire on a Microsoft Windows 2008 R2 server, with SQL Server 2008 as its database and Active Directory for authentication…

Now what tripped me over was that I was using Windows authentication for the database access! The issue went away by simply using a SQL Login. Also mentioned here:http://community.igniterealtime.org/thread/40665

Regards

how do you change it to SQL auth? I changed the database server to allow mixed but I’m not sure how to make the connection be SQL auth. Any assistance would be appreciated. Thanks!

Sorry, I figured it out and yes that fixed my problem as well. Thanks!

What I did is, Go back to your back up files then login again!


online pirate games mmorpg