Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

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
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

After recent forum upgrade 3.2->3.3.10 and the upgrade of php 7.2->8.2 the following warring started to pop up

Code: Select all

Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919
It is possible that the same error was generated previously (before upgrades), but somehow I didn't notice it before. Apparently the error was caused by some obsolete records in the database - I have no idea when the acl_options table lost the record with index 119, but somehow there were records with this index in the associated table: phpbb_acl_groups. So

Code: Select all

DELETE FROM `phpbb_acl_groups` WHERE `auth_option_id` = '119';
solved the problem for me.
Maybe it will help someone hitting the same problem.

By the way, there are many places in the source code which generate similar warnings Undefined array key.. For example missing translation keys or missing records in language files. This kinds of errors are quite hard to track down and debug. Any hints how to track them down? Server logs probably.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53609
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by Brf »

There should be 125 options in the phpbb_acl_options table, numbered from 1 through 125.
User avatar
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

Doesn't sound good. Unfortunately I see more gaps in this table.

Code: Select all

|            117 | u_masspm_group           |         1 |        0 |            0 |
|            121 | a_extensions             |         1 |        0 |            0 |
|            122 | u_chgprofileinfo         |         1 |        0 |            0 |
|            123 | f_softdelete             |         0 |        1 |            0 |
|            124 | m_softdelete             |         1 |        1 |            0 |
|            125 | m_pm_report              |         1 |        0 |            0 |
|            126 | f_announce_global        |         0 |        1 |            0 |
|            127 | f_list_topics            |         0 |        1 |            0 |
|            128 | u_viewtoplist            |         1 |        0 |            0 |
|            129 | m_thanks                 |         1 |        0 |            0 |
|            131 | u_rt_enable              |         1 |        0 |            0 |
|            133 | u_rt_sort_start_time     |         1 |        0 |            0 |
|            134 | u_rt_unread_only         |         1 |        0 |            0 |
|            135 | u_rt_location            |         1 |        0 |            0 |
|            136 | u_rt_view                |         1 |        0 |            0 |
|            137 | u_rt_number              |         1 |        0 |            0 |
|            168 | u_phpbb_ads              |         1 |        0 |            0 |
I don't think I ever touched this table. But this database is 15 years old (originated from punbb), so hard to say when they disappeared. I must check old backups.
User avatar
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

Ok. I see that on new installs the table is filled by

Code: Select all

install/schemas/schema_data.sql
lines 356-488 and auth_option_id is set to AUTO_INCREMENT
I see that the very beginning of these inserts

Code: Select all

INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_aauth', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_attach', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_authgroups', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_authusers', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_backup', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_ban', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_bbcode', 1);
do not agree with the content of my table

Code: Select all

|              1 | f_                       |         0 |        1 |            0 |
|              2 | f_announce               |         0 |        1 |            0 |
|              3 | f_attach                 |         0 |        1 |            0 |
|              4 | f_bbcode                 |         0 |        1 |            0 |
|              5 | f_bump                   |         0 |        1 |            0 |
|              6 | f_delete                 |         0 |        1 |            0 |
|              7 | f_download               |         0 |        1 |            0 |
|              8 | f_edit                   |         0 |        1 |            0 |
|              9 | f_email                  |         0 |        1 |            0 |
I wonder how these id's are linked to other tables in the database. I hope other tables are filled by use of auth_option and not by use of auth_option_id which seems to be rather a random number in this setting.
User avatar
warmweer
Jr. Extension Validator
Posts: 12094
Joined: Fri Jul 04, 2003 6:34 am
Location: somewhere in the space-time continuum

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by warmweer »

robboZ wrote: Mon Jul 24, 2023 8:44 pm I don't think I ever touched this table. But this database is 15 years old (originated from punbb), so hard to say when they disappeared. I must check old backups.
As far as I can see you've got missing entries and extra entries (extensions).
I suspect your _acl_options_ acl_roles,_acl_roles_data are also messed up.

Take a full database backup. You can truncate or leave out the search_tables (are these can be repopulated once the problem is solved). That's just to make sure that you can restore the current situation.
Then disable all extensions and delete data. (although you may want to try the actions below first and if that doesn't work the try again with disabled extensions (and data deleted).

Then try using an STK (for 3.3) and let it analyse the board to see what it comes up with.

If the STK can't fix it, you may have to revert to replacing those tables by original tables and then resetting the permissions for all users/groups (to be honest I can't remember ever having done that, so I'm not confident it won't break your board beyond repair : which is why you absolutely need a database backup before attempting this.)
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

Just to be sure, I run (on a copy of database) all 125 INSERTS from schema_data.sql and all 125 INSERTS gave error, which is very good, because it means that this table do not lack any of the default records. So, as I expected, the missing record with index 119 was a leftover from some old extension. And 119 is just a random number.

By the way, the forum works ok I don't see any problems with permissions.
User avatar
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

The simple checks for the cross reference between tables:

Code: Select all

SELECT * FROM phpbb_acl_groups WHERE auth_option_id NOT IN (SELECT auth_option_id FROM phpbb_acl_options); 
SELECT * FROM phpbb_acl_users WHERE auth_option_id NOT IN (SELECT auth_option_id FROM phpbb_acl_options); 
SELECT * FROM phpbb_acl_roles_data WHERE auth_option_id NOT IN (SELECT auth_option_id FROM phpbb_acl_options); 
The third one gives two records with index 118 and 119. I assume that these are also leftovers from old extensions. First two give some rows with auth_option_id=0 and nothing more. Which looks pretty ok for me.

