Fatal error - Call to a member function setFormClass() on null in commerce_order.module on line 222 - commerce_order_entity_type_build(Array)

Created on 9 June 2021, over 3 years ago
Updated 5 November 2024, about 2 months ago

Fatal Error - site crashed

Dear all,

I am facing a weird issue, last night I tried to hook up commerce with product variation (which ships as part of the commerce module) and add Commerce Stock into the product variation - This also should be supported with seamless integration I believe.

But since then, my site is crashing with the below stacktrace. I am not sure what exactly the reason is but my site does not open at all now. Initially I thought it is just specific to order of logged in user but when I tried to open the site in incognito mode even then the site was not opening at all due to same stacktraced error.

Raising this as critical coz the nature of the bug is taking down the whole site.

[09-Jun-2021 04:14:40 UTC] Error: Call to a member function setFormClass() on null in /home/v7v32icafeqy/public_html/modules/commerce/modules/order/commerce_order.module on line 222 #0 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Entity/EntityTypeManager.php(129): commerce_order_entity_type_build(Array)
#1 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\Core\Entity\EntityTypeManager->findDefinitions()
#2 /home/v7v32icafeqy/public_html/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#3 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Entity/EntityTypeManager.php(143): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('user_role', false)
#4 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Entity/EntityTypeManager.php(269): Drupal\Core\Entity\EntityTypeManager->getDefinition('user_role')
#5 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Entity/EntityTypeManager.php(208): Drupal\Core\Entity\EntityTypeManager->getHandler('user_role', 'storage')
#6 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Session/UserSession.php(206): Drupal\Core\Entity\EntityTypeManager->getStorage('user_role')
#7 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Session/UserSession.php(111): Drupal\Core\Session\UserSession->getRoleStorage()
#8 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Session/AccountProxy.php(119): Drupal\Core\Session\UserSession->hasPermission('access commerce...')
#9 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Access/AccessResult.php(156): Drupal\Core\Session\AccountProxy->hasPermission('access commerce...')
#10 /home/v7v32icafeqy/public_html/core/modules/user/src/Access/PermissionAccessCheck.php(41): Drupal\Core\Access\AccessResult::allowedIfHasPermissions(Object(Drupal\Core\Session\AccountProxy), Array, 'OR')
#11 [internal function]: Drupal\user\Access\PermissionAccessCheck->access(Object(Symfony\Component\Routing\Route), Object(Drupal\Core\Session\AccountProxy))
#12 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Access/AccessManager.php(159): call_user_func_array(Array, Array)
#13 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Access/AccessManager.php(135): Drupal\Core\Access\AccessManager->performCheck('access_check.pe...', Object(Drupal\Component\Utility\ArgumentsResolver))
#14 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Access/AccessManager.php(112): Drupal\Core\Access\AccessManager->check(Object(Drupal\Core\Routing\RouteMatch), Object(Drupal\Core\Session\AccountProxy), Object(Symfony\Component\HttpFoundation\Request), true)
#15 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Routing/AccessAwareRouter.php(109): Drupal\Core\Access\AccessManager->checkRequest(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Session\AccountProxy), true)
#16 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/Routing/AccessAwareRouter.php(94): Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object(Symfony\Component\HttpFoundation\Request))
#17 /home/v7v32icafeqy/public_html/vendor/symfony/http-kernel/EventListener/RouterListener.php(113): Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#18 [internal function]: Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#19 /home/v7v32icafeqy/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#20 /home/v7v32icafeqy/public_html/vendor/symfony/http-kernel/HttpKernel.php(127): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object(Symfony\Component\HttpKernel\Event\GetResponseEvent))
#21 /home/v7v32icafeqy/public_html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#22 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /home/v7v32icafeqy/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /home/v7v32icafeqy/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /home/v7v32icafeqy/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /home/v7v32icafeqy/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /home/v7v32icafeqy/public_html/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /home/v7v32icafeqy/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#32 {main}

If a bug, provide steps to reproduce it from a clean install.

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.24

Component

Order

Created by

🇮🇳India gumdal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Hello,

    I am having this issue but on a clean install. I am using ubuntu on wsl2 and docker-desktop.

    I clone my project using wsl2 but when I launch my project I get this ->

    The website encountered an unexpected error. Try again later.

    Error: Call to a member function setFormClass() on null in system_entity_type_build() (line 1169 of core/modules/system/system.module).
    Drupal\Core\Entity\EntityTypeManager->Drupal\Core\Entity\{closure}(Object, 'system') (Line: 395)
    Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_type_build', Object) (Line: 120)
    Drupal\Core\Entity\EntityTypeManager->findDefinitions() (Line: 213)
    Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 22)
    Drupal\Core\Plugin\DefaultPluginManager->getDefinition('user', ) (Line: 135)
    Drupal\Core\Entity\EntityTypeManager->getDefinition('user') (Line: 260)
    Drupal\Core\Entity\EntityTypeManager->getHandler('user', 'storage') (Line: 195)
    Drupal\Core\Entity\EntityTypeManager->getStorage('user') (Line: 90)
    Drupal\user\Form\UserLoginForm::create(Object) (Line: 41)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\user\Form\UserLoginForm') (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\user\Form\UserLoginForm') (Line: 58)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 53)
    Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • 🇮🇱Israel jsacksick

    Error: Call to a member function setFormClass() on null in system_entity_type_build() (line 1169 of core/modules/system/system.module).

    This is a different error, the error is in the system module (from Drupal core).

  • Hello,

    I've tried re installing the project. But still have the same issue. Do you know what is causing this issue?

    Thanks,
    Tamanen

Production build 0.71.5 2024