CANNOT_REMOVE_MODULE error while upgrading from 3.1.4

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
na_th_an
Registered User
Posts: 3
Joined: Tue Mar 11, 2025 11:06 am

CANNOT_REMOVE_MODULE error while upgrading from 3.1.4

Post by na_th_an »

Hello.

My server was upgraded to PHP 7.4 and MySQL 5.7 recently so we've decided to upgrade from 3.1 to the lastes PHPBB 3.3

I've followed the guide at https://www.phpbb.com/support/docs/en/3 ... upgrade31/ to upgrade our forum. I've reverted the forum to British English, disabled the custom theme, and made sure no extensions were added (our forum was mostly vanilla save for the theme).

I've started the database upgrade but it stops at 46% and shows CANNOT_REMOVE_MODULE. The window below shows this contents:

Code: Select all

Installing Data: \phpbb\db\migration\data\v320\add_help_phpbb.
Installed Schema: \phpbb\db\migration\data\v320\add_help_phpbb; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\add_help_phpbb.
Installed Data: \phpbb\db\migration\data\v320\v320rc1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\v320rc1.
Installed Schema: \phpbb\db\migration\data\v320\v320rc1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\v320rc1.
Installed Data: \phpbb\db\migration\data\v320\v320b2; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\v320b2.
Installed Schema: \phpbb\db\migration\data\v320\v320b2; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\v320b2.
Installed Data: \phpbb\db\migration\data\v320\remote_upload_validation; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\remote_upload_validation.
Installed Schema: \phpbb\db\migration\data\v320\remote_upload_validation; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\remote_upload_validation.
Installed Data: \phpbb\db\migration\data\v320\v320b1; Time: 0.01 seconds
Installing Data: \phpbb\db\migration\data\v320\v320b1.
Installed Schema: \phpbb\db\migration\data\v320\v320b1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\v320b1.
Installed Data: \phpbb\db\migration\data\v320\report_id_auto_increment; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\report_id_auto_increment.
Installed Schema: \phpbb\db\migration\data\v320\report_id_auto_increment; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\report_id_auto_increment.
Installed Data: \phpbb\db\migration\data\v320\default_data_type_ids; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\default_data_type_ids.
Installed Schema: \phpbb\db\migration\data\v320\default_data_type_ids; Time: 20.58 seconds
Installing Schema: \phpbb\db\migration\data\v320\default_data_type_ids.
Installed Data: \phpbb\db\migration\data\v320\oauth_states; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\oauth_states.
Installed Schema: \phpbb\db\migration\data\v320\oauth_states; Time: 0.01 seconds
Installing Schema: \phpbb\db\migration\data\v320\oauth_states.
Installed Data: \phpbb\db\migration\data\v320\v320a2; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\v320a2.
Installed Schema: \phpbb\db\migration\data\v320\v320a2; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\v320a2.
Installed Data: \phpbb\db\migration\data\v320\v320a1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\v320a1.
Installed Schema: \phpbb\db\migration\data\v320\v320a1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\v320a1.
Installed Data: \phpbb\db\migration\data\v320\notifications_board; Time: 0.28 seconds
Installing Data: \phpbb\db\migration\data\v320\notifications_board.
Installed Schema: \phpbb\db\migration\data\v320\notifications_board; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\notifications_board.
Installed Data: \phpbb\db\migration\data\v320\remove_outdated_media; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\remove_outdated_media.
Installed Schema: \phpbb\db\migration\data\v320\remove_outdated_media; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\remove_outdated_media.
Installed Data: \phpbb\db\migration\data\v320\log_post_id; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\log_post_id.
Installed Schema: \phpbb\db\migration\data\v320\log_post_id; Time: 0.41 seconds
Installing Schema: \phpbb\db\migration\data\v320\log_post_id.
Installed Data: \phpbb\db\migration\data\v320\icons_alt; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\icons_alt.
Installed Schema: \phpbb\db\migration\data\v320\icons_alt; Time: 0.01 seconds
Installing Schema: \phpbb\db\migration\data\v320\icons_alt.
Installed Data: \phpbb\db\migration\data\v320\font_awesome_update; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\font_awesome_update.
Installed Schema: \phpbb\db\migration\data\v320\font_awesome_update; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\font_awesome_update.
Installed Data: \phpbb\db\migration\data\v320\remove_profilefield_wlm; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\remove_profilefield_wlm.
Installed Schema: \phpbb\db\migration\data\v320\remove_profilefield_wlm; Time: 0.01 seconds
Installing Schema: \phpbb\db\migration\data\v320\remove_profilefield_wlm.
Installed Data: \phpbb\db\migration\data\v320\announce_global_permission; Time: 0.11 seconds
Installing Data: \phpbb\db\migration\data\v320\announce_global_permission.
Installed Schema: \phpbb\db\migration\data\v320\announce_global_permission; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\announce_global_permission.
Installed Data: \phpbb\db\migration\data\v320\text_reparser; Time: 0.91 seconds
Installing Data: \phpbb\db\migration\data\v320\text_reparser.
Installed Schema: \phpbb\db\migration\data\v320\text_reparser; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\text_reparser.
Installed Data: \phpbb\db\migration\data\v320\allowed_schemes_links; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\allowed_schemes_links.
Installed Schema: \phpbb\db\migration\data\v320\allowed_schemes_links; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\allowed_schemes_links.
Installed Data: \phpbb\db\migration\data\v320\dev; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v320\dev.
Installed Schema: \phpbb\db\migration\data\v320\dev; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v320\dev.
Installed Data: \phpbb\db\migration\data\v31x\v3112; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v3112.
Installed Schema: \phpbb\db\migration\data\v31x\v3112; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v3112.
Installed Data: \phpbb\db\migration\data\v31x\v3111; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v3111.
Installed Schema: \phpbb\db\migration\data\v31x\v3111; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v3111.
Installed Data: \phpbb\db\migration\data\v31x\v3111rc1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v3111rc1.
Installed Schema: \phpbb\db\migration\data\v31x\v3111rc1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v3111rc1.
Installed Data: \phpbb\db\migration\data\v31x\update_hashes; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\update_hashes.
Installed Schema: \phpbb\db\migration\data\v31x\update_hashes; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\update_hashes.
Installed Data: \phpbb\db\migration\data\v31x\remove_duplicate_migrations; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\remove_duplicate_migrations.
Installed Schema: \phpbb\db\migration\data\v31x\remove_duplicate_migrations; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\remove_duplicate_migrations.
Installed Data: \phpbb\db\migration\data\v31x\increase_size_of_emotion; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\increase_size_of_emotion.
Installed Schema: \phpbb\db\migration\data\v31x\increase_size_of_emotion; Time: 0.01 seconds
Installing Schema: \phpbb\db\migration\data\v31x\increase_size_of_emotion.
Installed Data: \phpbb\db\migration\data\v31x\add_smtp_ssl_context_config_options; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\add_smtp_ssl_context_config_options.
Installed Schema: \phpbb\db\migration\data\v31x\add_smtp_ssl_context_config_options; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\add_smtp_ssl_context_config_options.
Installed Data: \phpbb\db\migration\data\v31x\add_log_time_index; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\add_log_time_index.
Installed Schema: \phpbb\db\migration\data\v31x\add_log_time_index; Time: 0.60 seconds
Installing Schema: \phpbb\db\migration\data\v31x\add_log_time_index.
Installed Data: \phpbb\db\migration\data\v31x\add_latest_topics_index; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\add_latest_topics_index.
Installed Schema: \phpbb\db\migration\data\v31x\add_latest_topics_index; Time: 0.05 seconds
Installing Schema: \phpbb\db\migration\data\v31x\add_latest_topics_index.
Installed Data: \phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options.
Installed Schema: \phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options.
Installed Data: \phpbb\db\migration\data\v31x\v3110; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v3110.
Installed Schema: \phpbb\db\migration\data\v31x\v3110; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v3110.
Installed Data: \phpbb\db\migration\data\v31x\v3110rc1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v3110rc1.
Installed Schema: \phpbb\db\migration\data\v31x\v3110rc1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v3110rc1.
Installed Data: \phpbb\db\migration\data\v31x\v319; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v319.
Installed Schema: \phpbb\db\migration\data\v31x\v319; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v319.
Installed Data: \phpbb\db\migration\data\v31x\v319rc1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v319rc1.
Installed Schema: \phpbb\db\migration\data\v31x\v319rc1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v319rc1.
Installed Data: \phpbb\db\migration\data\v31x\v318; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v318.
Installed Schema: \phpbb\db\migration\data\v31x\v318; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v318.
Installed Data: \phpbb\db\migration\data\v31x\v318rc1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v318rc1.
Installed Schema: \phpbb\db\migration\data\v31x\v318rc1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v318rc1.
Installed Data: \phpbb\db\migration\data\v31x\v317pl1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v317pl1.
Installed Schema: \phpbb\db\migration\data\v31x\v317pl1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v317pl1.
Installed Data: \phpbb\db\migration\data\v31x\increase_size_of_dateformat; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\increase_size_of_dateformat.
Installed Schema: \phpbb\db\migration\data\v31x\increase_size_of_dateformat; Time: 0.11 seconds
Installing Schema: \phpbb\db\migration\data\v31x\increase_size_of_dateformat.
Installed Data: \phpbb\db\migration\data\v31x\v317; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v317.
Installed Schema: \phpbb\db\migration\data\v31x\v317; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v317.
Installed Data: \phpbb\db\migration\data\v31x\v317rc1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v317rc1.
Installed Schema: \phpbb\db\migration\data\v31x\v317rc1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v317rc1.
Installed Data: \phpbb\db\migration\data\v31x\v316; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v316.
Installed Schema: \phpbb\db\migration\data\v31x\v316; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v316.
Installed Data: \phpbb\db\migration\data\v31x\m_pm_report; Time: 0.12 seconds
Installing Data: \phpbb\db\migration\data\v31x\m_pm_report.
Installed Schema: \phpbb\db\migration\data\v31x\m_pm_report; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\m_pm_report.
Installed Data: \phpbb\db\migration\data\v31x\v316rc1; Time: 0.00 seconds
Installing Data: \phpbb\db\migration\data\v31x\v316rc1.
Installed Schema: \phpbb\db\migration\data\v31x\v316rc1; Time: 0.00 seconds
Installing Schema: \phpbb\db\migration\data\v31x\v316rc1.
Skip “installer.update_filesystem.download_updated_files” task
Skip “installer.update_filesystem.update_files” task
Skip “installer.update_filesystem.show_file_status” task
Skip “installer.update_filesystem.diff_files” task
Skip “installer.update_filesystem.check_task” task
Skip “installer.obtain_data.update_ftp_settings” task
Skip “installer.obtain_data.update_files” task
Skip “installer.obtain_data.file_updater_method” task
I don't really know how to proceed. Is there a way I could obtain a more detailed cause of error so I can toubleshoot my situation?

