Call to a member function getThirdPartySetting() on null in ContentTranslationManager

Created on 10 April 2017, over 7 years ago
Updated 1 August 2024, 5 months ago

I'm using config_installer to install. Almost at the end of the installation, I get the following fatal error. I previously applied patch 1356276-302, but I don't think this is related. It started happening after upgrading core to 8.3.0. The install does not finish correctly (the site has no admin user set). Any help or workaround is appreciated.

~/p/n/n/d/bin (master ⚑☑=) ./drush site-install config_installer config_installer_sync_configure_form.sync_directory=/var/www/drupal/config/sync --verbose --db-url=mysql://root:xxx@db/drupal --account-name=admin --account-pass=xxx -y
Executing: mysql --defaults-extra-file=/tmp/drush_IucryR --database=drupal --host=db --silent  < /tmp/drush_4Sag50 > /dev/null
You are about to DROP all tables in your 'drupal' database. Do you want to continue? (y/n): y
Sites directory /var/www/drupal/web/sites/default already exists -      [notice]
proceeding.
Executing: mysql --defaults-extra-file=/tmp/drush_mYQQIy --database=drupal --host=db --silent  < /tmp/drush_nu5C8H > /dev/null
Executing: mysql --defaults-extra-file=/tmp/drush_hGpyVf --database=drupal --host=db --silent  < /tmp/drush_vyJbkp
Executing: mysql --defaults-extra-file=/tmp/drush_YotAaX --database=drupal --host=db --silent  < /tmp/drush_S0z3x6
Starting Drupal installation. This takes a while. Consider using the        [ok]
--notify global option.
Error: Call to a member function getThirdPartySetting() on null in /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationManager.php on line 98 #0 /var/www/drupal/web/core/modules/content_translation/content_translation.module(166): Drupal\content_translation\ContentTranslationManager->isEnabled('media', '')
#1 /var/www/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(501): content_translation_entity_bundle_info_alter(Array, NULL, NULL)
#2 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php(110): Drupal\Core\Extension\ModuleHandler->alter('entity_bundle_i...', Array)
#3 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php(80): Drupal\Core\Entity\EntityTypeBundleInfo->getAllBundleInfo()
#4 /var/www/drupal/web/core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php(95): Drupal\Core\Entity\EntityTypeBundleInfo->getBundleInfo('block')
#5 /var/www/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver->getDerivativeDefinitions(Array)
#6 /var/www/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#7 /var/www/drupal/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(283): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#8 /var/www/drupal/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(174): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#9 /var/www/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#10 /var/www/drupal/web/core/lib/Drupal/Core/TypedData/DataDefinition.php(193): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('field_item:stri...')
#11 /var/www/drupal/web/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(566): Drupal\Core\TypedData\DataDefinition->getClass()
#12 /var/www/drupal/web/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(555): Drupal\Core\Field\BaseFieldDefinition->getFieldItemClass()
#13 /var/www/drupal/web/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(485): Drupal\Core\Field\BaseFieldDefinition->getMainPropertyName()
#14 /var/www/drupal/web/modules/contrib/media_entity/src/Entity/Media.php(309): Drupal\Core\Field\BaseFieldDefinition->setDefaultValue('')
#15 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(204): Drupal\media_entity\Entity\Media::baseFieldDefinitions(Object(Drupal\Core\Entity\ContentEntityType))
#16 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(171): Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions('media')
#17 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(394): Drupal\Core\Entity\EntityFieldManager->getBaseFieldDefinitions('media')
#18 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityManager.php(154): Drupal\Core\Entity\EntityFieldManager->getFieldStorageDefinitions('media')
#19 /var/www/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(282): Drupal\Core\Entity\EntityManager->getFieldStorageDefinitions('media')
#20 /var/www/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1411): Drupal\Core\Entity\Sql\SqlContentEntityStorage->getTableMapping()
#21 /var/www/drupal/web/core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php(74): Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldStorageDefinitionCreate(Object(Drupal\Core\Field\BaseFieldDefinition))
#22 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityManager.php(411): Drupal\Core\Field\FieldStorageDefinitionListener->onFieldStorageDefinitionCreate(Object(Drupal\Core\Field\BaseFieldDefinition))
#23 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php(169): Drupal\Core\Entity\EntityManager->onFieldStorageDefinitionCreate(Object(Drupal\Core\Field\BaseFieldDefinition))
#24 /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationUpdatesManager.php(63): Drupal\Core\Entity\EntityDefinitionUpdateManager->installFieldStorageDefinition('content_transla...', 'media', 'content_transla...', Object(Drupal\Core\Field\BaseFieldDefinition))
#25 /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationUpdatesManager.php(77): Drupal\content_translation\ContentTranslationUpdatesManager->updateDefinitions(Array)
#26 /var/www/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\content_translation\ContentTranslationUpdatesManager->onConfigImporterImport(Object(Drupal\Core\Config\ConfigImporterEvent), 'config.importer...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#27 /var/www/drupal/web/core/lib/Drupal/Core/Config/ConfigImporter.php(644): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('config.importer...', Object(Drupal\Core\Config\ConfigImporterEvent))
#28 /var/www/drupal/web/core/lib/Drupal/Core/Config/ConfigImporter.php(488): Drupal\Core\Config\ConfigImporter->finish(Array)
#29 /var/www/drupal/web/profiles/contrib/config_installer/config_installer.profile(139): Drupal\Core\Config\ConfigImporter->doSyncStep('finish', Array)
#30 /var/www/drupal/web/core/includes/batch.inc(252): config_install_batch_process(Object(Drupal\Core\Config\ConfigImporter), 'finish', Array)
#31 /var/www/drupal/web/core/includes/form.inc(874): _batch_process()
#32 /var/www/drupal/web/core/includes/install.core.inc(625): batch_process(Object(Drupal\Core\Url), Object(Drupal\Core\Url))
#33 /var/www/drupal/web/core/includes/install.core.inc(546): install_run_task(Array, Array)
#34 /var/www/drupal/web/core/includes/install.core.inc(117): install_run_tasks(Array)
#35 /var/www/drupal/vendor/drush/drush/includes/drush.inc(726): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#36 /var/www/drupal/vendor/drush/drush/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#37 /var/www/drupal/vendor/drush/drush/commands/core/drupal/site_install.inc(84): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#38 /var/www/drupal/vendor/drush/drush/commands/core/site_install.drush.inc(254): drush_core_site_install_version('config_installe...', Array)
#39 /var/www/drupal/vendor/drush/drush/includes/command.inc(422): drush_core_site_install('config_installe...', 'config_installe...')
#40 /var/www/drupal/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#41 /var/www/drupal/vendor/drush/drush/includes/command.inc(199): drush_command('config_installe...', 'config_installe...')
#42 /var/www/drupal/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#43 /var/www/drupal/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#44 /var/www/drupal/vendor/drush/drush/drush.php(12): drush_main()
#45 {main}
Drush command terminated abnormally due to an unrecoverable error.       [error]
Error: Call to a member function getThirdPartySetting() on null in Drupal\content_translation\ContentTranslationManager->isEnabled() (line 98 of /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationManager.php).
πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Content translationΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡¨πŸ‡­Switzerland kjauslin

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡¨πŸ‡¦Canada jamesyao

    Thanks @shubham-chandra for the patch #87.
    It works well on Drupal Core 9.4.8 with PHP8.0 & Mysql 5.7.

  • πŸ‡ΊπŸ‡ΈUnited States bnjmnm Ann Arbor, MI

    Patch #87 doesn't fix anything, it instead removes the tests that are failing, but those tests are there for a reason. The correct approach would be to get those tests passing, not removing them. Work should continue from an earlier patch that includes ContentManagerTranslationTest

  • First commit to issue fork.
  • Pipeline finished with Failed
    5 months ago
    Total: 127s
    #238191
  • πŸ‡§πŸ‡ͺBelgium kriboogh

    kriboogh β†’ changed the visibility of the branch drupal-2868294-10.3 to hidden.

  • Pipeline finished with Failed
    5 months ago
    Total: 424s
    #238228
  • πŸ‡§πŸ‡ͺBelgium kriboogh

    Patch of !MR8986 (works on 11.0 and 10.3, 10.2)

  • Pipeline finished with Failed
    5 months ago
    Total: 127s
    #238248
  • Pipeline finished with Failed
    5 months ago
    Total: 115s
    #238251
  • Pipeline finished with Failed
    5 months ago
    Total: 533s
    #238252
  • πŸ‡§πŸ‡ͺBelgium kriboogh

    Tests are working now, but someone should have a look at what those test values should do...

  • Pipeline finished with Failed
    5 months ago
    Total: 766s
    #238291
  • πŸ‡§πŸ‡ͺBelgium kriboogh

    patch for MR

  • πŸ‡§πŸ‡ͺBelgium kriboogh

    I was looking a bit more into the test that is failing (data index 3). The test data uses a non existing bundle id. What happens then is loadContentLanguageSettings initially cannot find the config and then creates a new one for the non existing bundle.

    So either a couple of things should happen:
    - the test data is incorrect and tries to test a situation that can never happen, being a non existing bundle id and the hasexception flag set to false or
    - loadContentLanguageSettings should not create a config for a non existing bundle, and should return null. So loadContentLanguageSettings should check if the entity_id and bundle actually exist?

Production build 0.71.5 2024