Somehow I do not understand why you think that particular values of auth_option_id are important. Since this is AUTO_INCREMENT in the schema, you can not assume anything about the particular values of this column. It may be just random number.
User avatar
warmweer
Jr. Extension Validator
Posts: 12094
Joined: Fri Jul 04, 2003 6:34 am
Location: somewhere in the space-time continuum

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by warmweer »

robboZ wrote: Mon Jul 24, 2023 10:10 pm ...
Somehow I do not understand why you think that particular values of auth_option_id are important. Since this is AUTO_INCREMENT in the schema, you can not assume anything about the particular values of this column. It may be just random number.
Well, perhaps it's just me but would like to see exactly which entries are missing or have non-default_id's and link the three tables to see if everything is there (and yes, it wouldn't be the first time I did superfluous checks)
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
janus_zonstraal
Registered User
Posts: 6618
Joined: Sat Aug 30, 2014 1:30 pm

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by janus_zonstraal »

The third one gives two records with index 118 and 119. I assume that these are also leftovers from old extensions. First two give some rows with auth_option_id=0 and nothing more. Which looks pretty ok for me.
Same here on my 15 years old board, also no problems, so I guess it is normal
Sorry! My English is bat ;) !!!
User avatar
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

warmweer wrote: Mon Jul 24, 2023 11:17 pm Well, perhaps it's just me but would like to see exactly which entries are missing or have non-default_id's and link the three tables to see if everything is there (and yes, it wouldn't be the first time I did superfluous checks)
I thank you guys that you answered to this topic - because it forced me to dive deeper into the understanding of these tables and how they are created. If I had this knowledge before, I would've clean this mess before.
Just to sum up
  • I checked the phpbb_acl_options table and I have no missing entries - this was done by running 125 INSERT queries.
  • I checked cross reference with phpbb_acl_groups, phpbb_acl_users phpbb_acl_roles_data tables and I've found some more leftovers - but I will clean these up.
  • The way the table phpbb_acl_options is created implies that there is no such thing as default id. Even on a fresh install you can't assume that autoincrement will give you 125 consecutive numbers. Probably it will, but you can't assume that to be true. For databases with long history it's even more complicated - I assume that schema_data.sql changed over the years, so it is impossible to track down an id of any particular entry. You can only find it by name.
  • In my case I am not at all surprised that I have unusual pattern of id's in phpbb_acl_options. This database originated in punbb, then it was imported into early version of phpbb, and over 15 years for sure it was patched by different mod-s. In pre-extensions era there where installed and uninstalled by hand, so I am rather surprised that this database is working at all.
  • The whole story shows that php8 is great - in php7 these missing keys didn't rang a bell.
User avatar
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

warmweer wrote: Mon Jul 24, 2023 9:30 pm Then try using an STK (for 3.3) and let it analyse the board to see what it comes up with.
Does something like this exist? I see a fork for 3.2:
https://www.phpbb.com/customise/db/offi ... tk/support
but do not see any version compatible with 3.3.

I've checked this fork
https://github.com/AlexSheer/phpBB3.2-STK
and it doesn't work unfortunately ;(

Code: Select all

Fatal error: Uncaught Twig\Error\LoaderError: Unable to find template "cron.html" 
User avatar
cabot
Jr. Style Validator
Posts: 1005
Joined: Sat Jan 07, 2012 4:16 pm

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by cabot »

Hello,

This fork is up to date:
https://github.com/Tatiana5/phpBB3.2-STK
User avatar
warmweer
Jr. Extension Validator
Posts: 12094
Joined: Fri Jul 04, 2003 6:34 am
Location: somewhere in the space-time continuum

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by warmweer »

robboZ wrote: Tue Jul 25, 2023 6:32 am Does something like this exist? I see a fork for 3.2:
https://www.phpbb.com/customise/db/offi ... tk/support
but do not see any version compatible with 3.3.
Unfortunately there is no official STK for phpBB versions later than 3.0.14
robboZ wrote: Tue Jul 25, 2023 6:32 am I've checked this fork
https://github.com/AlexSheer/phpBB3.2-STK
and it doesn't work unfortunately ;(

Code: Select all

Fatal error: Uncaught Twig\Error\LoaderError: Unable to find template "cron.html" 
The problem is that you need the correct version of the STK suited for the phpBB version and it's not always easy to find.

for 3.3.10 you need v 1.0.19-dev (https://forums.caforum.fr/viewtopic.php?p=5254#p5254) >>> I used this one and it works
(which needed a couple of edits when originally "released" but I see these have been implemented)

https://forums.caforum.fr/viewtopic.php?p=5384#p5384 (Haven't used this one but I trust it)

Anyway: BEFORE using it: what do you have to do? ... Correct ;-) take a database backup (preferably even a full backup)
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
robboZ
Registered User
Posts: 27
Joined: Fri May 07, 2010 7:53 am

Re: Undefined array key 119 in file [ROOT]/phpbb/auth/auth.php on line 919

Post by robboZ »

Thank you very much!
This fork
https://github.com/Tatiana5/phpBB3.2-STK
does work. There is an option there
Support tools/Remove orphaned permissions
and this does exactly what is described in this topic, that is it removes all entries in ACL_GROUPS_TABLE and ACL_USERS_TABLE which does not have corresponding record in the ACL_OPTIONS_TABLE and have id>0. The source code is here
https://github.com/Tatiana5/phpBB3.2-ST ... ssions.php
It does not remove the orphaned permissions in phpbb_acl_roles_data, so I think I will remove these entries manually.

I am not brave enough to use other options from stk - but its source code is a great source of inspirations.

Return to “[3.3.x] Support Forum”