3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
wokka
Registered User
Posts: 6
Joined: Sat Sep 10, 2022 5:25 pm

3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by wokka »

Support Request Template
What version of phpBB are you using? phpBB 3.2.0
What is your board's URL? No answer given
Who do you host your board with? self hosted
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? No
Do you have any MODs installed? No
Do you have any extensions installed? No
What version of phpBB3 did you update from? phpBB 3.2.0
What styles do you currently have installed? None
What language(s) is your board currently using? en-gb
Which database type/version are you using? MariaDB
What is your level of experience? Comfortable with PHP and phpBB
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? updating board from 3.2 to 3.3
Please describe your problem. Built a new VM to modernize the system, ubuntu 22.04, latest php8 and mariadb available in packages. Moved database over to maria for phpbb3 and copied the web directory over to the new machine.

I followed the upgrade guide for 3.2 to 3.3 by removing the appropriate directories and copying mine over onto it and tried to run the database update from the CLI.

I'm getting a php fatal error when running the update.

Code: Select all

root@spider:/var/www/escape/phpBB3# php ./bin/phpbbcli.php db:migrate --safe-mode
PHP Fatal error: Uncaught Error: mysqli object is not fully initialized in /var/www/escape/phpBB3/phpbb/db/driver/mysqli.php:200
Stack trace:
#0 /var/www/escape/phpBB3/phpbb/db/driver/mysqli.php(200): mysqli_query()
#1 /var/www/escape/phpBB3/phpbb/db/driver/factory.php(345): phpbb\db\driver\mysqli->sql_query()
#2 /var/www/escape/phpBB3/phpbb/config/db.php(86): phpbb\db\driver\factory->sql_query()
#3 /var/www/escape/phpBB3/phpbb/config/db.php(55): phpbb\config\db->initialise()
#4 [internal function]: phpbb\config\db->__construct()
#5 /var/www/escape/phpBB3/vendor/symfony/dependency-injection/ContainerBuilder.php(1176): ReflectionClass->newInstanceArgs()
#6 /var/www/escape/phpBB3/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService()
#7 /var/www/escape/phpBB3/vendor/symfony/dependency-injection/ContainerBuilder.php(1281): Symfony\Component\DependencyInjection\ContainerBuilder->doGet()
#8 /var/www/escape/phpBB3/vendor/symfony/dependency-injection/ContainerBuilder.php(1238): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices()
#9 /var/www/escape/phpBB3/vendor/symfony/dependency-injection/ContainerBuilder.php(1149): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices()
#10 /var/www/escape/phpBB3/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService()
#11 /var/www/escape/phpBB3/vendor/symfony/dependency-injection/ContainerBuilder.php(588): Symfony\Component\DependencyInjection\ContainerBuilder->doGet()
#12 /var/www/escape/phpBB3/includes/compatibility_globals.php(45): Symfony\Component\DependencyInjection\ContainerBuilder->get()
#13 /var/www/escape/phpBB3/bin/phpbbcli.php(72): register_compatibility_globals()
#14 {main}
thrown in /var/www/escape/phpBB3/phpbb/db/driver/mysqli.php on line 200
To test, I installed a fresh version of phpBB3 on the new server and it installed fine, all pre-reqs worked and forum was good, so I know the system fills the requirements, just the database update script breaks.

Any help would be appreciated
Generated by SRT Generator
Last edited by Mick on Sat Sep 17, 2022 6:57 am, edited 1 time in total.
Reason: Solved.
User avatar
GanstaZ
Registered User
Posts: 1221
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by GanstaZ »

Maybe conflict is in database module. I did full dev server update today & saw similar issue when i changed to latest mysql version.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by MarkDHamill »

Based on the error message, it appears to be triggered on a query of your phpbb_config table. Browsing the table and looking for rows that look off might identify the problem.

The table should have a primary key based on config_name. I have seen situations with clients where this was missing leading to duplicate keys. In this case this SQL should point these out:

Code: Select all

SELECT config_name, count(*) as name_count FROM `phpbb_config` GROUP BY config_name HAVING name_count > 1; 
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
wokka
Registered User
Posts: 6
Joined: Sat Sep 10, 2022 5:25 pm

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by wokka »

Thanks for the help, I'm out of my depth here within the database for the forum. That query came back with an empty set. Looking through that table, it looks like all of my config is there and to me, looks normal.
wokka
Registered User
Posts: 6
Joined: Sat Sep 10, 2022 5:25 pm

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by wokka »

GanstaZ wrote: Sat Sep 10, 2022 6:21 pm Maybe conflict is in database module. I did full dev server update today & saw similar issue when i changed to latest mysql version.
Did you downgrade sql to resolve it?

I'm still stuck not being able to upgrade the forum.
User avatar
GanstaZ
Registered User
Posts: 1221
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by GanstaZ »

wokka wrote: Thu Sep 15, 2022 2:12 pm Did you downgrade sql to resolve it?
Yes i downgraded it to the one i had before & it solved my problem.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
wokka
Registered User
Posts: 6
Joined: Sat Sep 10, 2022 5:25 pm

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by wokka »

GanstaZ wrote: Thu Sep 15, 2022 2:37 pm Yes i downgraded it to the one i had before & it solved my problem.
Gotcha, thanks for the info.

This is a fresh build of ubuntu 22.04 with maria, so off to do some research on how to downgrade it.

Any devs around that could speak to why the latest sql would cause this?
User avatar
GanstaZ
Registered User
Posts: 1221
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by GanstaZ »

As I said in my first post.. I'm not sure, if you are experiencing the same issue that i had.
It's always good to have a development/testing environment locally.. At least it helps out to get answers faster & often solves/prevents a lot of issues.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
wokka
Registered User
Posts: 6
Joined: Sat Sep 10, 2022 5:25 pm

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by wokka »

This is pretty much my test system. My production bb is still on the old server and running. I copied over the data/db to the new box to test with.

I'll see what it takes to install an older version of maria on 22.04 and see.
wokka
Registered User
Posts: 6
Joined: Sat Sep 10, 2022 5:25 pm

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by wokka »

Mariadb 10.3 does indeed work fine with the phpbb database upgrade script. Thanks for the help everyone
User avatar
serek
Registered User
Posts: 82
Joined: Fri Jan 30, 2015 12:47 pm
Location: London
Name: Serge Victor

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by serek »

I have just realised this error comes when username/password/server to database in config.php is simply incorrect.
--
find me somewhere in SW London, 100 meters from Thames River
neufke
Registered User
Posts: 46
Joined: Thu Jun 05, 2014 7:12 pm

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by neufke »

I know it's an old topic but i thought it could be helpful for someone.

After updating xampp to 8.2 i forgot to copy the mysql data to the new xampp data directory so while everything was in order (all paths were correct, login was correct AND username/pass of the db was correct, the database (physical files) itself weren't available. I got the exact same error and it took me an hour to figure it out.

Hope this helps anyone. ;-)

PS: running 3.3.11 now...
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: 3.2.0 database upgrade to 3.3.8 errors out with php fatal error

Post by MarkDHamill »

neufke wrote: Mon Nov 13, 2023 1:13 pm I know it's an old topic but i thought it could be helpful for someone.

After updating xampp to 8.2 i forgot to copy the mysql data to the new xampp data directory so while everything was in order (all paths were correct, login was correct AND username/pass of the db was correct, the database (physical files) itself weren't available. I got the exact same error and it took me an hour to figure it out.

Hope this helps anyone. ;-)

PS: running 3.3.11 now...
So the issue was that expected files in the /store/phpbbservices/digests folder used to testing were not copied with the rehosting. I appreciate the time you invested in this to find the solution. I'll add it to the rehosting FAQ. Excellent work!
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.

Return to “[3.3.x] Support Forum”