Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Feb 22, 2019 5:40 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Cacti 1.2.1 Installation - Can't login
PostPosted: Tue Jan 22, 2019 11:06 am 
Offline

Joined: Thu Jun 01, 2017 12:44 pm
Posts: 20
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 258 times ]
Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Tue Jan 22, 2019 12:58 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2080
If you do not believe another administrator is performing an upgrade, try running

Code:
DELETE FROM settings WHERE name LIKE 'install_%';

in MySQL/MariaDB

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Tue Jan 22, 2019 1:33 pm 
Offline

Joined: Thu Jun 01, 2017 12:44 pm
Posts: 20
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.


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Tue Jan 22, 2019 4:29 pm 
Offline

Joined: Thu Jun 01, 2017 12:44 pm
Posts: 20
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.


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Wed Jan 23, 2019 2:27 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2080
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.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Sat Jan 26, 2019 9:05 pm 
Offline
Cacti User

Joined: Sat Jul 30, 2005 2:15 pm
Posts: 147
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.


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Mon Jan 28, 2019 10:19 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2080
You can check which user does have the rights by running the following in MySQL/MariaDB:

Code:
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     |
+----+----------+----------+

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Mon Jan 28, 2019 1:36 pm 
Offline

Joined: Thu Jun 01, 2017 12:44 pm
Posts: 20
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?


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Wed Jan 30, 2019 2:20 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2080
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.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Wed Jan 30, 2019 3:10 pm 
Offline
Cacti User

Joined: Sat Jul 30, 2005 2:15 pm
Posts: 147
OK. Seems like a fairly significant change to make.

Code:
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?


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Wed Jan 30, 2019 6:04 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2080
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 id from user_auth where username = '<name of login>'

Then do the following:

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

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Wed Jan 30, 2019 6:54 pm 
Offline
Cacti User

Joined: Sat Jul 30, 2005 2:15 pm
Posts: 147
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 154 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 154 times ]
Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Thu Jan 31, 2019 3:36 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2080
So the process is now working?

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Thu Jan 31, 2019 12:15 pm 
Offline

Joined: Thu Jun 01, 2017 12:44 pm
Posts: 20
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.


Top
 Profile  
 
 Post subject: Re: Cacti 1.2.1 Installation - Can't login
PostPosted: Sat Feb 02, 2019 7:50 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2080
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.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group