4

I'm trying to upgrade CiviCRM in a Joomla 3.9.26 environment from 5.25.0 to 5.37.0.

I ran the file installation, cleared the media/template_c folder, then tried to run the database upgrade script. I get this error:

An error has occurred. 
0 Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()

The ConfigLog file and the PHP error logs don't show this error, and the ConfigLog files don't seem to show anything related to any database upgrade script. Also, the civicrm_domain table still shows 5.25.0 in the version column, so I don't think the update script has run at all.

I have no idea why this upgrade would be calling a 4.1 incremental upgrade script? And I'm not sure what steps to take next to recover -- or if I just roll back to my backup. However, I will eventually need to get this upgraded!

Suggestions appreciated!

UPDATE: call stack as requested...

0 Call to undefined method CRM_Upgrade_Incremental_php_FourOne::getMajorMinor()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:125 
1   ()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:125
2   CRM_Upgrade_Form::incrementalPhpObjectVersions()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:324
3   CRM_Upgrade_Form->getRevisionSequence()     JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Form.php:845
4   CRM_Upgrade_Form->setPreUpgradeMessage()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php:108
5   CRM_Upgrade_Page_Upgrade->runIntro()    JROOT/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php:57
6   CRM_Upgrade_Page_Upgrade->run()     JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:313
7   CRM_Core_Invoke::runItem()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:69
8   CRM_Core_Invoke::_invoke()  JROOT/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:36
9   CRM_Core_Invoke::invoke()   JROOT/administrator/components/com_civicrm/civicrm.php:121
10  civicrm_invoke()    JROOT/administrator/components/com_civicrm/civicrm.php:40
11  require_once()  JROOT/libraries/src/Component/ComponentHelper.php:402
12  Joomla\CMS\Component\ComponentHelper::executeComponent()    JROOT/libraries/src/Component/ComponentHelper.php:377
13  Joomla\CMS\Component\ComponentHelper::renderComponent()     JROOT/libraries/src/Application/AdministratorApplication.php:101
14  Joomla\CMS\Application\AdministratorApplication->dispatch()     JROOT/libraries/src/Application/AdministratorApplication.php:159
15  Joomla\CMS\Application\AdministratorApplication->doExecute()    JROOT/libraries/src/Application/CMSApplication.php:203
16  Joomla\CMS\Application\CMSApplication->execute()    JROOT/administrator/index.php:51 
7
  • 1
    Strange! Can you add the rest of the stacktrace. That might give a few more clues.
    – Aidan
    May 11, 2021 at 14:28
  • well Aidan, I need to figure out how to find it. That's the entire message as shown in the Joomla interface, and I don't see anything similar in ConfigLog or the PHP error log. I'll try to generate it again.
    – minbori
    May 11, 2021 at 15:11
  • ok, added. hope that helps -- looks like it's the PHP Incremental versions it's hanging on, not the Civi....but this system is running on PHP 7.4 and has been for quite a while?
    – minbori
    May 11, 2021 at 15:31
  • 1
    Wondering did you delete and completely replace the administrator/components/com_civicrm/civicrm with the new files? For all the CMS's except Joomla you need to do that to avoid problems like this, but one thing I don't understand about joomla is that the civi upgrade instructions don't tell you to do that. I would try completely replacing the civicrm folder with the new files (make a backup in case you have something custom in there - you shouldn't but sometimes people do).
    – Demerit
    May 11, 2021 at 18:44
  • I did not, but via Aidan's suggestion on Mattermost I tried again and did just that: backed up the code base, uninstalled Civi, and reinstalled . I ran into a couple hiccups (had to manually put back my civicrm.settings.php files, and this one civicrm.stackexchange.com/questions/39185/…) but everything seemed to update smoothly. However, now it seems the Joomla permissions are borked. Am researching now and may open another question.
    – minbori
    May 12, 2021 at 11:11

7 Answers 7

6

After some chat on MM we identified that the installation had a file CRM/Upgrade/Incremental/FourOne.php That file has been removed from the current release but the usual Joomla upgrade process extracts the CiviCRM zip file into the existing code directories rather than removing them first. This is fine for new and changed files but does not delete files no longer in the released code.

The Joomla upgrade documentation notes that sometimes it is necessary to uninstall and reinstall. This removes all the old files before installing the new ones. This should not affect the database but note @minbori's comment above that permissions needed to be reset afterwards. (It would be useful if someone could verify what happens to permissions and add a note to the documentation accordingly.)

