Cacti 1.2.1 Installation - Can't login

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Post Reply
Author
Message
Hotratz
Posts: 23
Joined: Thu Jun 01, 2017 12:44 pm

Cacti 1.2.1 Installation - Can't login

#1 Post by Hotratz » Tue Jan 22, 2019 11:06 am

I've just installed 1.2.1 from 1.2.0. I am no longer able to login and am stuck at Installation In Progress" in the browser window. I have cleared the cache.

After having gone through the upgrade process numerous times (since prior to v1.0) this is the first time experiencing such a problem.

On CentOS 7.6, kernel 3.10.0-957.1.3.el7.x86_64, Apache/2.4.6

***
Installation In Progress

There is an Installation or Upgrade in progress.

Only Cacti Administrators with Install/Upgrade privilege may login at this time

Return | Login Again

***

I do not get a login window regardless of clicking on "Return" or "Login Again" - The page only reloads.

Any ideas?

Thanks.
Attachments
Screen Shot 2019-01-22 at 9.03.07 AM.png
Screen Shot 2019-01-22 at 9.03.07 AM.png (140.15 KiB) Viewed 1029 times

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.1 Installation - Can't login

#2 Post by netniV » Tue Jan 22, 2019 12:58 pm

If you do not believe another administrator is performing an upgrade, try running

Code: Select all

DELETE FROM settings WHERE name LIKE 'install_%';
in MySQL/MariaDB

Hotratz
Posts: 23
Joined: Thu Jun 01, 2017 12:44 pm

Re: Cacti 1.2.1 Installation - Can't login

#3 Post by Hotratz » Tue Jan 22, 2019 1:33 pm

I am the administrator which is why I'm perplexed about this issue.

Any idea what might be causing the server get stuck on this page and not present a login for an admin?

I'll give that a try. Thanks.

Hotratz
Posts: 23
Joined: Thu Jun 01, 2017 12:44 pm

Re: Cacti 1.2.1 Installation - Can't login

#4 Post by Hotratz » Tue Jan 22, 2019 4:29 pm

Unfortunately that did not work. Also, it appears to only address the symptom, not the cause of the problem.

I reverted back to 1.2.0, the last working version.

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.1 Installation - Can't login

#5 Post by netniV » Wed Jan 23, 2019 2:27 pm

There is no change between either version to the installation system for the lockout. Check that you have the Install/Upgrade permission against your user.

paulbeard206
Cacti User
Posts: 148
Joined: Sat Jul 30, 2005 2:15 pm

Re: Cacti 1.2.1 Installation - Can't login

#6 Post by paulbeard206 » Sat Jan 26, 2019 9:05 pm

netniV wrote:Check that you have the Install/Upgrade permission against your user.
what does this even mean? I also upgraded thru FreeBSD ports and am now locked out with no login screen.

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.1 Installation - Can't login

#7 Post by netniV » Mon Jan 28, 2019 10:19 am

You can check which user does have the rights by running the following in MySQL/MariaDB:

Code: Select all

mysql> select id, realm_id, username from user_auth_realm uar inner join user_auth ua on ua.id = uar.user_id where realm_id = 26;
+----+----------+----------+
| id | realm_id | username |
+----+----------+----------+
|  1 |       26 | admin    |
|  7 |       26 | mark     |
+----+----------+----------+

Hotratz
Posts: 23
Joined: Thu Jun 01, 2017 12:44 pm

Re: Cacti 1.2.1 Installation - Can't login

#8 Post by Hotratz » Mon Jan 28, 2019 1:36 pm

What doesn't make sense is the fact that after having gone through the upgrade process a number of times before with no change in process (automated via upgrade script) or users/permissions, why would this become an issue now?

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.1 Installation - Can't login

#9 Post by netniV » Wed Jan 30, 2019 2:20 pm

Because as part of the enhancements to security, a new realm was added to specify which users are actually allowed to upgrade the system. After all, not all admins are equal yet previously ANY user with console access would be able to run through the upgrade process.

From 1.2.0, the system should have assigned the first admin to login the rights to realm 26 which is the install/upgrade rights. Hence I asked you to run the above MySQL statements to see who was given those rights. You will see it if you examine the lib/auth.php script and search for 'Install/Upgrade realm 26'.

