Issue logging in

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
mav
Posts: 2
Joined: Thu Dec 09, 2010 11:11 pm

Issue logging in

Post by mav »

Hi all hope you're doing great;

Recently I've come across an issue with our cacti install, so basically trying to login got us redirected to install.
Looking around the forums I've come across this topic: viewtopic.php?f=7&t=59243
which suggests as cause for the install redirect a wrong version so I checked:

Code: Select all

# mysql -ucacti_user -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 337
Server version: 10.3.35-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use cacti_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [cacti_db]> select * from version;
+--------+
| cacti  |
+--------+
| 1.2.21 |
+--------+
1 row in set (0.001 sec)

MariaDB [cacti_db]> quit;
Bye
# cat include/cacti_version 
1.2.22
So in the meanwhile I'm accessing the DB from the cacti server, no issues with password or access. I've manually updated the version record on the DB and no longer get redirected to install.
However, login constantly fails saying access denied.
So I checked if the failed logins were getting registered on the DB:

Code: Select all

# mysql -ucacti_user -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 346
Server version: 10.3.35-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use cacti_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [cacti_db]> select id, username, realm, must_change_password, password_change, login_opts, enabled, locked from user_auth;
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
| id | username | realm | must_change_password | password_change | login_opts | enabled | locked |
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
|  1 | admin    |     0 |                      | on              |          2 | on      |        |
|  3 | guest    |     0 | on                   | on              |          1 |         |        |
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
2 rows in set (0.000 sec)

MariaDB [cacti_db]> select id, username, enabled, must_change_password, locked, failed_attempts, lastfail from user_auth;
+----+----------+---------+----------------------+--------+-----------------+----------+
| id | username | enabled | must_change_password | locked | failed_attempts | lastfail |
+----+----------+---------+----------------------+--------+-----------------+----------+
|  1 | admin    | on      |                      |        |               0 |        0 |
|  3 | guest    |         | on                   |        |               0 |        0 |
+----+----------+---------+----------------------+--------+-----------------+----------+
2 rows in set (0.000 sec)

MariaDB [cacti_db]> quit
Bye
I took the DB details directly from cacti's config file.

2022-11-17 13:31:12 - AUTH LOGIN FAILED: Local Login Failed for user 'admin' from IP Address '192.168.0.113'.

Any suggestions please? thanks
etiam si omnes, ego non
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Issue logging in

Post by TheWitness »

Wrong approach. Set the version back and then reset the password using the following MySQL command.

Code: Select all

UPDATE user_auth SET password=MD5('baseball') WHERE id = 1;
Then, login using 'baseball' as the password. Don't forget to change it afterwards.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mav
Posts: 2
Joined: Thu Dec 09, 2010 11:11 pm

Re: Issue logging in

Post by mav »

Hi there thank you for your reply.

So when you say "wrong approach" ... could you please elaborate?
We installed Cacti from EPEL, we confirmed it was cacti 1.2.22 that was installed. Should we manually edit the cacti_version file and put the version down?

Also, on your proposed statement I'm thinking it's missing "where id=1"? so it would look like

Code: Select all

UPDATE user_auth SET password=MD5('baseball') where id=1;
etiam si omnes, ego non
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Issue logging in

Post by TheWitness »

If you want to 're-upgrade', you have a few options.

1) Set the value backwards in the database like this UPDATE version SET cacti='x.x.x.x' where 'x.x.x.x' is some known Cacti version, and then refresh your browser
2) More preferably, go into the CLI path and run upgrade_database.php --forcever='x.x.x.x' where 'x.x.x.x' is some old known Cacti version.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests