Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2] Fix fatal error when update to Joomla 4.2 #37990

Merged

Conversation

joomdonation
Copy link
Contributor

@joomdonation joomdonation commented Jun 5, 2022

Pull Request for Issue # .

Summary of Changes

In Joomla 4.2, we convert some plugins to new structure, so the namespace map will need to be re-generated before avoid Joomla calls com_joomlaupdate to finalize upgrade process to avoid fatal error.

Testing Instructions

  1. Install Joomla 4.1.
  2. Try to Update that 4.1 website to Joomla 4.2 nightly build. During the update, you would get fatal error saying class Joomla\Plugin\Actionlog\Joomla\Extension\Joomla not found (something like that, I don't remember exactly the error message)
  3. Install Joomla 4.1 again
  4. Try to update to the update package generated for this PR. You can download the package from this link https://ci.joomla.org/artifacts/joomla/joomla-cms/4.2-dev/37990/downloads/54926/Joomla_4.2.0-beta1-dev+pr.37990-Development-Update_Package.zip . Make sure upgrade works properly

Actual result BEFORE applying this Pull Request

Fatal error while upgrading to Joomla 4.2

Expected result AFTER applying this Pull Request

Upgrade to Joomla 4.2 works well.

@ChristineWk
Copy link

@joomdonation
Confirm Actual Result. Updated from 4.1.4 to Nightly Build 4.2.0-beta1-dev.

An error has occurred. 0 Class 'Joomla\Plugin\Actionlog\Joomla\Extension\Joomla' not found

But now, Frontend and Backend are corrupted.
Can I solve it via phpMyAdmin somewhere (special Plugin Table)?

@joomdonation
Copy link
Contributor Author

@ChristineWk You can delete the file administrator/cache/autoload_psr4.php manually to get the site running again. However, to test the PR, you will need to setup another Joomla 4.1 website. The purpose is confirming upgrading to new package won't get fatal error anymore

@ChristineWk
Copy link

@ChristineWk You can delete the file administrator/cache/autoload_psr4.php manually to get the site running again. However, to test the PR, you will need to setup another Joomla 4.1 website. The purpose is confirming upgrading to new package won't get fatal error anymore

OK, Done. Thanks for the hint :-)
It shows now: 4.2.0-beta1-dev and: Database: 4.1.3-2022-04-08: After this: DB updated.
Another 4.1 I don't know yet.

@brianteeman
Copy link
Contributor

From what I remember that cache file is supposed to be deleted and rebuiult during the update process

@brianteeman
Copy link
Contributor

found it #36094

@joomdonation
Copy link
Contributor Author

@brianteeman That PR only solved the issue when new extensions are added during update process (like Schedule extension which we added in 4.1). For 4.2, we converted some plugins to new structure, so the namespace map must be re-generated earlier than that, otherwise, after the extraction process, we will get fatal error immediately and the upgrade could not be completed.

@richard67
Copy link
Member

richard67 commented Jun 5, 2022

I have tested this item ✅ successfully on 7aaebc4

Hint for other testers: For updating to the 4.2-dev nightly build without the patch (step 2 in the instructions), I had to download the update package from here https://developer.joomla.org/nightly-builds.html and use "Upload & Update" because the update site XML for the 4.2-dev nightlies contains a wrong download URL. See joomla/update.joomla.org#250 .


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@toivo
Copy link
Contributor

toivo commented Jun 6, 2022

I have tested this item ✅ successfully on 7aaebc4

Confirmed the error message and tested successfully in Wampserver 3.2.9 and PHP 8.0.15 using the update package created for this PR.

#
#<?php die('Forbidden.'); ?>
#Date: 2022-06-06 03:43:55 UTC
#Software: Joomla! 4.1.4 Stable [ Kuamini ] 24-May-2022 16:00 GMT

#Fields: datetime	priority clientip	category	message
2022-06-06T03:43:55+00:00	INFO 127.0.0.1	update	Starting installation of new version.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Finalising installation.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Start of SQL updates.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	The current database version (schema) is 4.1.3-2022-04-08.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Ran query from file 4.2.0-2022-05-15. Query text: CREATE TABLE IF NOT EXISTS `#__user_mfa` (   `id` int NOT NULL AUTO_INCREMENT,  .
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Ran query from file 4.2.0-2022-05-15. Query text: DELETE FROM `#__postinstall_messages` WHERE `condition_file` = 'site://plugins/t.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Ran query from file 4.2.0-2022-05-15. Query text: INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, .
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Ran query from file 4.2.0-2022-05-15. Query text: UPDATE `#__extensions` AS `a` 	INNER JOIN `#__extensions` AS `b` on `a`.`element.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Ran query from file 4.2.0-2022-05-15. Query text: DELETE FROM `#__extensions` WHERE `type` = 'plugin' AND `folder` = 'twofactoraut.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Ran query from file 4.2.0-2022-05-15. Query text: INSERT IGNORE INTO `#__postinstall_messages` (`extension_id`, `title_key`, `desc.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Ran query from file 4.2.0-2022-05-15. Query text: INSERT IGNORE INTO `#__mail_templates` (`template_id`, `extension`, `language`, .
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	End of SQL updates.
2022-06-06T03:44:15+00:00	INFO 127.0.0.1	update	Deleting removed files and folders.
2022-06-06T03:44:19+00:00	INFO 127.0.0.1	update	Cleaning up after installation.
2022-06-06T03:44:19+00:00	INFO 127.0.0.1	update	Update to version 4.2.0-beta1-dev+pr.37990 is complete.

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 6, 2022
@roland-d roland-d merged commit 4046858 into joomla:4.2-dev Jun 6, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 6, 2022
@roland-d
Copy link
Contributor

roland-d commented Jun 6, 2022

Thanks everybody

@joomdonation joomdonation deleted the fix_fatal_error_on_upgrade_to_4.2 branch June 6, 2022 13:26
@roland-d roland-d added this to the Joomla 4.2.0 milestone Jun 6, 2022
@PhilETaylor

This comment was marked as abuse.

@shortyloz
Copy link

I have a related issue maybe?

screen shot 2022-08-16 at 21 12 58

I have removed the file suggested above "@ChristineWk You can delete the file administrator/cache/autoload_psr4.php manually to get the site running again. However, to test the PR, you will need to setup another Joomla 4.1 website. The purpose is confirming upgrading to new package won't get fatal error anymore" But that has not solved my issue.

Any suggestions : Live site is at this URL (I also stupidly did not do a backup!)
https://www.cheshuntrpc.co.uk/

Thanks
Numpty Mark from UK


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@PhilETaylor

This comment was marked as abuse.

@shortyloz
Copy link

Thanks PhilETaylor. Where do I do that please?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@PhilETaylor

This comment was marked as abuse.

@shortyloz
Copy link

Sorry, I didn't know I was in the wrong place. I will do that as suggested and also look there. :-)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@rkostanyan
Copy link

Dears, I have new problem, please help
Class "Joomla\Plugin\Authentication\Joomla\Extension\Joomla" not found


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@joomdonation
Copy link
Contributor Author

@rkostanyan Try to delete the file administrator/cache/autoload_psr4.php from your site. That should address the issue.

@rkostanyan
Copy link

Problem is not resolved:(


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37990.

@joomdonation
Copy link
Contributor Author

@rkostanyan If so, I don't have any other idea. You might need to have a developer to look at your site to see what's actual reason and get it sorted. Without accessing to your site, it's hard to know the root reason of the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.