Invalid login error
-
Hello all, I seem to have a very frustrating issue going on. The disk on my Mango got full somehow and after cleaning up a few things I am now unable to login at all, each time I try I get "Invalid login". One of my other posts here was around resetting passwords via the SQL console, which I did, but still am unable to login.
Any thoughts on how to troubleshoot this further? -
Can you post up your mango logs please? Interesting that you are still getting the invalid login message. I wonder if your H2 database got corrupted. If its a test system and there's not data of importance in your database you might try deleting your database.
-
Hey @Jared-Wiltshire which logs would you like? Also is there a way to enable better debug for the logs cause in the ma.log all I see is this
WARN 2017-06-14 09:31:12,339 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:31:56,691 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:41:41,512 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:45:01,029 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:45:08,017 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:45:11,707 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:46:32,260 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:46:37,574 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242
WARN 2017-06-14 09:51:11,455 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'andrewma' from IP +192.168.147.242
WARN 2017-06-14 09:51:15,740 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'andrewma' from IP +192.168.147.242
WARN 2017-06-14 09:54:07,304 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'andrewma' from IP +192.168.147.242
WARN 2017-06-14 09:54:14,203 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'bobb' from IP +192.168.147.242
WARN 2017-06-14 09:54:18,576 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'bobb' from IP +192.168.147.242
WARN 2017-06-14 09:54:19,974 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'bobb' from IP +192.168.147.242
WARN 2017-06-14 10:17:49,205 (com.serotonin.m2m2.rt.LoginManager.performLogin:168) - Failed login attempt on user 'admin' from IP +192.168.147.242This is a test mango but it has a config in it that I don't want to lose. I'm also more interested in knowing how to recover from this without a wipe so that I can document it internally in case it ever happens on a production unit.
As a half way measure I'd like to maybe be able to export certain config sections to import into a new config.
Thanks Jared
-
Just to add to this, I'd really like to know why the database is 4GB in size before I blow it away, that's really important for us to understand
-
Psysak,
A few questions. Which file is 4Gb? Mango/databases/mah2.h2.db ?
How many data points are there?
My suspicion would be either you do not have the NoSQL module installed, and so you are storing your points values in the SQL table, or you have a whole lot of events in the events table, so
select count(id) from events;
Your intuition for the half measure is keen. You can use the configuration backup section of the system settings to export a JSON configuration, or you can use the database backup section, which will create a zipped SQL dump in Mango/backups. You need to have a database backup if you will also be restoring data from the NoSQL backups. If you are not restoring data, either backup will allow you to very easily remake your system.
If indeed you have a massive number of events, you probably want to purge the events and userEvents tables (just use the purge events button in the purge settings on the system settings page), then launch a database backup task. Then an easy way to restore from that backup is to restart Mango on a clean database and use the restore tool in the database backup settings section of the system settings page to load the backup. This will shrink an H2 database. There are some means of directly asking the H2 database to compact, but this is more effective and more guaranteed.
It looks like you probably have a script that's trying to log in as admin on a regular basis. Either that or someone on your network is doing some guess work! Failed logins are an event (you can set it to Do Not Log or Ignore if you know you'll get a problematic amount of them) so that could be one of the contributing factors.
-
It was discovered the database had grown from a previous explosion of the events table, but the mah2 didn't shrink when those events were purged. H2 does some compaction at each shutdown, but it's not reliable that it will give the smallest DB for the existing configuration. Like many database servers, it will hold onto the disk space it is given, presuming databases tend to get larger.
In this albeit somewhat atypical instance, creating a backup and then restoring from the backup (after starting Mango on a clean DB) shrank the database from 3.7GB to about 5MB