Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing, multiple issues can be seen due to bad packages #3313

Closed
ndilooc opened this issue Mar 3, 2020 · 44 comments
Closed

When installing, multiple issues can be seen due to bad packages #3313

ndilooc opened this issue Mar 3, 2020 · 44 comments
Assignees
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team installer Installation issue process Related to release/packaging process resolved A fixed issue
Milestone

Comments

@ndilooc
Copy link

ndilooc commented Mar 3, 2020

i am new to installing cacti, but i have issue when instaling it keep looping and stay 41 %
cacti

@Jh0nHerrera
Copy link

If you don't select any template to install the installation is succeed

@Jh0nHerrera
Copy link

UPDATE 2 NOTE:
If you uncheck Cisco Template, the installation is succeed

@larsf96
Copy link

larsf96 commented Mar 3, 2020

UPDATE 2 NOTE:
If you uncheck Cisco Template, the installation is succeed

Is there any way to reset an installation? I'm also getting stuck at 41%, but how to start from the beginning?

@Jh0nHerrera
Copy link

Jh0nHerrera commented Mar 3, 2020

UPDATE 3 NOTE:
I finally found the problem, this issue occurred if you check the latest option, please check the image with the red circle
image

Unchecking this one solve the installation problem

In order to start the installation again do the following:
1- delete symbolic link and cacti directory
2- delete cacti db from mariadb or mysql
3- extract again cacti latest version and create symbolic link
4- create again cacti db from mariadb or mysql
5- import database structure to cacti db
6- modify config.php to reflect username and passwor for cacti db
7- start again the installation process from Web Browser.

@netniV
Copy link
Member

netniV commented Mar 4, 2020

You can restart the installation process a little more simply using MySQL:

delete from settings where name like 'install_%';

I'm curious over the blank line, it sounds like a change has been made to the templates or there's a template that isn't being parsed properly but is being placed into the array somehow.

@TheWitness
Copy link
Member

Sounds like the Cisco package is broken. Likely a file transfer of a tar file in ASCII mode. That would break it.

@netniV
Copy link
Member

netniV commented Mar 4, 2020

Actually, the missing package appears to be the Cacti Stats package.

Cacti_Stats.xml.gz
Cisco_Router.xml.gz
Generic_SNMP_Device.xml.gz
Local_Linux_Machine.xml.gz
NetSNMP_Device.xml.gz
Windows_Device.xml.gz

@Jh0nHerrera
Copy link

Yes, in fact the installation process stuck when importing Cacti_Stats.xml.gz

@netniV
Copy link
Member

netniV commented Mar 4, 2020

If you remove that package and restart, installation should complete (or just untick the box as mentioned). We will look at fixing the installer to handle bad packages.

@netniV netniV self-assigned this Mar 4, 2020
@netniV netniV added bug Undesired behaviour confirmed Bug is confirm by dev team installer Installation issue process Related to release/packaging process labels Mar 4, 2020
@netniV netniV added this to the 1.2.11 milestone Mar 4, 2020
@cigamit
Copy link
Member

cigamit commented Mar 8, 2020

This is resolved no.

@cigamit cigamit closed this as completed Mar 8, 2020
@netniV
Copy link
Member

netniV commented Mar 8, 2020

Not sure, I haven't fixed a bad package freezing things myself, but we have fixed the package.

@TheWitness
Copy link
Member

I recreated the package and committed it. Also, testing multiple times now.

@TheWitness
Copy link
Member

I guess fixing if a package is damaged is optional at this point.

@netniV
Copy link
Member

netniV commented Mar 9, 2020

I'm going to reopen and just submit another commit for that portion later. It's not hard to replicate, we just need to isolate the part that adds it regardless of a lack of info.

@netniV netniV reopened this Mar 9, 2020
@netniV
Copy link
Member

netniV commented Mar 9, 2020

So testing with the latest version does show the package with no details and allow installation to complete. However, at the moment, the packages do not flag that they have failed. Not a major issue, but we probably should log it.

2020/03/09 17:33:26 - INSTALL: always: Import of Package #4 'Local_Linux_Machine.xml.gz' under Profile '3' failed
2020/03/09 17:33:26 - INSTALL: always: About to import Package #4 'Local_Linux_Machine.xml.gz'.

@majed17
Copy link

majed17 commented Mar 13, 2020

