Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

Environment:
  • Debian Bullseye
  • Apache v2.4.46
  • PHP v8.0.3
  • MariaDB v10.5.9
When opening the user logs in ACP, I get a 500 server error and a related PHP error:

Code: Select all

PHP Fatal error: Uncaught Error: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php:698
Stack trace:
#0 /var/www/phpbb/phpbb/log/log.php(698): call_user_func_array()
#1 /var/www/phpbb/includes/functions_admin.php(2620): phpbb\\log
log->get_logs()
#2 /var/www/phpbb/includes/acp/acp_logs.php(132): view_log()
#3 /var/www/phpbb/includes/functions_module.php(676): acp_logs->main()
#4 /var/www/phpbb/adm/index.php(81): p_master->load_active()
#5 {main}
thrown in /var/www/phpbb/phpbb/log/log.php on line 698
I'm not sure when exactly this appeared, probably with one of the latest PHP8 patch versions. I couldn't fine a definite bug in the code either. It's assured that the log_data field exists: https://github.com/phpbb/phpbb/blob/mas ... g.php#L668
Adding another isset() does not help. I assured that caches were cleared. Probably it's also a bug in PHP, but you guys might have better insights and ideas how do debug.

Only user logs are affected, moderator, admin and errors logs show up well. Maybe also the size is relevant? MariaDB and the webserver do not throw further errors.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by GanstaZ »

Is it happening on vanilla phpBB (no extensions or custom code)?
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by thecoalman »

You can file bug reports here: http://tracker.phpbb.com/



There is a bug in mariaDB 10.4.9 10.5.9 and possibly other newer versions that can affect phpBB, may not be related to yours.

https://jira.mariadb.org/browse/MDEV-24953
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by 3Di »

The OP already filed an issue here https://tracker.phpbb.com/browse/PHPBB3-16729 then also posted here in the forums.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

The issue appears without any custom code, but I haven't tested it with disabling all plugins. Will do that tonight when lower traffic permits a temporary feature outage. Our plugin list:
  • Ban Hammer 1.0.8
  • CloudFlare IP 2.0.0
  • Delete My Account 1.0.1
  • SEO Metadata 1.4.0
  • SEO Sitemap 1.0.3
  • Simple mentions 1.0.5
  • Stop Forum Spam 1.4.0
  • Topic Solved 2.3.0
  • [d63] Auto database backup 3.1.0-RC1
I hope the double post here and on the tracker is fine. After posting it on the tracker I realised that this one fits better here first. I'll keep both posts updated with news from the other one ;).

Thanks for linking the MariaDB bug. I applied the possible workaround and set the new optimizer_max_sel_arg_weight variable to 12000 (lower than 16000). Not sure whether setting the global variable applies immediately to the running webserver/php-fpm sessions, but it didn't fix the log issue for now. Will do a daemon restart tonight and test it again.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by david63 »

It may be that the problem is associated with bad/corrupt data in one, or more, of the entries in the log table and it is being highlighted by using PHP8, which is a lot less forgiving than previous versions. I have had similar problems on my development board.

I doubt that disabling extensions will make any difference if the problem is already in the log table.

Two options that I would try are testing with PHP7 and/or emptying the log table.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

Since I cannot access user logs, I cannot clear those from the ACP either. It can be safely done from the MariaDB console while the instance is up, right?
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by stevemaury »

Rather than clearing the table, I would make a copy of it with a dsifferent name and then truncate the whole table. If that does not fix it, you can just drop the table and rename the copy.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

Code: Select all

delete from phpbb_log where log_type like '3';
allowed me to see the (now empty) user logs again. I'll see if the issue reappears or if it was indeed only a somehow malformed entry.

Many thanks for your help guys :)!
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

Until now, all works fine, but the user log didn't reach the previous size yet. Is there a point in keeping especially the tracker issue open, e.g. to check and in case handle stricter PHP8 parsing more gracefully, or shall I close it?
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

Okay, the issue re-appeared within the last 2 days. I start to believe that it has to do with the size or amount of log entries.

Code: Select all

select log_type from phpbb_log where log_type like '3';
...
101 rows in set
I deleted the last 6 log entries, so that there are 95 now, and the page is accessible again. With the last 5 deleted, it did not work. The 6th was quite unspectecular:

Code: Select all

|  27170 |        3 |       1 |        0 |        0 |       0 |        8958 | 2a00:23c8:XXXX:XXX:XXXX:XXXX:XXXX:XXXX  | 1618338927 | LOG_USER_ACTIVE_USER  |
Let's see if the next log breaks the page again.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by david63 »

95 rows in the log table should not be causing a problem. My board currently has almost 6.5k rows.

The one thing that I notice from your screenshot is that you have an IPv6 address in there - don't know if that is significant or not.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

There are many other logs with IPv6 addresses, so at least that does not cause the error in general.

I agree that the amount of logs should not cause issues, also we had much more entries before without issues. Probably it's the combination of PHP8 and that amount that triggers the issue somehow. I'll try to add fake entries to the database tomorrow, to see if I can trigger it, probably as well with error, admin and moderator logs.
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

Okay, 120 entries now, including many old and new ones with IPv6 addresses and I can still view them in the ACP. It's indeed not the row count and not the table size. Next time the issue re-appears I'll more carefully check every single log entry before removing it and clear all caches before going on with the next to be sure that the correct culprit is identified.

Now I recognised that log_data is one of the log table columns. That was empty on the row that I removed to fix the issue before, so that line should not have been processed. Probably a space character or such found it's way inside, or similar, at least I'll have a closer look that that column of new entry, when the issue re-appears.

Related code section: https://github.com/phpbb/phpbb/blob/mas ... #L668-L698
User avatar
MichaIng
Registered User
Posts: 17
Joined: Tue Aug 04, 2020 2:35 pm
Contact:

Re: Unknown named parameter $log_data in /var/www/phpbb/phpbb/log/log.php

Post by MichaIng »

Just to give an update: After the issue appeared the second time (as reported above), it didn't happen again since then, while the user log has grown again to nearly 300 entries. phpBB v3.3.4 was released in the meantime, which also polished PHP8.0 support a bit, so probably this also fixed the underlying issue of this error. So I don't see a need for further investigation, and, if any other users finds this thread: Try to update phpBB to the latest version 3.3.4 (or above).
Post Reply

Return to “[3.3.x] Support Forum”