[SOLVED]Cannot Install Cacti-1.2.1 new release

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

Moderators: Moderators, Developers

Author
Message
eholz1
Cacti User
Posts: 137
Joined: Mon Oct 01, 2018 10:09 am

Re: Cannot Install Cacti-1.2.1 new release

#16 Post by eholz1 » Fri Feb 01, 2019 11:33 am

Hello, Thank you very much for the information.
This forum is very helpful.

I will check the links, and see what is up.

Thanks,

eholz1

eholz1
Cacti User
Posts: 137
Joined: Mon Oct 01, 2018 10:09 am

Re: Cannot Install Cacti-1.2.1 new release

#17 Post by eholz1 » Fri Feb 01, 2019 5:32 pm

This is what I get and before you ask java is enabled!
ie_error_message.JPG
ie_error_message.JPG (22.8 KiB) Viewed 670 times

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

Re: Cannot Install Cacti-1.2.1 new release

#18 Post by netniV » Sat Feb 02, 2019 3:53 am

OK, so what this means is there is an error occurring in your browser console, can you let me know what that error is?

And I'm assuming that it's JavaScript you must have enabled, don't need Java (fyi two completely different things).

User avatar
Osiris
Cacti Pro User
Posts: 863
Joined: Mon Jan 05, 2015 10:10 am

Re: Cannot Install Cacti-1.2.1 new release

#19 Post by Osiris » Sun Feb 03, 2019 8:12 am

The JavaScript issue is fixed in GitHub.
Before history, there was a paradise, now dust.

chickenlicker
Posts: 10
Joined: Tue Jul 21, 2015 11:05 pm

Re: [SOLVED]Cannot Install Cacti-1.2.1 new release

#20 Post by chickenlicker » Thu Feb 21, 2019 9:34 pm

I've just downloaded the new cacti version 1.2.1 off the website today for fresh install and am getting the same error, though this is on a windows machine.
The install is interrupted at the first stage and an 'action failed' popup is displayed as per OP's first post.

My browser debugging shows an XHR POST to http://<redacted>/cacti/install/step_json.php
The browser is showing PHP errors thrown before the JSON in that POST:

Code: Select all

