XF 2.3 2.2.5 to 2.3 upgrade - Undefined array key "emailDkim"

JackieChun

Well-known member
Stuck while upgrading. Forum not functional anymore. Someone else posted the same error in a different thread without a resolution.

ErrorException: [E_WARNING] Undefined array key "emailDkim" in src/XF/Install/Upgrade/2030037-230b7.php at line 46
XF::handlePhpError() in src/XF/Install/Upgrade/2030037-230b7.php at line 46
XF\Install\Upgrade\Version2030037->step4() in src/XF/Install/Controller/Upgrade.php at line 192
XF\Install\Controller\Upgrade->actionRun() in src/XF/Mvc/Dispatcher.php at line 362
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2777
XF\App->run() in src/XF.php at line 798
XF::runApp() in install/index.php at line 16
 
It's most likely a bug in the upgrade code that appears if you upgrade from XF < 2.2.9.

You could try to upgrade to 2.2.16 first, after the upgrade is fully complete upgrade to 2.3.

Workaround
Open src/XF/Install/Upgrade/2030037-230b7.php in a text editor and comment out the whole body of method step4 (should be lines 46 to 74).
This will completely skip converting DKIM options (which simply don't exist in 2.2.5).
 
Last edited:
It looks like this was already sorted for the next release.

We have also changed the behavior here more broadly to merely log an error and treat missing options as null if debug mode is not enabled, which was the behavior we had prior to PHP 8 when undefined array key access was reclassified from a notice to a warning. We'll still endeavor to fix these warnings, but they should no longer cause fatal errors.
 
@Kirby @Jeremy P since my upgrade has already failed once and is now in limbo, do I need to restore a cPanel and/or MySQL backup back to a virgin 2.2.5 installation before trying Kirby's fix?

Jeremy, for UX reasons, I would avoid logging an error in this case. Errors makes users panic and will cause a flood of threads from people asking if their installation is faulty. If an option is missing in a version where it's supposed to be missing, then it's technically not an error.
 
Open src/XF/Install/Upgrade/2030037-230b7.php in a text editor and comment out the whole body of method step4 (should be lines 46 to 74).
This will completely skip converting DKIM options (which simply don't exist in 2.2.5).
I just stuck a return; in when I worked around it last week.

1721985598264.webp
 
Back
Top Bottom