Captcha errors [SOLVED]

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Captcha errors [SOLVED]

Post by lochness »

I am trying to finetune the new server and when I went into the error log, besides the attempts to reach non existing pages, I have found the following
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16777224 bytes) in /WEB/public_html/board/phpbb/captcha/plugins/qa.php on line 310

Users are also reporting widespread requesting of captcha regardless of remember me setting and correctedness of password at first loging attempt (and the database shows o attempted logins).

The board is still vanilla 3.2.5, except for two spanish language packs and a style, all downloaded from this site, with the database converted directly from 3.0.1x through CLI.

This is not the only problem I can see in the error log, but it's the one most annoying to my users. Other errors are related to (include_path='.:/usr/share/php'), but those haven't shown today.

Update 04/03/2020. Captcha error has disappeared after applying fix by x-rated in this post viewtopic.php?p=14992436#p14992436
Last edited by lochness on Wed Mar 04, 2020 10:02 am, edited 4 times in total.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Captcha errors

Post by Mick »

Assuming you're running your own server - PHP (not phpBB) needs more memory allocating, it's run out of memory - it's at 128 MB at present. If you Google the error message or look in your PHP manual there's more information. If that doesn't help please fill out the Support Request Template and post it back here to enable us to assist you better.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Re: Captcha errors

Post by lochness »

Support Request Template
What version of phpBB are you using? phpBB 3.2.5
What is your board's URL? www.abretelibro.com/foro
Who do you host your board with? VPS
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? Yes
Do you have any MODs installed? No
Do you have any extensions installed? No
What version of phpBB3 did you update from? phpBB 3.0.12
What styles do you currently have installed? Prosilver and AllanStyle-SUBSILVER
What language(s) is your board currently using? Englush and Spanish formal and informal
Which database type/version are you using? MySQL 5
What is your level of experience? New to PHP but not phpBB
What username can be used to view this issue? prueba
What password can be used to view this issue? prueba Q&A answer is prueba
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? I run the update database from the command line after it failed to complete from the control panel. I described the process here viewtopic.php?f=556&t=2503256
Please describe your problem. Captcha is being requested at first attempt login, sometimes regardless of remember me setting (and the database shows 0 attempted logins).

When looking into php log, I get a PHP Fatal error: Allowed memory size of 155189248 bytes exhausted (tried to allocate 33554440 bytes) in /WEB/public_html/foro/phpbb/captcha/plugins/qa.php on line 310, referer: http://www.abretelibro.com/foro/xxx
I've previously increased this
Generated by SRT Generator
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Re: Captcha errors

Post by lochness »

Nobody has any idea on how to solve this?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Captcha errors

Post by Mick »

Personally no but it seems like a server issue to me, have you interrogated the server error logs? What else have you done to try and get to the bottom of this?
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Captcha errors

Post by EA117 »

lochness wrote: Mon Feb 25, 2019 6:43 pm Nobody has any idea on how to solve this?
I definitely do not know how to solve this. What I can say is that the line number referenced is a loop in the garbage_collect routine of qa.php, which is building an array of items it will issue an SQL DELETE operation on to dispose of the now-unneeded data. So to hit the memory limit on that line implies that either this garbage collection is encountering an unusually huge number of items that need to be disposed of, or, there is some kind of corrupt or malicious single item that is singularly huge.

I'm not a user of the Q&A captcha, nor am I someone who knows what kind of data is expected to be seen "behind the scenes" in its related tables. So I can't say which scenario is most likely, or what corrective action is actually the correct & smart action to take to manually perform a one-time "disposal" of the data this garbage collection routine is having a hard time successfully processing. Hopefully someone who has actual experience in these areas can contribute.

If it was happening on my board and I had received no more definitive input, what I can tell is that the issue is with data being purged from the captcha-specific "phpbb_confirm" table. (Substitute your own correct table prefix there, instead of "phpbb_".)

After making a good backup of my board's database, I would try simply using phpMyAdmin (or whatever your database editor is) to delete all the rows out of the "phpbb_confirm" table. Not deleting or dopping the entire table; just making the table "empty" of all rows. And then wait to see if the same issue ever recurs again, once the phpbb_confirm table becomes repopulated through normal use, and the garbage_collect routine again attempts to purge unused data.

That might be really bad and unsafe advice, and you should wait for something better. But its what I would try in absence of better information if it was happening on my own board. And if it didn't help, restore the database regardless, even if everything still seemed fine otherwise.

Here's hoping you get a more definitive answer! 😃
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Re: Captcha errors

Post by lochness »

EA117 wrote: Mon Feb 25, 2019 10:27 pm
lochness wrote: Mon Feb 25, 2019 6:43 pm Nobody has any idea on how to solve this?
I definitely do not know how to solve this. What I can say is that the line number referenced is a loop in the garbage_collect routine of qa.php, which is building an array of items it will issue an SQL DELETE operation on to dispose of the now-unneeded data. So to hit the memory limit on that line implies that either this garbage collection is encountering an unusually huge number of items that need to be disposed of, or, there is some kind of corrupt or malicious single item that is singularly huge.
Then it looks like it's definitely related to be the garbage collector. I'm also looking into an issue with the server (a tmp folder getting lots of 11Mb files each day (totalling more than 8-12 Gb/d)) and my reasearch found that I'm not the only one having this problem with the latest Vesta CP, so after your message and looking at the times those 11 Mb files appeared. I stopped most cron jobs there and the identification is apparently working now as it should, but I still need to check if both things are related or it is working now by chance.
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Captcha errors