<br />
<b>Notice</b>:  Undefined index: name in <b>C:\Apache24\htdocs\cacti\lib\installer.php</b> on line <b>959</b><br />
<br />
<b>Notice</b>:  Undefined index: name in <b>C:\Apache24\htdocs\cacti\lib\installer.php</b> on line <b>959</b><br />
<br />
<b>Notice</b>:  Undefined index: name in <b>C:\Apache24\htdocs\cacti\lib\installer.php</b> on line <b>959</b><br />
<br />
<b>Notice</b>:  Undefined index: name in <b>C:\Apache24\htdocs\cacti\lib\installer.php</b> on line <b>959</b><br />
<br />
<b>Notice</b>:  Undefined index: name in <b>C:\Apache24\htdocs\cacti\lib\installer.php</b> on line <b>959</b><br />
{"Mode":"1","Step":"1","Errors":{"Modules":[" is missing"," is missing"," is missing"," is missing"," is missing"]},"Eula":null,"Prev":{"Text":"Previous","Step":0,"Enabled":false,"Visible":true},"Next":{"Text":"Begin","Step":2,"Enabled":false,"Visible":true},"Test":{"Text":"Test Connection","Step":-4,"Enabled":true,"Visible":false},"Theme":"modern","StepData":{"Eula":null,"Theme":"modern","Language":"en-US"},"Html":"<h2 class='cactiInstallSectionTitle'>Cacti Version 1.2.1 - License Agreement<\/h2><p class='cactiInstallSection cactiInstallSectionNormal'>Thanks for taking the time to download and install Cacti, the complete graphing solution for your network. Before you can start making cool graphs, there are a few pieces of data that Cacti needs to know.<\/p><p class='cactiInstallSection cactiInstallSectionNormal'>Make sure you have read and followed the required steps needed to install Cacti before continuing. Install information can be found for <a href=\"..\/docs\/html\/install_unix.html\">Unix<\/a> and <a href=\"..\/docs\/html\/install_windows.html\">Win32<\/a>-based operating systems.<\/p><p class='cactiInstallSection cactiInstallSectionNormal'>Cacti is licensed under the GNU General Public License, you must agree to its provisions before continuing:<\/p><p class='cactiInstallSection cactiInstallSectionCode'>This program is free software; you can redistribute it and\/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br\/><br\/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.<\/p><p class='cactiInstallSection cactiInstallSectionNormal'><span>Select default theme: <select id='theme' name='theme'><option value='classic'>Classic<\/option><option value='dark'>Dark<\/option><option value='modern' selected>Modern<\/option><option value='paper-plane'>Paper-plane<\/option><option value='paw'>Paw<\/option><option value='sunrise'>Sunrise<\/option><\/select><\/span><span style='float: right'><input type='checkbox' id='accept' name='accept'><label for='accept'>Accept GPL License Agreement<\/label><\/span><span><select id='language' name='theme'>\r\nen-US == ar-SA [Arabic]\r\n<option value='ar-SA' data-class='flag-icon-sa'><span class=\"flag-icon flag-icon-squared flag-icon-sa\"><\/span>Arabic<\/option>\r\nen-US == bg-BG [Bulgarian]\r\n<option value='bg-BG' data-class='flag-icon-bg'><span class=\"flag-icon flag-icon-squared flag-icon-bg\"><\/span>Bulgarian<\/option>\r\nen-US == zh-CN [Chinese (China)]\r\n<option value='zh-CN' data-class='flag-icon-cn'><span class=\"flag-icon flag-icon-squared flag-icon-cn\"><\/span>Chinese (China)<\/option>\r\nen-US == zh-TW [Chinese (Taiwan)]\r\n<option value='zh-TW' data-class='flag-icon-tw'><span class=\"flag-icon flag-icon-squared flag-icon-tw\"><\/span>Chinese (Taiwan)<\/option>\r\nen-US == nl-NL [Dutch]\r\n<option value='nl-NL' data-class='flag-icon-nl'><span class=\"flag-icon flag-icon-squared flag-icon-nl\"><\/span>Dutch<\/option>\r\nen-US == en-US [English]\r\n<option value='en-US' selected data-class='flag-icon-us'><span class=\"flag-icon flag-icon-squared flag-icon-us\"><\/span>English<\/option>\r\nen-US == fr-FR [French]\r\n<option value='fr-FR' data-class='flag-icon-fr'><span class=\"flag-icon flag-icon-squared flag-icon-fr\"><\/span>French<\/option>\r\nen-US == de-DE [German]\r\n<option value='de-DE' data-class='flag-icon-de'><span class=\"flag-icon flag-icon-squared flag-icon-de\"><\/span>German<\/option>\r\nen-US == el-GR [Greek]\r\n<option value='el-GR' data-class='flag-icon-gr'><span class=\"flag-icon flag-icon-squared flag-icon-gr\"><\/span>Greek<\/option>\r\nen-US == he-IL [Hebrew]\r\n<option value='he-IL' data-class='flag-icon-il'><span class=\"flag-icon flag-icon-squared flag-icon-il\"><\/span>Hebrew<\/option>\r\nen-US == hi-IN [Hindi]\r\n<option value='hi-IN' data-class='flag-icon-in'><span class=\"flag-icon flag-icon-squared flag-icon-in\"><\/span>Hindi<\/option>\r\nen-US == it-IT [Italian]\r\n<option value='it-IT' data-class='flag-icon-it'><span class=\"flag-icon flag-icon-squared flag-icon-it\"><\/span>Italian<\/option>\r\nen-US == ja-JP [Japanese]\r\n<option value='ja-JP' data-class='flag-icon-jp'><span class=\"flag-icon flag-icon-squared flag-icon-jp\"><\/span>Japanese<\/option>\r\nen-US == ko-KR [Korean]\r\n<option value='ko-KR' data-class='flag-icon-kr'><span class=\"flag-icon flag-icon-squared flag-icon-kr\"><\/span>Korean<\/option>\r\nen-US == pl-PL [Polish]\r\n<option value='pl-PL' data-class='flag-icon-pl'><span class=\"flag-icon flag-icon-squared flag-icon-pl\"><\/span>Polish<\/option>\r\nen-US == pt-PT [Portuguese]\r\n<option value='pt-PT' data-class='flag-icon-pt'><span class=\"flag-icon flag-icon-squared flag-icon-pt\"><\/span>Portuguese<\/option>\r\nen-US == pt-BR [Portuguese (Brazil)]\r\n<option value='pt-BR' data-class='flag-icon-br'><span class=\"flag-icon flag-icon-squared flag-icon-br\"><\/span>Portuguese (Brazil)<\/option>\r\nen-US == ru-RU [Russian]\r\n<option value='ru-RU' data-class='flag-icon-ru'><span class=\"flag-icon flag-icon-squared flag-icon-ru\"><\/span>Russian<\/option>\r\nen-US == es-ES [Spanish]\r\n<option value='es-ES' data-class='flag-icon-es'><span class=\"flag-icon flag-icon-squared flag-icon-es\"><\/span>Spanish<\/option>\r\nen-US == sv-SE [Swedish]\r\n<option value='sv-SE' data-class='flag-icon-se'><span class=\"flag-icon flag-icon-squared flag-icon-se\"><\/span>Swedish<\/option>\r\nen-US == tr-TR [Turkish]\r\n<option value='tr-TR' data-class='flag-icon-tr'><span class=\"flag-icon flag-icon-squared flag-icon-tr\"><\/span>Turkish<\/option>\r\nen-US == vi-VN [Vietnamese]\r\n<option value='vi-VN' data-class='flag-icon-vn'><span class=\"flag-icon flag-icon-squared flag-icon-vn\"><\/span>Vietnamese<\/option><\/select><\/span><\/p>"}