Thank you.
Last edited by thecoalman on Wed Mar 12, 2025 10:07 pm, edited 1 time in total.
Reason: Added code tags
na_th_an
Registered User
Posts: 3
Joined: Tue Mar 11, 2025 11:06 am

Re: CANNOT_REMOVE_MODULE error while upgrading from 3.1.4

Post by na_th_an »

I've hacked into the code to try and print more info. The CANNOT_REMOVE_MODULE happens when attempting to remove module ID 202, module class is "acp", and it's due the fact that executing `get_module_branch` returns a non empty array, which is this one:

Code: Select all

Array
(
    [0] => Array
        (
            [module_id] => 62
            [module_enabled] => 1
            [module_display] => 1
            [module_basename] => acp_forums
            [module_class] => acp
            [parent_id] => 7
            [left_id] => 63
            [right_id] => 64
            [module_langname] => ACP_MANAGE_FORUMS
            [module_mode] => manage
            [module_auth] => acl_a_forum
        )
)
For what I've seen, CANNOT_REMOVE_MODULE is thrown when attempting to delete a module that has children. Appart from that I know nil. Is there some manual action I could try to unblock the update?
na_th_an
Registered User
Posts: 3
Joined: Tue Mar 11, 2025 11:06 am

Re: CANNOT_REMOVE_MODULE error while upgrading from 3.1.4