Normally, the first user to login is the user performing the upgrade so those rights should have been assigned immediately. Hopefully, that explanation has informed you on the change and why I was asking for the above query to show which user had been given those rights.

paulbeard206
Cacti User
Posts: 148
Joined: Sat Jul 30, 2005 2:15 pm

Re: Cacti 1.2.1 Installation - Can't login

#10 Post by paulbeard206 » Wed Jan 30, 2019 3:10 pm

OK. Seems like a fairly significant change to make.

Code: Select all

select id, realm_id, username from user_auth_realm uar inner join user_auth ua on ua.id = uar.user_id where realm_id = 26;

Empty set (0.00 sec)
So now what? How does fix this? What GRANT statement needs to be used (optimally as part of the upgrade process?) so that we can access an existing install?

I have no realm 26. Perhaps creating and populating that should be part of the upgrade process?

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.1 Installation - Can't login

#11 Post by netniV » Wed Jan 30, 2019 6:04 pm

Creating and populating that is part of the login process when you upgrade from 1.1.x to 1.2.x. Something somewhere has gone wrong if that hasn't been populated. To correct it, do the following

Code: Select all

select id from user_auth where username = '<name of login>'
Then do the following:

Code: Select all

insert into user_auth_realm VALUES (26, <id>)
where <id> is the id from the first statement.

paulbeard206
Cacti User
Posts: 148
Joined: Sat Jul 30, 2005 2:15 pm

Re: Cacti 1.2.1 Installation - Can't login

#12 Post by paulbeard206 » Wed Jan 30, 2019 6:54 pm

Permissions seem fine. Spine is writing to the log happily. Why is this failing?

I changed /var/log/cacti to be owned by www:www and it worked. Changed it back and it still works.
Attachments
Screen Shot 2019-01-30 at 3.49.15 PM.png
Screen Shot 2019-01-30 at 3.49.15 PM.png (15.79 KiB) Viewed 925 times
Screen Shot 2019-01-30 at 3.48.42 PM.png
Screen Shot 2019-01-30 at 3.48.42 PM.png (11.73 KiB) Viewed 925 times


Hotratz
Posts: 23
Joined: Thu Jun 01, 2017 12:44 pm

Re: Cacti 1.2.1 Installation - Can't login

#14 Post by Hotratz » Thu Jan 31, 2019 12:15 pm

netniV wrote:Because as part of the enhancements to security, a new realm was added to specify which users are actually allowed to upgrade the system. After all, not all admins are equal yet previously ANY user with console access would be able to run through the upgrade process.

From 1.2.0, the system should have assigned the first admin to login the rights to realm 26 which is the install/upgrade rights. Hence I asked you to run the above MySQL statements to see who was given those rights. You will see it if you examine the lib/auth.php script and search for 'Install/Upgrade realm 26'.

Normally, the first user to login is the user performing the upgrade so those rights should have been assigned immediately. Hopefully, that explanation has informed you on the change and why I was asking for the above query to show which user had been given those rights.

Ok now it all makes sense. Thank you for shedding additional light on the issue. I ran your suggested command and found that admin does not have access to realm 26. I'll change that and try again.

I suppose the next question is why would Cacti not have made the assignment? I'll take a look in lib/auth.php.

****

Looked in auth.php - found nothing indicating assigning realm 26 access to admin. I do see a $new_realm = 0 in function user_copy - that's the closest thing I've found to making a new realm assignment.

****

The problem has now been resolved and now have 1.2.1 up and running. Thanks again for the solution.

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.1 Installation - Can't login

#15 Post by netniV » Sat Feb 02, 2019 7:50 pm

That is because the actual code in 1.2.1 occurs in include/auth.php beginning at line 107 (feel free to review and let me know if you think there's an issue).

It basically tries to find any user or group that has realm 26 associated to it. If it fails to find one then it then adds everyone who has realm 15 (Settings/Utilities access) as an Installer/upgrader. The idea there being that a user who has that access would likely be an installer/upgrader. But once set, an admin can remove those privileges should they feel it necessary.

Post Reply