Line 959 of installer.php is part of a foreach cycling through extensions, and calls $e['name'] but $e['name'] isn't part of the $extensions array.
$extensions is as follows:

Code: Select all

array(22) {
  ["ctype"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["openssl"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["filter"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["gettext"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["gd"]=>
  array(3) {
    ["cli"]=>
    bool(false)
    ["web"]=>
    bool(false)
    ["installed"]=>
    bool(false)
  }
  ["gmp"]=>
  array(3) {
    ["cli"]=>
    bool(false)
    ["web"]=>
    bool(false)
    ["installed"]=>
    bool(false)
  }
  ["hash"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["json"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["ldap"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["mbstring"]=>
  array(3) {
    ["cli"]=>
    bool(false)
    ["web"]=>
    bool(false)
    ["installed"]=>
    bool(false)
  }
  ["date"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["PDO"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["pcre"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["pdo_mysql"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["session"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["simplexml"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["sockets"]=>
  array(3) {
    ["cli"]=>
    bool(false)
    ["web"]=>
    bool(false)
    ["installed"]=>
    bool(false)
  }
  ["spl"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["standard"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["xml"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["zlib"]=>
  array(3) {
    ["cli"]=>
    bool(true)
    ["web"]=>
    bool(true)
    ["installed"]=>
    bool(true)
  }
  ["com_dotnet"]=>
  array(3) {
    ["cli"]=>
    bool(false)
    ["web"]=>
    bool(false)
    ["installed"]=>
    bool(false)
  }
}
Here's the foreach:

Code: Select all

foreach ($extensions as $e) {
				if (!$e['installed']) {
					$this->addError(Installer::STEP_CHECK_DEPENDENCIES, 'Modules', $e['name'] . ' is missing');
				}
			}

I've changed my copy to:

Code: Select all

foreach ($extensions as $extname => $e) {
				if (!$e['installed']) {
					$this->addError(Installer::STEP_CHECK_DEPENDENCIES, 'Modules', $extname . ' is missing');
				}
			}
Which then returns the following via JSON and resolves the "action failed" error that we're getting.

Code: Select all

Mode	1
Step	1
Errors	{…}
Modules	[…]
0	gd is missing
1	gmp is missing
2	mbstring is missing
3	sockets is missing
4	com_dotnet is missing
Eula	null
Prev	{…}
Text	Previous
Step	0
Enabled	false
Visible	true
Next	{…}
Text	Begin
Step	2
Enabled	false
Visible	true
Test	{…}
Text	Test Connection
Step	-4
Enabled	true
Visible	false
Theme	modern
StepData	{…}
Eula	null
Theme	modern
Language	en-US
Html	<h2 class='cactiInstallSectionTitle'>Cacti Version 1.2.1 - License Agreement</h2><p class='cactiInstallSection cactiInstallSectionNormal'>Thanks for taking the time to download and install Cacti, the complete graphing solution for your network. Before you can start making cool graphs, there are a few pieces of data that Cacti needs to know.</p><p class='cactiInstallSection cactiInstallSectionNormal'>Make sure you have read and followed the required steps needed to install Cacti before continuing. Install in…</span>Spanish</option> en-US == sv-SE [Swedish] <option value='sv-SE' data-class='flag-icon-se'><span class="flag-icon flag-icon-squared flag-icon-se"></span>Swedish</option> en-US == tr-TR [Turkish] <option value='tr-TR' data-class='flag-icon-tr'><span class="flag-icon flag-icon-squared flag-icon-tr"></span>Turkish</option> en-US == vi-VN [Vietnamese] <option value='vi-VN' data-class='flag-icon-vn'><span class="flag-icon flag-icon-squared flag-icon-vn"></span>Vietnamese</option></select></span></p>

Alternatively you can switch display_errors = Off in your php.ini and it should prevent this error during install.
That probably won't tell you which extensions you're missing tho.
This is php 7.1.3

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

Re: [SOLVED]Cannot Install Cacti-1.2.1 new release

#21 Post by netniV » Fri Feb 22, 2019 5:34 am

I would concur with your fix, as I had the following diff ready for this:

Code: Select all

diff --git a/lib/installer.php b/lib/installer.php
index ed50ac91..290889ba 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -954,9 +954,9 @@ class Installer implements JsonSerializable {
                if (isset($this->extensions) || empty($this->extensions)) {
                        $extensions = utility_php_extensions();

-                       foreach ($extensions as $e) {
+                       foreach ($extensions as $name=>$e) {
                                if (!$e['installed']) {
-                                       $this->addError(Installer::STEP_CHECK_DEPENDENCIES, 'Modules', $e['name'] . ' is missing');
+                                       $this->addError(Installer::STEP_CHECK_DEPENDENCIES, 'Modules', $name . ' is missing');
                                }
                        }
If you could log this on GitHub, I can associate the fix to the issue.

chickenlicker
Posts: 10
Joined: Tue Jul 21, 2015 11:05 pm

Re: [SOLVED]Cannot Install Cacti-1.2.1 new release

#22 Post by chickenlicker » Sun Feb 24, 2019 7:37 pm

Sorry netniV, I'm new to Github and not sure how it all works yet but I endeavour to get involved. :)

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

Re: [SOLVED]Cannot Install Cacti-1.2.1 new release

#23 Post by netniV » Mon Feb 25, 2019 3:51 am

i already added that fix but if you do find any others feel free to contribute :)

dv8
Posts: 7
Joined: Sun Mar 17, 2019 6:15 pm

Re: [SOLVED]Cannot Install Cacti-1.2.1 new release

#24 Post by dv8 » Mon Mar 18, 2019 4:29 pm

Thanks netniV. Have sent the partial log off to you as per your instructions

Post Reply