Page 1 of 1

phpBB Update on Synology fails due to MariaDB database error

Posted: Tue Oct 03, 2017 2:43 pm
by HansM2013
Hi all,

I'm having the following problem:

My Synology DS216SE doesn't want to install phpBB after I updated MariaDB from version 5 to 10.
The problem here is that strangly phpBB seems to find my MariaDB 5 installation (which is not installed anymore) and wants to import data from it to MariaDB 10. This operation fails, of course.
1.PNG
2.PNG
3.PNG
4.PNG
5.PNG
6.PNG
My NAS has the following configuration:
phpBB version: 3.2.0-0122.
Synology DSM version: DSM 6.1.3-15152 Update 6
Processor: MARVELL Armada 370 88F6707
Processor rate: 800 MHz

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Tue Oct 03, 2017 4:52 pm
by VeganFanatic
I suggest before a big update that you make a backup of the forum contents, just in case...

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Tue Oct 03, 2017 9:13 pm
by Ralphort
Makes sure on Syno Web Station you type localhost as hostname instead of your site url on Virtual Host. Uninstall & reinstall both phpMyAdmin & MariaDB10. Had the same problem before with MariaDB5 but it's mainly because of the site url instead of localhost I've used as my hostname.

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Thu Oct 05, 2017 10:55 am
by HansM2013
I suggest before a big update that you make a backup of the forum contents, just in case...
I've already done that.
Uninstall & reinstall both phpMyAdmin & MariaDB10.
This didn't work as well but I can try again...

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Thu Oct 05, 2017 3:22 pm
by Ralphort
Also try to reset Syno's network setting by pressing the reset button on back of the NAS for about 4 sec until you hear a beep. Do it once only or you'll end up restoring your NAS to its factory setting. After uninstalling both PhpMyAdmin & MariaDB remove any remaining MariaDB files left. You can use WinSCP to access your DiskStation using SCP file protocol (make sure to temporarily enable telnet & SSH services first) & remove those MariaDB files that not totally deleted after uninstalling. Restart your NAS then begin the install process.

Don't use FTP file protocol 'cause you won't be able to see those remaining MariaDB files that were not deleted. Pay particular attention on Virtual Server. If you don't wanna miss around with it, just make sure there's no virtual server created.

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Sun Oct 08, 2017 12:58 pm
by HansM2013
After uninstalling both PhpMyAdmin & MariaDB remove any remaining MariaDB files left. You can use WinSCP to access your DiskStation using SCP file protocol (make sure to temporarily enable telnet & SSH services first) & remove those MariaDB files that not totally deleted after uninstalling. Restart your NAS then begin the install process.
Do you by any chance know where these files are located? I think, I've already deleted them but maybe I didn't find all of them...

I don't find any MariaDB5 files on the NAS:
NASFiles.PNG

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Mon Jan 08, 2018 9:17 am
by HansM2013
The issue is still not resolved.

What I did so far:
  1. Uninstalling and reinstalling MariaDB, phpBB and phpMyAdmin several times
  2. Complete factory reset of the OS: https://forum.synology.com/enu/viewtopic.php?t=59612
  3. Deleted all MariaDB5 files first, deleted all MariaDB10 afterwards, too. (MariaDB5 files were only located in /usr/libexec/ and usr/local/libexec) --> I searched them via SSH and

    Code: Select all

    find -name *maria*
  4. Set the ports in the php settings according to the post here: https://forum.synology.com/enu/viewtopi ... 37#p490892
  5. I'm not using virtual hosts either and my NAS is only running locally, so no port forwarding to the internet --> My hostname/ url is set to localhost in the settings --> See suggestion of Ralport: posting.php?mode=reply&f=556&t=2441286#pr14840386
Actually, nothing worked for me. I'm getting the same error messages again.
Seems like the only working option is to install MariaDB10 and phpMyAdmin from the Synology packages and phpBB manually from the packages provided (Including manual configuration).

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Tue Jan 09, 2018 9:17 pm
by HansM2013
I guess I will stop to use phpBB. Even an install from the phpBB official zip packages crashes with an 404 error when clicking on the install button on the app.php... :D And the support is not so good as with other software.

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Tue Jan 09, 2018 9:26 pm
by HansM2013
This problem could be resolved by removing all occurences of NeedMigrateDB:

Code: Select all

NeedMigrateDB()
{
	local version="$1"
	if [ -z "$version" ] || [ "$version" -le "$MIGRATE_DB_VERSION" ]; then
		return 0
	fi
	return 1
}
And all the checks, e.g.:

Code: Select all

if NeedMigrateDB "$version"; then # check if needing to migrate MariaDB 5
The problem is: I don't know how to recompile the *.spk file from https://archive.synology.com/download/P ... spk/phpBB/ to not get the error "Invalid file structure" when trying to install the modigied package manually over the package center.


If there is any other option to tell the installer not to check for MariaDB5 (as it's not installed), please let me know. :)

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Wed Jan 10, 2018 8:15 pm
by HansM2013
I've now found out how to customize Synology packages from the links:
https://forum.synology.com/enu/viewtopic.php?t=85983
https://forum.synology.com/enu/viewtopic.php?t=10575
https://amigotechnotes.wordpress.com/20 ... your-lamp/

Github repository is here:
https://github.com/SeppPenner/PhpBBFixMariaDB5Issue

The problem is: It again doesn't work...

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Wed Jan 10, 2018 9:15 pm
by Marc
It's kind of difficult for us to support any special type of package.

phpBB itself will always try to connect to the database that it's offered. If you upgrade to MariaDB 10 and phpBB is trying to connect to MariaDB 5, then the Synology package is passing the MariaDB 5 settings to it.

If you upload the phpBB full package and get a 404 on install/app.php, then the package was not fully updated. The package contains install/app.php so it'll take the magic of "not uploading all files in the package" to get a 404 on that one (or a different configuration problem relating to Synology for that matter).

Re: phpBB Update on Synology fails due to MariaDB database error

Posted: Thu Jan 11, 2018 10:35 am
by HansM2013
I finally found a solution:

1. Install both database versions (MariaDB 5 and 10).
2. Import the whole mysql dump from before.
3. Add the same users (root) to both database versions.
4. Install phpBB on Synology package center with the passwords and a user for phpBB with some password.
5. I got an error: Database already exists" --> Dropped database for phpBB in MariaDB10.
5. Install was successful.
6. Uninstalled MariaDB5.
7. The board works again but posting is not possible. (There are some forum posts on this issue already and I will try to find a solution for this, too.)