Post by EA117 »

lochness wrote: Tue Feb 26, 2019 1:10 pm Then it looks like it's definitely related to be the garbage collector.
The array qa.php is building at that line is a list of "confirm_id" values (32-character string each). So when seeing the description of "tried to allocate 33554440 bytes" (32MB), it just makes me think "that would be room for a whole lot of 32-character strings." (At least half a million of them.) Which is what made it seem like there could be some kind of data issue instead -- making the array or at least one of the array items larger than it should be -- leading to a memory allocation attempt that exceeds what was intended or expected.

Increasing the server memory definitely would address or absorb that short-term memory allocation need, too. I'm just questioning whether an allocation of that size for that purpose was really supposed to be happening.

The temp file issue might be related, but just as easily could be a different issue or some other process your hosting service has running and is leaking temp files. I've got an issue on our right now where the automated backup leaks multiple 500MB to 5GB files before finally creating a successful backup. So you might just ask your hosting service about those, in case they've already seen the issue in other customer accounts.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Captcha errors

Post by Brf »

EA117 wrote: Tue Feb 26, 2019 3:49 pm Increasing the server memory definitely would address or absorb that short-term memory allocation need,
The problem is the allowed memory for PHP. We have been seeing more of these problems as characters have been expanded to use more bits in recent years.
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Captcha errors

Post by EA117 »

Brf wrote: Tue Feb 26, 2019 3:53 pm The problem is the allowed memory for PHP. We have been seeing more of these problems as characters have been expanded to use more bits in recent years.
Thanks for the correction... an important distinction that I was ignoring, and a point that Mick had also made but flew right over my head. ("Allowed PHP memory" versus "available server memory.")

@lochness, your SRT ends with "I've previously increased this", but the error messages you've included here anyway still show at most a 148MB limit in effect. Do you have 512MB or 1GB or more of server memory to where you could try just doubling the limit to 256MB, at least temporarily? To see if this is a short-term issue that dies out once the janitor can allocate the list and purge the entries, versus whether it recurs as a continuing problem.

Again, not that I'm in any way familiar on Q&A internal design. But if there were millions of entries that needed purged from that table -- if something isn't just wrong or corrupt in the data -- would at least make me suspect "someone must be pounding this Q&A." It doesn't seem reasonable that millions of entries would be somehow "normal."
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Re: Captcha errors

Post by lochness »

The error came back again yesterday afternoon, after I had to recreate the database user because deleting another database Vesta deleted the user as well. The new user has the same name but a new password.

I've checked the timestamp in the error log and it reoccurs every 1:03 h or so.
[Wed Feb 27 08:06:01.177578 2019] [php7:error] [pid 25458] [client 139.162.218.82:36484] PHP Fatal error: Allowed memory size of 163577856 bytes exhausted (tried to allocate 33554440 bytes) in PATH/public_html/foro/phpbb/captcha/plugins/qa.php on line 310, referer: http://www.abretelibro.com/foro/search.php?

And this error was still showing while there was no problem with the CAPTCHA.
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: Captcha errors

Post by </Solidjeuh> »

Allowed memory size. Increase that in php.ini, or ask you host.
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Re: Captcha errors

Post by lochness »

Just to set this straight, if the captcha works correctly for my users, I don't mind that error showing in the log

These are the time the error logs appearead and disappeard yesterday
[Tue Feb 26 09:05:28.819651 2019]
Did a repair post tables here captcha started working properly
[Tue Feb 26 11:55:39.069273 2019]
[Tue Feb 26 12:57:51.253057 2019]
[Tue Feb 26 14:03:34.292380 2019]
[Tue Feb 26 15:07:08.799803 2019]
Created database user captcha stopped working properly
[Tue Feb 26 16:13:23.224667 2019]
[Tue Feb 26 17:14:41.790182 2019]
[Tue Feb 26 18:18:56.733519 2019]
[Tue Feb 26 19:20:53.252541 2019
[Tue Feb 26 20:23:34.073247 2019
[Tue Feb 26 21:25:40.928390 2019
[Tue Feb 26 22:29:28.753417 2019
[Tue Feb 26 23:31:47.246984 2019
[Wed Feb 27 00:31:57.695391 2019
[Wed Feb 27 01:42:24.801133 2019
[Wed Feb 27 02:43:12.194091 2019
[Wed Feb 27 03:47:20.333173 2019
[Wed Feb 27 04:54:28.471125 2019
[Wed Feb 27 06:00:38.679107 2019
[Wed Feb 27 07:01:55.984334 2019
[Wed Feb 27 08:06:01.177578 2019

The post table comes from a migration from 3.0. Apparently the tables originating from 3.0 backup restoration can be optimized while those that have been created during 3.2 database update cannot.
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Re: Captcha errors

Post by lochness »

I did run a mysql -autorepair -c and it looks like the captcha is working again.
lochness
Registered User
Posts: 96
Joined: Tue Aug 07, 2007 12:04 pm

Re: Captcha errors

Post by lochness »

Still getting errors with the captcha. At one moment it said it needed allocating only 4096 bytes, but after that increase, it's gone back to asking for > 60 Mb. Allocated memory is right now 256 Mb.

And I can't run a repair database each night to have it temporarily working.

PS The error log also shows an error on after I tried to switch to simple image captcha

Code: Select all

/phpbb/db/driver/driver.php on line 573
Post Reply

Return to “[3.2.x] Support Forum”