Upgrading from 1.1.38 to 1.2.0 fails

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

Moderators: Developers, Moderators

Post Reply
renegade310
Posts: 19
Joined: Mon Jan 14, 2019 2:54 am

Upgrading from 1.1.38 to 1.2.0 fails

Post by renegade310 »

My upgrade from 1.1.38 to 1.2.0 freezes with this on webui:

Code: Select all

Installing Cacti Server v1.2.0
Your Cacti Server is now installing

Refresh in	 	ProgressLast updated: 09:51:19
 	
0 %
2019/01/14 09:51:19 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547452279.1488 
2019/01/14 09:26:18 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547450778.7475 
2019/01/12 19:04:18 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547312658.0686 
2019/01/12 18:39:17 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547311157.1965 
2019/01/12 18:14:17 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547309656.9957 
2019/01/12 17:49:15 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547308155.3476 
2019/01/12 17:24:14 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547306654.1411 
2019/01/12 16:59:12 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547305152.6487 
2019/01/12 16:34:11 - INSTALL: always: Spawning background process: /usr/bin/php /usr/share/cacti/site/install/background.php 1547303651.3062 
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by netniV »

Can you edit cli_check.php and change the following:

Code: Select all

diff --git a/include/cli_check.php b/include/cli_check.php
index 9342fdca..b4204c28 100644
--- a/include/cli_check.php
+++ b/include/cli_check.php
@@ -23,7 +23,7 @@
 */
 
 /* do NOT run this script through a web browser */
-if (!isset($_SERVER['argv'][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
+if (php_sapi_name != 'cli') {
        die('<br><strong>This script is only meant to run at the command line.</strong>');
 }
I suspect that for some reason your server is setting $_SERVER['REQUEST_METHOD'] and $_SERVER['REMOTE_ADDR'] at the cli which is weird.

Can you tell me the OS and PHP version?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
renegade310
Posts: 19
Joined: Mon Jan 14, 2019 2:54 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by renegade310 »

netniV wrote:Can you edit cli_check.php and change the following:

Code: Select all

diff --git a/include/cli_check.php b/include/cli_check.php
index 9342fdca..b4204c28 100644
--- a/include/cli_check.php
+++ b/include/cli_check.php
@@ -23,7 +23,7 @@
 */
 
 /* do NOT run this script through a web browser */
-if (!isset($_SERVER['argv'][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
+if (php_sapi_name != 'cli') {
        die('<br><strong>This script is only meant to run at the command line.</strong>');
 }
I suspect that for some reason your server is setting $_SERVER['REQUEST_METHOD'] and $_SERVER['REMOTE_ADDR'] at the cli which is weird.

Can you tell me the OS and PHP version?
I make changes in /usr/share/cacti/site/include/cli_check.php but it doesn`t help.
os:

Code: Select all

Linux renegade 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
php7.2
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by netniV »

Which release of ubuntu is this?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
renegade310
Posts: 19
Joined: Mon Jan 14, 2019 2:54 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by renegade310 »

netniV wrote:Which release of ubuntu is this?
Its a desktop test machine:

Code: Select all

lsb_release -a
No LSB modules are available.
Distributor ID:	LinuxMint
Description:	Linux Mint 19 Tara
Release:	19
Codename:	tara
renegade310
Posts: 19
Joined: Mon Jan 14, 2019 2:54 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by renegade310 »

renegade310 wrote:
netniV wrote:Which release of ubuntu is this?
Its a desktop test machine:

Code: Select all

lsb_release -a
No LSB modules are available.
Distributor ID:	LinuxMint
Description:	Linux Mint 19 Tara
Release:	19
Codename:	tara
And, in adress bar, I got this strange link:

Code: Select all

http://127.0.0.1/cacti/install/install.php?data={"Step":"97","Eula":"1"}
Last edited by renegade310 on Mon Jan 14, 2019 10:39 am, edited 1 time in total.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by cigamit »

What browser, and do you have any addons disabling javascript?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by netniV »

renegade310 wrote:And, in adress bar, I got this strange link:

Code: Select all

http://127.0.0.1/cacti/install/install.php?data={"Step":"97","Eula":"1"}
That's not a strange link, that's expected :)

Step 97 means begin installation. Eula 1 means you accepted our license terms. It does sound like the installer is not spawning the background exec. I will have to try and get a version of Mint going to see if I can spot the obvious.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
renegade310
Posts: 19
Joined: Mon Jan 14, 2019 2:54 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by renegade310 »

cigamit wrote:What browser, and do you have any addons disabling javascript?
Google chrome, no adds that can disable js.
Wirthmueller
Cacti User
Posts: 60
Joined: Wed Mar 02, 2011 9:02 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by Wirthmueller »

I have got exactly the same error (complete replicate on all messages described above) on a completely different system (Synology NAS running Linux Kernel Version 3.10.105 / Synology 6.2 GM-23824).

I tried to update from a fully working cacti v1.1.38 to v1.2.1
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Upgrading from 1.1.38 to 1.2.0 fails

Post by netniV »

This may be related to a CLI issue that has come to light where some people have WEB-based information appearing in their CLI environments of PHP. For example, in another post on here about being unable to update the PHP location, someone sent me their installation logs and then when he applied a temporary code change for debugging purposes we found that $_SERVER['REQUEST_METHOD'] and $_SERVER['REMOTE_ADDR'] where both being set.

That is highly unusual from a CLI point of view because there is no REQUEST_METHOD since it isn't a HTTP request, and the REMOTE_ADDR is not normally set as that is normally the client address. But a CLI doesn't consider itself a client/server environment so again should not be set.

I am about to push some changes to our latest development code to correct the issue. We then need to run through a bunch of tests to ensure that the change is OK. It does seem to be specific environments only though and not a general issue making me think it's a configuration or environmental option that's causing the above weirdness.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

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

Who is online

Users browsing this forum: No registered users and 1 guest