Upgrading to beta 3 of AI module breaks website
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3491390. -->
Reported by: [jbuttler](https://www.drupal.org/user/3437983)
Related to !309
>>>
<p>When I upgrade from beta1 to beta 3 my website breaks. I also tried upgrading from beta 1 to beta 2, then beta 3 and experienced the same problem. I When I try to roll back to beta1, the website is still broken. I must recover the site from a backup to restore functionality. </p>
<p><strong>The full Error result when running composer is:</strong><br>
------------------------------------<br>
#$:/var/www/html/website$ drush updatedb<br>
------------------ ----------- --------------- -------------------------------<br>
Module Update ID Type Description<br>
------------------ ----------- --------------- -------------------------------<br>
ai_assistant_api 10200 hook_update_n 10200 - Implements<br>
hook_update_N().<br>
ai_content 9100 hook_update_n 9100 - Copy the old settings<br>
over to the new module and<br>
disable this one.<br>
ai_assistant_api settings post-update Move settings into new fields<br>
to handle future restructure<br>
on config.<br>
------------------ ----------- --------------- -------------------------------</p>
<p>> [notice] Update started: ai_assistant_api_update_10200<br>
> [error] Cannot assign null to property Drupal\ai_assistant_api\Entity\AiAssistant::$system_prompt of type string<br>
> [error] Update failed: ai_assistant_api_update_10200<br>
> [notice] Update started: ai_content_update_9100<br>
> [error] Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator::__construct(): Argument #8 ($fileUrlGenerator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\cdn\File\FileUrlGenerator given, called in /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php on line 61<br>
> [error] Update failed: ai_content_update_9100<br>
[error] Update aborted by: ai_assistant_api_update_10200, ai_content_update_9100<br>
[error] Finished performing updates.<br>
[error] TypeError: Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator::__construct(): Argument #8 ($fileUrlGenerator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\cdn\File\FileUrlGenerator given, called in /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php on line 61 in Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator->__construct() (line 53 of /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php) #0 /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php(61): Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator->__construct()<br>
#1 /var/www/html/website/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator::create()<br>
#2 /var/www/html/website/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance()<br>
#3 /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Routing/AiApiExplorerRouteSubscriber.php(30): Drupal\Component\Plugin\PluginManagerBase->createInstance()<br>
#4 /var/www/html/website/web/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\ai_api_explorer\Routing\AiApiExplorerRouteSubscriber->alterRoutes()<br>
#5 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes()<br>
#6 /var/www/html/website/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()<br>
#7 /var/www/html/website/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(189): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()<br>
#8 /var/www/html/website/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()<br>
#9 /var/www/html/website/web/core/includes/common.inc(485): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()<br>
#10 /var/www/html/website/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(96): drupal_flush_all_caches()<br>
#11 [internal function]: Drush\Commands\core\UpdateDBCommands->updatedb()<br>
#12 /var/www/html/website/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()<br>
#13 /var/www/html/website/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()<br>
#14 /var/www/html/website/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()<br>
#15 /var/www/html/website/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()<br>
#16 /var/www/html/website/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()<br>
#17 /var/www/html/website/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()<br>
#18 /var/www/html/website/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()<br>
#19 /var/www/html/website/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()<br>
#20 /var/www/html/website/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()<br>
#21 /var/www/html/website/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()<br>
#22 /var/www/html/website/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()<br>
#23 /var/www/html/website/vendor/bin/drush.php(119): include('...')<br>
#24 {main}.<br>
TypeError: Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator::__construct(): Argument #8 ($fileUrlGenerator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\cdn\File\FileUrlGenerator given, called in /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php on line 61 in /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php on line 53 #0 /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php(61): Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator->__construct()<br>
#1 /var/www/html/website/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator::create()<br>
#2 /var/www/html/website/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance()<br>
#3 /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Routing/AiApiExplorerRouteSubscriber.php(30): Drupal\Component\Plugin\PluginManagerBase->createInstance()<br>
#4 /var/www/html/website/web/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\ai_api_explorer\Routing\AiApiExplorerRouteSubscriber->alterRoutes()<br>
#5 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes()<br>
#6 /var/www/html/website/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()<br>
#7 /var/www/html/website/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(189): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()<br>
#8 /var/www/html/website/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()<br>
#9 /var/www/html/website/web/core/includes/common.inc(485): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()<br>
#10 /var/www/html/website/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(96): drupal_flush_all_caches()<br>
#11 [internal function]: Drush\Commands\core\UpdateDBCommands->updatedb()<br>
#12 /var/www/html/website/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()<br>
#13 /var/www/html/website/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()<br>
#14 /var/www/html/website/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()<br>
#15 /var/www/html/website/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()<br>
#16 /var/www/html/website/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()<br>
#17 /var/www/html/website/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()<br>
#18 /var/www/html/website/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()<br>
#19 /var/www/html/website/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()<br>
#20 /var/www/html/website/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()<br>
#21 /var/www/html/website/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()<br>
#22 /var/www/html/website/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()<br>
#23 /var/www/html/website/vendor/bin/drush.php(119): include('...')<br>
#24 {main}<br>
TypeError: Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator::__construct(): Argument #8 ($fileUrlGenerator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\cdn\File\FileUrlGenerator given, called in /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php on line 61 in Drupal\ai_api_explorer\Plugin\AiApiExplorer\ImageAndAudioToVideoGenerator->__construct() (line 53 of /var/www/html/website/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ImageAndAudioToVideoGenerator.php).<br>
[warning] Drush command terminated abnormally.<br>
---------------------------------------------------------------------------------</p>
<p><strong>When I try to load the page I get the white screen of death. Checking the logs after this reveals the following error with an unrelated module (commerce license) that I did not experience before. When I roll back, everything is fine. This error output:</strong><br>
--------------------<br>
Message Error: Call to a member function label() on null in Drupal\commerce_license\Plugin\Commerce\LicenseType\Role->checkUserHasExistingRights() (line 102 of /var/www/html/website/web/modules/contrib/commerce_license/src/Plugin/Commerce/LicenseType/Role.php).<br>
Severity Error<br>
Operations<br>
Backtrace<br>
#0 /var/www/html/website/web/modules/contrib/commerce_license/src/LicenseAvailabilityCheckerExistingRights.php(173): Drupal\commerce_license\Plugin\Commerce\LicenseType\Role->checkUserHasExistingRights()<br>
#1 /var/www/html/website/web/modules/contrib/commerce_license/src/LicenseAvailabilityCheckerExistingRights.php(136): Drupal\commerce_license\LicenseAvailabilityCheckerExistingRights->checkPurchasable()<br>
#2 /var/www/html/website/web/modules/contrib/commerce/modules/order/src/AvailabilityManager.php(50): Drupal\commerce_license\LicenseAvailabilityCheckerExistingRights->check()<br>
#3 /var/www/html/website/web/modules/contrib/commerce/modules/order/src/AvailabilityOrderProcessor.php(53): Drupal\commerce_order\AvailabilityManager->check()<br>
#4 /var/www/html/website/web/modules/contrib/commerce/modules/order/src/OrderRefresh.php(198): Drupal\commerce_order\AvailabilityOrderProcessor->process()<br>
#5 /var/www/html/website/web/modules/contrib/commerce/modules/order/src/OrderStorage.php(123): Drupal\commerce_order\OrderRefresh->refresh()<br>
#6 /var/www/html/website/web/modules/contrib/commerce/modules/order/src/OrderStorage.php(86): Drupal\commerce_order\OrderStorage->doOrderPreSave()<br>
#7 /var/www/html/website/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(529): Drupal\commerce_order\OrderStorage->invokeHook()<br>
#8 /var/www/html/website/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(753): Drupal\Core\Entity\EntityStorageBase->doPreSave()<br>
#9 /var/www/html/website/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave()<br>
#10 /var/www/html/website/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(806): Drupal\Core\Entity\EntityStorageBase->save()<br>
#11 /var/www/html/website/web/modules/contrib/commerce/modules/order/src/OrderStorage.php(169): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()<br>
#12 /var/www/html/website/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\commerce_order\OrderStorage->save()<br>
#13 /var/www/html/website/web/modules/contrib/commerce/modules/order/src/OrderStorage.php(156): Drupal\Core\Entity\EntityBase->save()<br>
#14 /var/www/html/website/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(319): Drupal\commerce_order\OrderStorage->postLoad()<br>
#15 /var/www/html/website/web/modules/contrib/commerce/modules/cart/src/CartProvider.php(232): Drupal\Core\Entity\EntityStorageBase->loadMultiple()<br>
#16 /var/www/html/website/web/modules/contrib/commerce/modules/cart/src/CartProvider.php(180): Drupal\commerce_cart\CartProvider->loadCartData()<br>
#17 /var/www/html/website/web/modules/contrib/commerce/modules/cart/src/CartProvider.php(167): Drupal\commerce_cart\CartProvider->getCartIds()<br>
#18 /var/www/html/website/web/modules/contrib/commerce/modules/cart/src/Plugin/Block/CartBlock.php(253): Drupal\commerce_cart\CartProvider->getCarts()<br>
#19 /var/www/html/website/web/core/modules/block/src/BlockViewBuilder.php(47): Drupal\commerce_cart\Plugin\Block\CartBlock->getCacheTags()<br>
#20 /var/www/html/website/web/core/modules/block/src/BlockViewBuilder.php(32): Drupal\block\BlockViewBuilder->viewMultiple()<br>
#21 /var/www/html/website/web/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php(152): Drupal\block\BlockViewBuilder->view()<br>
#22 /var/www/html/website/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(270): Drupal\block\Plugin\DisplayVariant\BlockPageVariant->build()<br>
#23 /var/www/html/website/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()<br>
#24 /var/www/html/website/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()<br>
#25 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()<br>
#26 /var/www/html/website/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()<br>
#27 /var/www/html/website/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()<br>
#28 /var/www/html/website/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()<br>
#29 /var/www/html/website/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()<br>
#30 /var/www/html/website/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()<br>
#31 /var/www/html/website/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()<br>
#32 /var/www/html/website/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()<br>
#33 /var/www/html/website/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle()<br>
#34 /var/www/html/website/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()<br>
#35 /var/www/html/website/web/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle()<br>
#36 /var/www/html/website/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle()<br>
#37 /var/www/html/website/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()<br>
#38 /var/www/html/website/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()<br>
#39 /var/www/html/website/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()<br>
#40 /var/www/html/website/web/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\AjaxPageState->handle()<br>
#41 /var/www/html/website/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle()<br>
#42 /var/www/html/website/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()<br>
#43 /var/www/html/website/web/index.php(19): Drupal\Core\DrupalKernel->handle()<br>
#44 {main}<br>
--------------------</p>
issue