Upgrade from 5.4.0 to 5.4.4 failure

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
gwakem
Posts: 238
Joined: Mon Jan 23, 2012 2:02 pm
Location: Asheville, NC

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by gwakem »

The log files may not have shown the transition from 200 to 500 this time as they were from the last upgrade. The previous logs contained that transition.
Here is the output from the reconfigure_nagios.sh, the warning at the end is normal and expected:

Code: Select all

11:31:00 [root@xi-test ~]# cd /usr/local/nagiosxi/scripts
11:31:07 [root@xi-test scripts]# su nagios
11:31:09 [nagios@xi-test scripts]$ ./reconfigure_nagios.sh
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=xxxxxx' -O nagiosql.login--2017-05-17 11:31:16--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

    [ <=>                                                                                               ] 36,896      --.-K/s   in 0.01s   

2017-05-17 11:31:16 (3.24 MB/s) - ‘nagiosql.login’ saved [36896]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: https://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=xxxxxx' -O nagiosql.login--2017-05-17 11:31:17--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

    [ <=>                                                                                               ] 36,896      --.-K/s   in 0.008s  

2017-05-17 11:31:17 (4.28 MB/s) - ‘nagiosql.login’ saved [36896]

LOGIN SUCCESSFUL!
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2017-05-17 11:31:17--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.export.monitoring’

    [ <=>                                                                                               ] 22,340      --.-K/s   in 0.01s   

2017-05-17 11:31:19 (2.11 MB/s) - ‘nagiosql.export.monitoring’ saved [22340]

WRITE CONFIGS SUCCESSFUL!
OUTPUT: 
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
	Checked 3257 services.
Warning: Host 'it-windows-vm-1' has no default contacts or contactgroups defined!
	Checked 1376 hosts.
	Checked 17 host groups.
	Checked 9 service groups.
	Checked 47 contacts.
	Checked 29 contact groups.
	Checked 177 commands.
	Checked 17 time periods.
	Checked 0 host escalations.
	Checked 0 service escalations.
Checking for circular paths...
	Checked 1376 hosts
	Checked 2578 service dependencies
	Checked 0 host dependencies
	Checked 17 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 1
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0

--
Griffin Wakem
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by tgriep »

Thanks for running the reconfigure. I just wanted to make sure it ran without any errors.
The only thing left to do it to rerun the upgrade and capture the errors so we can see what is going on.
Or, you can open up a support ticket by sending an email to [email protected] with a link to this post for reference.
That way we can gather more information from the server to help out in this issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
gwakem
Posts: 238
Joined: Mon Jan 23, 2012 2:02 pm
Location: Asheville, NC

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by gwakem »

I discovered if I chmod -R 750 /usr/local/nagiosxi/html as sort of a anvil on the head of the issue, the upgrade works correctly. I've tired to narrow down the specific directory/file that causes the problem, but so far no luck. Any ideas? Its worth noting in the past, upgrades worked with no issues.
--
Griffin Wakem
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by tgriep »

It is hard to say which of the files were causing the issue without getting some sort of errors.
At least it is working now.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
gwakem
Posts: 238
Joined: Mon Jan 23, 2012 2:02 pm
Location: Asheville, NC

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by gwakem »

I figured it out, and I am at a loss.
/usr/local/nagiosxi/html/includes/phpmailer/PHPMailerAutoload.php gets created with 0600 permissions. I changed it to 0640 and the install completed. No other changes were made. I.. don't understand.
--
Griffin Wakem
User avatar
gwakem
Posts: 238
Joined: Mon Jan 23, 2012 2:02 pm
Location: Asheville, NC

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by gwakem »

I wasn't ignoring you when you said "capture the errors", it's just that there were no more errors to capture. I pretty much posted everything I had, from the upgrade.log to the apache logs I have.

That said, I guess the PHPMailer alert in the apache logs wasn't a false alarm. Although I'm really not understanding how that breaks this install such a substantial fashion. And this is a new file, it didnt exist before the upgrade, so I'm even more confused as to why this only seems to be isolated to me.

finally, it seems the ndo2db binary in /usr/local/nagios/bin/ was created 700 so wouldnt start, so the permissions on that were wonky also. No idea why. Changing that fixed it and I now have a functional test system. Now I get to do all of this on prod.

I don't know if the creation of those files as 600 and that affecting the upgrade is understandable behavior, but if would be cool if something could check for that in the future. This one was a headache.

Anyway, this can be locked.
--
Griffin Wakem
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by tgriep »

That is the strange thing, I saw the errors but I checked the permissions and they are the same on a few of my systems so that is why I didn't think it was the cause of the failure.
The ndo2db permissions are strange, are all of the binaries set to 700?
What are the umask settings on your server.
Run umask as root and post the output.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
gwakem
Posts: 238
Joined: Mon Jan 23, 2012 2:02 pm
Location: Asheville, NC

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by gwakem »

I was more confused as to why a phpmailer script's permissions could cause apache to issue a 500 error during a curl.

NDO permissions: They are not, only ndo2db was set to 700. The remaining updated files were 775 or 755, hence my confusion.

umask is currently 0077, which is what our security settings require. During the installation however, I changed it to 0022 after the first failure, just to rule that out.
--
Griffin Wakem
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade from 5.4.0 to 5.4.4 failure

Post by tgriep »

I don't understand why the PHPMailer scripts caused the failure either. Well, at least it is working now.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked