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

Bad PHP memory limit values can result in failed upgrades #3296

Closed
blowrancebenton opened this issue Feb 24, 2020 · 5 comments
Closed

Bad PHP memory limit values can result in failed upgrades #3296

blowrancebenton opened this issue Feb 24, 2020 · 5 comments
Assignees
Labels
bug Undesired behaviour installer Installation issue resolved A fixed issue
Milestone

Comments

@blowrancebenton
Copy link

blowrancebenton commented Feb 24, 2020

Describe the bug

  • I completed the upgrade instructions posted here (for 1.2.5 to 1.2.9): https://www.cacti.net/downloads/docs/html/upgrade.html
    • All of the upgrade checks verified ok.
    • When I proceeded to allow the web interface to complete the upgrade it shows a progress bar indicating "Your Cacti Server is now installing" but it never completes it remains at 0% with "--- NO LOG FOUND ---" below it.
  • I checked /path/to/cacti/log/install-general.log and it shows it spawned background process /usr/bin/php '/usr/share/cacti/install/background.php'
    • If I launch this process from the console of the Cacti Server it produces the following error:
      PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes) in /usr/share/cacti/lib/functions.php on line 3127

To Reproduce
I'm not exactly certain the variables required to reproduce, I simply upgraded Cacti from 1.2.5 to 1.2.9 (replaced the Cacti Files, logged in and confirmed the requirements were met then instructed it to begin the upgrade). The OS is Ubuntu 18.04.1.

Expected behavior
The upgrade process should have completed or listed errors. It only shows the progress bar at 0% and underneath that it shows "--- NO LOG FOUND ---. There is a green progress bar progressing from right to left over yellow in the left most portion of the overall progress bar just beneth the words "Refresh in".
I tried rebooting the server and launching the upgrade again as well but experienced the same result.

Desktop (please complete the following information):
Server is Ubuntu 18.04.1.
Desktop where I logged in to launch the upgrade is Windows 10 1909. I tried in Internet Explorer 11.657.18362.0 and Firefox 72.0.2 (64bit).

@netniV netniV self-assigned this Feb 24, 2020
@netniV netniV added the installer Installation issue label Feb 24, 2020
@netniV
Copy link
Member

netniV commented Feb 25, 2020

when I saw this last night on my phone, I suspected that this may be an installer problem, but actually you have your CLI memory limit set to 2 MB? That is way too small. In fact, it shouldn't have got past the recommendations page with a memory limit that small so I will have to do a test on that.

But we should probably add a check to the background installer to make sure about the memory limit before it attempts to do anything and flag it as a problem if so without attempting an update.

@blowrancebenton
Copy link
Author

you have your CLI memory limit set to 2 MB

My php cli memory limit is set to 5GB so I'm not sure why it would only be allowing 2MB to be used:

cat /etc/php/7.2/cli/php.ini | grep memory_limit
memory_limit = 5120MB

@blowrancebenton
Copy link
Author

Your reply did help me find that I had the cli php.ini memory_limit set to 5120MB instead of 5120M so I suppose it defaulted to 2 MB instead. I adjusted this in the cli/php.ini file, restarted apache2 and the installation proceeded as usual.

@netniV
Copy link
Member

netniV commented Feb 25, 2020

Good to know, I'll close this once I apply a patch to report and fail if the memory limit is below a certain value. However, still confused how you got past the recommendations page so I'll have to test that too.

@netniV netniV closed this as completed Feb 25, 2020
@netniV netniV reopened this Feb 25, 2020
@netniV netniV added this to the 1.2.10 milestone Feb 25, 2020
@netniV netniV added the bug Undesired behaviour label Feb 28, 2020
@netniV netniV modified the milestones: 1.2.10, 1.2.11 Mar 1, 2020
TheWitness added a commit that referenced this issue Mar 14, 2020
Upgrade from 1.2.5 to 1.2.9 not completing / memory exhaustion
@TheWitness TheWitness added the resolved A fixed issue label Mar 14, 2020
@TheWitness
Copy link
Member

Fixed.

@netniV netniV changed the title Upgrade from 1.2.5 to 1.2.9 not completing / memory exhaustion Bad PHP memory limit values can result in failed upgrades Apr 5, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour installer Installation issue resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants