• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Out of memory fatal error upgrading to 1.2.1

Stuart Wright

Well-known member
#1
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 83 bytes) in /home/sites/xf.avforums.com/public_html/sandbox/library/Zend/Db/Statement/Mysqli.php on line 304

This was when rebuilding the master data. I've emailed the problem to our host. Thought I'd let you know as the amount of memory available has been fine for the rest of our testing on this sandbox server.

[Edit: reply from Tim @ Nimbus:
It shows it's used more than 1GB of memory. That sounds like a memory leak. You can increase it in the config.php file but that might not fix your problem.]
 
Last edited:

Brogan

XenForo moderator
Staff member
#2
From the FAQ:

I am receiving a fatal error related to allowed memory size when performing certain functions, how can I increase or remove the limit?
To increase the limit, edit the library/config.php file and add the following:
PHP:
ini_set('memory_limit', 256 * 1024 * 1024);
Change the value (in megabytes) to suit. To remove the limit set the value to -1.

Rebuilding is an intensive process.
Do you have a lot of add-ons/styles/user groups/permission sets?
 

Stuart Wright

Well-known member
#3
Thanks Brogan.
39 addons, 3 styles, 19 usergroups.
256 * 1024 * 1024 wasn't enough.
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in /home/sites/xf.avforums.com/public_html/sandbox/library/Zend/Db/Statement/Mysqli.php on line 304

What should I try next?
 

Mike

XenForo developer
Staff member
#5
Make sure that you actually have the new files in place correctly. In 1.2.0, there was a possibility of queries being logged which can trigger issues. This should have been resolved in 1.2.1 though, so it shouldn't be using that much memory.
 

Stuart Wright

Well-known member
#7
I reuploaded the files and hit the back button on the master rebuild bowser instance with the above error. It happened again.
So I tried to install the upgrade again and it said it couldn't and I should delete the upgrade lock file.
Which I did.
Now when I try to do the install, it wants to do a fresh one.
I can't uninstall the upgrade lock file and I can't upgrade without clearing the data.
The forum loads, but I'm guessing I need to run the master rebuild?
So what now?
 

Mike

XenForo developer
Staff member
#8
So I tried to install the upgrade again and it said it couldn't and I should delete the upgrade lock file.
That error would've said that if you wanted to do a fresh install, you need to delete that file. You should just recreate internal_data/install-lock.php.

If you submit a ticket with FTP (or similar) and admin CP access, I can look at it.
 

Mike

XenForo developer
Staff member
#11
This is what I discovered:
This wasn't actually happening during the rebuild. It appears to be happening as the upgrade is completed. It appears to be triggered from a deferred task, likely a cron entry. Now, I'd already stopped running the cron entries on upgrade completion already for 1.2.2 because we've run into a few problems with add-on crons, though not this error specifically. I'm not sure why this was happening or even what was triggering it -- unfortunately, memory issues in PHP are nearly impossible to debug (especially in this case, where the error simply relates to a query that's being run). I'd have to guess one of the add-on cron entries, but it's hard to really say with particularity.