Alternatively for those with filesystem access the administrator/components/com_civicrm/civicrm can be deleted and the installation zip file manually extracted to put the new files in place. (See @demerit's comment above.)

2
  • This works perfectly. Thanks! May 15, 2021 at 0:06
  • As per thoni56's answer below (which builds on this answer), removing the old Three---- and Four---- files from civicrm/CRM/Upgrade/Incremental/php/ solves the problem without a complete Civi uninstall/reinstall. Possibly just removing FourOne.php will do the trick. Jul 16, 2021 at 19:58
5

We also experienced the same problem when upgrading from 5.36.1 to 5.37.2.

Inspired by the answer from Aidan I went and looked in civicrm/CRM/Upgrade/Incremental/php/ and found a few files with old dates and named Three????.php and Four????.php.

As I was protected by a smoking fresh total Akeeba backup (running on Joomla) I ventured to just move those files to a safe place and retry the update.

And it worked!

2
  • This worked perfectly for me as well, thanks.
    – Troy Mumm
    May 27, 2021 at 16:10
  • Confirm that removing the old Three---- and Four---- files solves the problem without a complete Civi uninstall/reinstall. Possibly just removing FourOne.php will do the trick. Jul 16, 2021 at 19:56
2

I was having exactly the same error on a site that I had not upgraded for a long time. I do have access to the filesystem.

I followed your instructions and I deleted the folder administrator/components/com_civicrm/civicrm and I extracted the administrator/components/com_civicrm/civicrm.zip file. This created a new administrator/components/com_civicrm/civicrm folder.

I then rerun the Upgrade Database with https://domainname.com/administrator/index.php?option=com_civicrm&task=civicrm/upgrade&reset=1

and this time I was able to start the upgrade process.

Unfortunately in the middle of the upgrade I got the following error:

[Error: Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date]

CiviCRM_API3_Exception: "DB Error: no such field"

#0 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/SmartGroups.php(206): civicrm_api3("SavedSearch", "create", (Array:3)) #1 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/SmartGroups.php(27): CRM_Upgrade_Incremental_SmartGroups->renameField("event_start_date_low", "event_low") #2 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/Base.php(273): CRM_Upgrade_Incremental_SmartGroups->updateGroups((Array:1)) #3 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Task.php(74): CRM_Upgrade_Incremental_Base::updateSmartGroups(Object(CRM_Queue_TaskContext), (Array:1)) #4 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Runner.php(201): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext)) #5 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php(36): CRM_Queue_Runner->runNext(TRUE) #6 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/ErrorPolicy.php(89): CRM_Queue_Page_AJAX::{closure}() #7 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php(38): CRM_Queue_ErrorPolicy->call(Object(Closure)) #8 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(279): CRM_Queue_Page_AJAX::runNext() #9 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:13)) #10 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:5)) #11 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm.php(121): CRM_Core_Invoke::invoke((Array:5)) #12 /home/customer/www/domainname.com/public_html/administrator/components/com_civicrm/civicrm.php(40): civicrm_invoke() #13 /home/customer/www/domainname.com/public_html/libraries/src/Component/ComponentHelper.php(402): require_once("/home/customer/www/domainname.com/public_html/administrator/compo...") #14 /home/customer/www/domainname.com/public_html/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent("/home/customer/www/domainname.com/public_html/administrator/compo...") #15 /home/customer/www/domainname.com/public_html/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm") #16 /home/customer/www/domainname.com/public_html/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication->dispatch() #17 /home/customer/www/domainname.com/public_html/libraries/src/Application/CMSApplication.php(203): Joomla\CMS\Application\AdministratorApplication->doExecute() #18 /home/customer/www/domainname.com/public_html/administrator/index.php(51): Joomla\CMS\Application\CMSApplication->execute() #19 {main}

And if I try running the upgrade database command again, I get this:

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again.

What do I do now? Doing a quick check, I seem to be able to access my records, but it sounds like I am left with a partially upgraded database!

I would really appreciate some help. Thanks, Adri

1

Just an update for anyone else finding themselves in this issue. I have been able to complete manually the Database updates following Eileen suggestions in this post.

What can I do to fix my database that has been partially upgraded?

Thanks, Adri

0

So I went from 5.36.1 to 5.37.2. I received the same db error. The only issue I had was that I had to copy /ext to /com_civicrm, delete /civicrm then run civicrm.zip again from the directory, then copy /ext back in. Once I did that I could upgrade the database. The only issue for me was reCaptcha was missing files, so I delete the extension and tried to reinstall but it was not available. Curious if they integrated that into core or do I just need to look harder.

1
  • One additional issue cropped up when we deleted the directory, it also deleted and did not reload the reCaptcha directory/files. So we get the red error screen stating that Class 'CRM_Utils_ReCAPTCHA' not found. Now I am just waiting for the next issue to pop up due to deleting the civicrm directory. May 13, 2021 at 19:12
0

I had the same error, upgrading from 5.35.0. (Joomla) to 5.37.2. After renaming the /civicrm directory and extracting the civicrm.zip (and the change l10n for translating) I got errors trying to start the application to execute the upgrade-script (I suppose i had to run the upgrade-script not using the application to do that!). But after copying the directories PEAR, MAIL and DB and the same files in com_civicrm\civicrm\packages from the renamed directory to the new version the application worked and the upgrading is done without (shown) errors.

0

I had the problem while updating 5.38.1. I hoped maybe if I did a new update the problem would be fixed. But while updating, I got the same error again. As @toni56 forwarded, I first backup and deleted the files "FourOne.php, FourTwo.php, FourThree.php and FourFour.php" in the "/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/php" directory. Then I tried to update with "administrator/?option=com_civicrm&task=civicrm/upgrade&reset=1" and PROBLEM IS SOLVED. Thank you so much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.