Post by na_th_an »

I ended reverse-engineering the installing process until I identified the failing class:

Code: Select all

<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/

namespace phpbb\db\migration\data\v320;

class add_help_phpbb extends \phpbb\db\migration\migration
{
	static public function depends_on()
	{
		return array(
			'\phpbb\db\migration\data\v320\v320rc1',
		);
	}

	public function effectively_installed()
	{
		return isset($this->config['help_send_statistics']);
	}

	public function update_data()
	{
		return array(
			array('config.add', array('help_send_statistics', true)),
			array('config.add', array('help_send_statistics_time', 0)),
			array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')),
			array('module.add', array(
				'acp',
				'ACP_SERVER_CONFIGURATION',
				array(
					'module_basename'	=> 'acp_help_phpbb',
					'module_langname'	=> 'ACP_HELP_PHPBB',
					'module_mode'		=> 'help_phpbb',
					'module_auth'		=> 'acl_a_server',
				),
			)),
		);
	}
}
I commented the module.remove line and got the upgrade to complete. Now my site is working again, v3.3.14 is correctly reported and everything seems to work.
rxu
Extensions Development Team
Posts: 4059
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: CANNOT_REMOVE_MODULE error while upgrading from 3.1.4

Post by rxu »

That would mean ACP_SEND_STATISTICS module has/had a child module of ACP_MANAGE_FORUMS which shouldn't be the case. If this is the case, it also mean left/right Ids structure is broken and requires rebuilding.

Return to “[3.3.x] Support Forum”