Peace, on Fedora 31, it is stuck at 2% `

Refresh in   ProgressLast updated: 09:16:18
    2 %
[2020-03-13 09:16:18] [ always  ] Spawning background process: /bin/php '/usr/share/cacti/install/background.php' 1584080178.1171
[2020-03-13 09:16:18] [ always  ] Setting PHP Option max_execution_time = 0
[2020-03-13 09:16:18] [ always  ] Setting PHP Option memory_limit = -1
[2020-03-13 09:16:18] [ always  ] Starting UPGRADE Process for v1.2.10
[2020-03-13 09:32:27] [ always  ] Spawning background process: /bin/php '/usr/share/cacti/install/background.php' 1584081147.6839
[2020-03-13 09:32:27] [ always  ] Setting PHP Option max_execution_time = 0
[2020-03-13 09:32:27] [ always  ] Setting PHP Option memory_limit = -1
[2020-03-13 09:32:28] [ always  ] Starting UPGRADE Process for v1.2.10
[2020-03-13 09:36:32] [ always  ] Spawning background process: /bin/php '/usr/share/cacti/install/background.php' 1584081392.2176
[2020-03-13 09:36:32] [ always  ] Setting PHP Option max_execution_time = 0
[2020-03-13 09:36:32] [ always  ] Setting PHP Option memory_limit = -1
[2020-03-13 09:36:32] [ always  ] Starting UPGRADE Process for v1.2.10

tried renaming moving the Cacti_Stats.xml.gz to /opt
and restarting the installation with no success.. what to do?

@netniV
Copy link
Member

netniV commented Mar 13, 2020

This sounds like your background process is failing to start for some reason. I would suggest trying to run the command above using something like:

sudo -u <website user> /bin/php ....

Just replace the dots with the remainder of the command.

@majed17
Copy link

majed17 commented Mar 16, 2020

sudo -u apache /bin/php '/usr/share/cacti/install/background.php'
produces no output..

[2020-03-13 10:26:34] [ always  ] Setting PHP Option max_execution_time = 0
[2020-03-13 10:26:34] [ always  ] Setting PHP Option memory_limit = -1
[2020-03-13 10:26:34] [ always  ] Starting UPGRADE Process for v1.2.10
[2020-03-16 09:02:36] [ always  ] Spawning background process: /bin/php '/usr/share/cacti/install/background.php' 1584338556.8927
[2020-03-16 09:02:37] [ always  ] Setting PHP Option max_execution_time = 0
[2020-03-16 09:02:37] [ always  ] Setting PHP Option memory_limit = -1
[2020-03-16 09:02:37] [ always  ] Starting UPGRADE Process for v1.2.10
[2020-03-16 09:09:09] [ always  ] no parameters passed

[2020-03-16 09:09:33] [ always  ] Spawning background process: /bin/php '/usr/share/cacti/install/background.php' 1584338973.858
[2020-03-16 09:09:34] [ always  ] Setting PHP Option max_execution_time = 0
[2020-03-16 09:09:34] [ always  ] Setting PHP Option memory_limit = -1
[2020-03-16 09:09:34] [ always  ] Starting UPGRADE Process for v1.2.10
[2020-03-16 09:10:02] [ always  ] no parameters passed

[2020-03-16 09:10:39] [ always  ] no parameters passed

[2020-03-16 09:10:44] [ always  ] Spawning background process: /bin/php '/usr/share/cacti/install/background.php' 1584339044.1615
[2020-03-16 09:10:44] [ always  ] Setting PHP Option max_execution_time = 0
[2020-03-16 09:10:44] [ always  ] Setting PHP Option memory_limit = -1
[2020-03-16 09:10:44] [ always  ] Starting UPGRADE Process for v1.2.1

@netniV
Copy link
Member

netniV commented Mar 16, 2020

You are seeing zero output, even with the numbers at the end that you are supposed to supply?

@mckaygerhard
Copy link

and seems mikrotik plugin fails due depents of stat template? Cacti/plugin_mikrotik#41

@netniV
Copy link
Member

netniV commented Mar 20, 2020

@TheWitness said something usefull? nah i dont think so.. well in any case, how we can use the stat in cacti if we skiped the step of template?

That was neither useful nor productive either @mckaygerhard, and as someone who works with Linux a lot, unless you have a large test bed or team, mistakes can happen, even to seasoned linux guru's (or are you trying to say there are no other bug trackers out there?). Heck Microsoft and AV vendors a like have released patches that crippled machines across the world, so maybe think a little before you try the easy option of berating without thought.

I think we've been reasonable in our responses and if you download the latest packages folder that is under install/templates you shouldn't have an issue. Failing that, an updated package will be released by next weekend (health, work and life balances permitting).

For now, I'm going to get back to the actual issue that was being experienced before you derailed this thread, so please have more patience and more curtesy.

@netniV
Copy link
Member

netniV commented Mar 20, 2020

@majed17: sorry i do not understand, what numbers?

On the command line where the /usr/bin/php command is, the full command has numbers at the very end. These are a timestamp used as a simple test to make sure there are not more than one process run at once.

For example, the full command you could have run is:

sudo -u apache /bin/php '/usr/share/cacti/install/background.php' 1584338556.8927

@vegnuli
Copy link

vegnuli commented Mar 20, 2020

hi @netniV but that template never install, and a max_execution_time are hardcoded in the file:

I think we've been reasonable in our responses and if you download the latest packages folder that is under install/templates you shouldn't have an issue. Failing that, an updated package will be released by next weekend (health, work and life balances permitting).

i try to make it to work by modify to 256 seconsdd and hangs if set to unlimited, men see tha picture!..

/usr/share/webapps/cacti/install/templates$ php /usr/share/webapps/cacti/cli/import_package.php --filename=Cacti_Stats.x
ml.gz 
Read 85563 bytes of Package data
PHP Fatal error:  Maximum execution time of 50 seconds exceeded in /usr/share/webapps/cacti/lib/import.php on line 280

Captura de pantalla de 2020-03-19 22-58-38

@majed17
Copy link

majed17 commented Mar 20, 2020

something constructive? you mean like mentioning from where must I get that timestamp?

TheWitness added a commit that referenced this issue Mar 21, 2020
Installing cacti 1.2.10 in debian and ubuntu stopped at 41%
@TheWitness TheWitness added the resolved A fixed issue label Mar 21, 2020
@TheWitness
Copy link
Member

@netniV may want to take this longer, but the install_package.php will not timeout any longer. Thanks for the debug output.

@Cacti Cacti deleted a comment from mckaygerhard Mar 21, 2020
@capricorn800
Copy link

Its been closed withouth any solution telling how to kill this process. Even though I restarted the server still its running with same status

@TheWitness
Copy link
Member

@mckaygerhard
Copy link

mckaygerhard commented Apr 1, 2020

and newer package does not work any way @capricorn800 seem we cannot use the stats package as many people just reported! please apply the patch in the previously comments.. it's the only way to install the cacti, do not select the last template at install process and will go under good way..

@majed17
Copy link

majed17 commented Apr 3, 2020

sudo -u apache /bin/php '/usr/share/cacti/install/background.php' 1585896763.8316
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function install_create_csrf_secret(), 0 passed in /usr/share/cacti/lib/installer.php on line 639 and exactly 1 expected in /usr/share/cacti/install/functions.php:68
Stack trace:
#0 /usr/share/cacti/lib/installer.php(639): install_create_csrf_secret()
#1 /usr/share/cacti/lib/installer.php(2849): Installer->setCSRFSecret()
#2 /usr/share/cacti/lib/installer.php(3346): Installer->install()
#3 /usr/share/cacti/install/background.php(54): Installer::beginInstall('1585896763.8316')
#4 {main}
thrown in /usr/share/cacti/install/functions.php on line 68

@netniV
Copy link
Member

netniV commented Apr 3, 2020

Hi @majed17,

Thanks for that info, can you log that as a new issue so I can tag against it. I can see the problem already with it.

@netniV
Copy link
Member

netniV commented Apr 3, 2020

diff --git a/lib/installer.php b/lib/installer.php
index f46c89784..ebf1076ed 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -637,7 +637,7 @@ class Installer implements JsonSerializable {
                        if (empty($secret)) {
                                if (is_resource_writable($path_csrf_secret)) {
                                        log_install_medium('csrf', 'setCSRFSecret(): Updated CSRF secret - "' . $path_csrf_secret . '"');
-                                       install_create_csrf_secret();
+                                       install_create_csrf_secret($path_csrf_secret);
                                } else {
                                        log_install_high('csrf', 'setCSRFSecret(): Unable to create file - "' . $path_csrf_secret . '"');
                                }

@netniV netniV changed the title Installing cacti 1.2.10 in debian and ubuntu stopped at 41% When installing Apr 5, 2020
@netniV netniV changed the title When installing When installing, multiple issues can be seen due to bad packages Apr 5, 2020
@GAS85
Copy link

GAS85 commented Apr 9, 2020

Meet the same error on 1.2.11 when select only "Linux Local Machine" and "Generic SNMP"

2020/04/09 08:44:15 - IMPORT Importing XML Data for Local_Linux_Machine.xml 

@mckaygerhard
Copy link

confirmed! @GAS85 .. as i wrote several times still raise errors

@netniV
Copy link
Member

netniV commented Apr 9, 2020

So this is another package issue? The last was the cacti stats one. Lets open that as a new issue then.

@hiddenicon
Copy link

Was a new issue opened? I'm seeing this issue on 1.2.10 to 1.2.11 upgrade. Stuck on the Cisco_Router.xml.gz import.

@majed17
Copy link

majed17 commented Apr 24, 2020

i had your same problem, and was intending on asking for help, but first, i terminated the upgrade process ... and then it just let me in :D

@mckaygerhard
Copy link

still problems on new version of cacti.. confirmed! pufff marked as "solved" .. wow! so much solved!

@majed17
Copy link

majed17 commented Apr 24, 2020

it's not nice to communicate "yes" meaning a "no" and i'm just trying to be nice ;)

@TheWitness
Copy link
Member

Some asses can not be covered by makeup and fancy clothing.

@netniV
Copy link
Member

netniV commented Apr 26, 2020

i'm just trying to be nice ;)

Always appreciated. Whilst we had previously fixed one issue, that introduced another problem due to changing the mechanics. Alas, the limited testing that we can do doesn't always show everything so we are greatful to those of you who keep with the cutting edge and help us out 👍

@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team installer Installation issue process Related to release/packaging process resolved A fixed issue
Projects
None yet
Development

No branches or pull requests