Problem/Motivation
After upgrading site to PHP7.3 or greater and attempting to Reset Last Pull Date and Reset Last Delete Date seeing error:
Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID '0' was not found. in Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (line 79 of /mnt/www/html/[site]/docroot/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php).
Steps to reproduce
1. Upgrade site to PHP7.3 or greater.
2. Navigate to [site]/admin/structure/salesforce/mappings/manage/program
3. Click on Reset Last Pull Date and then Reset Last Delete Date (without reloading the page), the following error occurs in PHP logs:
Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "Plugin ID '0' was not found." at /mnt/www/html/[site]/docroot/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php line 79
When the error does occur if you refresh the page the action is complete.
If you click on Reset Last Pull Date, refresh the page and then click Reset Last Delete Date the error does not occur.
Comments
Comment #2
aaronbaumanAre you able to recreate this issue with 4.x-dev?
Comment #3
jannakha commentedi'm getting similar error:
Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID '0' was not found. in Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (line 79 of /app/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php).
when trying to add a new field mapping
Drupal 10
salesforce "version": "5.0.3"
investigating
Comment #4
swathi manivannan commentedFacing the same while trying to add new mappings on drupal 10.2.2, salesforce suite 5.0.3.
Comment #5
rolodmonkey commentedI just saw this error with version 5.0.4 doing the same steps as described in the description:
My guess is that the form key is not getting reset the right way after clicking the first button, and when the page reloads it has an expired/invalid form key, or something like that. Here is a full backtrace:
#0 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin(0) #1 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(149): Drupal\Component\Plugin\LazyPluginCollection->get(0) #2 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(114): Drupal\Component\Plugin\LazyPluginCollection->getIterator() #3 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(352): Drupal\Core\Plugin\DefaultLazyPluginCollection->getConfiguration() #4 [internal function]: Drupal\Core\Config\Entity\ConfigEntityBase->__sleep() #5 /var/www/html/web/core/lib/Drupal/Component/Serialization/PhpSerialize.php(14): serialize(Array) #6 /var/www/html/web/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php(111): Drupal\Component\Serialization\PhpSerialize::encode(Array) #7 /var/www/html/web/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php(127): Drupal\Core\KeyValueStore\DatabaseStorageExpirable->doSetWithExpire('form-K9Pyone5pz...', Array, 21600) #8 /var/www/html/web/core/lib/Drupal/Core/Form/FormCache.php(193): Drupal\Core\KeyValueStore\DatabaseStorageExpirable->setWithExpire('form-K9Pyone5pz...', Array, 21600) #9 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(463): Drupal\Core\Form\FormCache->setCache('form-K9Pyone5pz...', Array, Object(Drupal\Core\Form\FormState)) #10 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(441): Drupal\Core\Form\FormBuilder->setCache('form-K9Pyone5pz...', Array, Object(Drupal\Core\Form\FormState)) #11 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(633): Drupal\Core\Form\FormBuilder->rebuildForm('salesforce_mapp...', Object(Drupal\Core\Form\FormState), Array) #12 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('salesforce_mapp...', Array, Object(Drupal\Core\Form\FormState)) #13 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\salesforce_mapping_ui\Form\SalesforceMappingEditForm), Object(Drupal\Core\Form\FormState)) #14 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #15 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #16 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #18 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #19 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #21 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #32 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #33 {main}Comment #6
mabho commentedThis is likely not associated with the Salesforce module. I can reproduce this issue, and I don't have the module installed.
This is how I can reproduce the problem without much effort:
Comment #7
aaronbaumanThis is fixed with a cache rebuild, yes?
I believe it's a problem in the dynamic salesforce menu route.
Maybe can be solved with cache tags.