Problem/Motivation

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 142 of .../web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

#0 .../web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(260): Drupal\Core\Entity\EntityTypeManager->getDefinition()
#1 .../web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(195): Drupal\Core\Entity\EntityTypeManager->getHandler()
#2 .../web/modules/contrib/linkchecker/src/Entity/LinkCheckerLink.php(186): Drupal\Core\Entity\EntityTypeManager->getStorage()
#3 .../web/modules/contrib/linkchecker/src/LinkCheckerLinkAccessControlHandler.php(68): Drupal\linkchecker\Entity\LinkCheckerLink->getParentEntity()
#4 .../web/modules/contrib/linkchecker/src/LinkCheckerLinkAccessControlHandler.php(58): Drupal\linkchecker\LinkCheckerLinkAccessControlHandler->checkParentEntityAccess()
#5 .../web/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php(343): Drupal\linkchecker\LinkCheckerLinkAccessControlHandler->checkFieldAccess()
#6 .../web/core/lib/Drupal/Core/Field/FieldItemList.php(154): Drupal\Core\Entity\EntityAccessControlHandler->fieldAccess()
#7 .../web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(256): Drupal\Core\Field\FieldItemList->access()
#8 .../web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(282): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple()
#9 .../web/core/modules/views/src/Entity/Render/EntityFieldRenderer.php(257): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple()
#10 .../web/core/modules/views/src/Entity/Render/EntityFieldRenderer.php(143): Drupal\views\Entity\Render\EntityFieldRenderer->buildFields()
#11 .../web/core/modules/views/src/Plugin/views/field/EntityField.php(873): Drupal\views\Entity\Render\EntityFieldRenderer->render()
#12 .../web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1195): Drupal\views\Plugin\views\field\EntityField->getItems()
#13 .../web/core/modules/views/views.theme.inc(238): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender()
#14 [internal function]: template_preprocess_views_view_field()
#15 .../web/core/lib/Drupal/Core/Theme/ThemeManager.php(261): call_user_func_array()
#16 .../web/core/lib/Drupal/Core/Render/Renderer.php(490): Drupal\Core\Theme\ThemeManager->render()
#17 .../web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#18 .../web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1796): Drupal\Core\Render\Renderer->render()
#19 .../web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(769): Drupal\views\Plugin\views\field\FieldPluginBase->theme()
#20 [internal function]: Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow()
#21 .../web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(113): call_user_func_array()
#22 .../web/core/lib/Drupal/Core/Render/Renderer.php(886): Drupal\Core\Render\Renderer->doTrustedCallback()
#23 .../web/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Render\Renderer->doCallback()
#24 .../web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#25 .../web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(708): Drupal\Core\Render\Renderer->render()
#26 .../web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(574): Drupal\views\Plugin\views\style\StylePluginBase->renderFields()
#27 .../web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(462): Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping()
#28 .../web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2177): Drupal\views\Plugin\views\style\StylePluginBase->render()
#29 .../web/core/modules/views/src/ViewExecutable.php(1600): Drupal\views\Plugin\views\display\DisplayPluginBase->render()
#30 .../web/core/modules/views/src/Plugin/views/display/Page.php(201): Drupal\views\ViewExecutable->render()
#31 .../web/core/modules/views/src/ViewExecutable.php(1697): Drupal\views\Plugin\views\display\Page->execute()
#32 .../web/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay()
#33 [internal function]: Drupal\views\Element\View::preRenderViewElement()
#34 .../web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(113): call_user_func_array()
#35 .../web/core/lib/Drupal/Core/Render/Renderer.php(886): Drupal\Core\Render\Renderer->doTrustedCallback()
#36 .../web/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Render\Renderer->doCallback()
#37 .../web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#38 .../web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(238): Drupal\Core\Render\Renderer->render()
#39 .../web/core/lib/Drupal/Core/Render/Renderer.php(637): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#40 .../web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(231): Drupal\Core\Render\Renderer->executeInRenderContext()
#41 .../web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#42 .../web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#43 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#44 .../web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#45 .../vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#46 .../vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#47 .../web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#48 .../web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#49 .../web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#50 .../web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#51 .../web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#52 .../web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#53 .../web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#54 .../web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#55 .../web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#56 .../web/index.php(19): Drupal\Core\DrupalKernel->handle()
#57 {main}

Steps to reproduce

The composer.json file removed the DER dependency. Maybe this is the cause of the issue?

Visit /admin/reports/linkchecker

Workaround

Run drush linkchecker:clear to clear all link data and analyze content for links. Custom link check settings will be deleted.

You can also do this in the UI. Go to the Linkchecker settings page, go to the maintenance section at the bottom, and click the button to clear/delete all links and reanalyze the content for links.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

solideogloria created an issue. See original summary.

solideogloria’s picture

I had to remove all link entities and reanalyze content for links. Then it works.

jlancaster’s picture

Similar issues. I quickly realized no content edits would save on site, producing a parent_entity_type_id not found error. I manually enabled dynamic entity reference after seeing it in missing modules report.
composer require 'drupal/dynamic_entity_reference:^3.2'

But the error remains for core broken links reports:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 142 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
solideogloria’s picture

@jlancaster, yes that's exactly what I had happen. Same errors. To fix it, delete all links and reanalyze content for links. I also upgraded to 2.1.x and removed dynamic_entity_reference

jlancaster’s picture

Ahh, you had me curious and confused because I had no idea what "delete all links and reanalyze content" meant (shows how often I use linkchecker). If anyone else sees this, I found what is being referenced at /admin/config/content/linkchecker in the "Maintenance" section the button says "Clear link data and analyze content for links." Once I ran this everything is good... minus waiting for content to reanalyze. That said, the missing dependency for DER is concerning and I'd like to manually not have to include it.

solideogloria’s picture

Yeah, 2.1.x doesn't use DER anymore, so I figured it was a good time to upgrade.

paulmckibben’s picture

Confirming the instructions in #5 from @jlancaster cleared the problem up for me. Thank you!

solideogloria’s picture

Issue summary: View changes

Added workaround info to IS

adriancotter’s picture

"Clear link data and analyze content for links" did not work for me. The view report is still throwing the same error. I don't see any obvious problems in the views configuration.

The dynamic_entity_reference module is still enabled on my site. It is used by other modules, so it is not something I can remove.

solideogloria’s picture

Did you try uninstalling and reinstalling the Linkchecker module?

adriancotter’s picture

I really really wanted to avoid reinstalling the Linkchecker module -- having to set up all the fields again would be a super pain. (I guess I'd be able to reinstall field configs, but that would still be a bunch of time)

Beyond having to delete all the old checked links, the view needed some updates as well. What I ended up doing was exporting the view from one my one simple site (where I did end up uninstalling and installing), and then (making sure I had the UUID correct) importing it into the other site.

dgwolf’s picture

The same bug bit me on D10.5.1 when upgrading 2.0.0 to 2.0.2
After reading this thread, downgrading, upgrading and updating the db, clearing caches I did not to go to the report but called "Clear link data and analyze content for links". Maybe this error message provides some more information?

Ein AJAX-HTTP-Fehler ist aufgetreten.
HTTP-Rückgabe-Code: 500
Im Folgenden finden Sie Debugging-Informationen.
Pfad: /batch?id=211&op=do_nojs&op=do
Statustext: error
[message "unexpected error ..." in German]
Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id__target_id' in 'NEW': INSERT INTO "linkchecker_link" ("status", "urlhash", "url", "method", "code", "error", "fail_count", "last_check", "entity_field", "entity_langcode", "uuid", "parent_entity_type_id", "parent_entity_id") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array
(
[:db_insert_placeholder_0] => 1
[:db_insert_placeholder_1] => 9tazkp-ufKs0nSgxt3CsIxKNiazvXgYeERn5eLZN_Xw
[:db_insert_placeholder_2] => https://mysite.tld/somepage-with-an-outdated-link-in-it
[:db_insert_placeholder_3] => HEAD
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] =>
[:db_insert_placeholder_6] => 0
[:db_insert_placeholder_7] =>
[:db_insert_placeholder_8] => body
[:db_insert_placeholder_9] => und
[:db_insert_placeholder_10] => f8c0d5e4-0ac7-44c2-bf98-1097fd3b96e7
[:db_insert_placeholder_11] => node
[:db_insert_placeholder_12] => 3
)
in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). Drupal\Core\Database\StatementWrapperIterator->execute(Array, Array) (Line: 44)
Drupal\mysql\Driver\Database\mysql\Insert->execute() (Line: 948)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doSaveFieldItems(Object) (Line: 718)
Drupal\Core\Entity\ContentEntityStorageBase->doSave(NULL, Object) (Line: 486)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 383)
Drupal\linkchecker\LinkExtractorService->saveLink(Object) (Line: 356)
Drupal\linkchecker\LinkExtractorService->saveLinkMultiple(Array) (Line: 142)
Drupal\linkchecker\LinkExtractorBatch->processEntities(50) (Line: 224)
Drupal\linkchecker\LinkExtractorBatch->batchProcessEntities(50, Array) (Line: 297)
_batch_process() (Line: 139)
_batch_do() (Line: 95)
_batch_page(Object) (Line: 52)
Drupal\system\Controller\BatchController->batchPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
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: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 263)
Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 219)
Drupal\shield\ShieldMiddleware->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)

nsciacca’s picture

I had the same issue and I found it was the View config that was stored in the code that was the problem. The view itself needs to be updated, so if you copy it from the module's config directory, or uninstall the module, delete the existing Broken Links report view, then re-install the module and export the new config you should be good to go.

dgwolf’s picture

Thanks, @nsciacca. I am still struggling on D10.5.1 with linkchecker 2.0.2.

Not sure what you meant by "delete the existing Broken Links report view" *after* unstalling the module. Running drush lccl (or the equivalent from the broken links page) works flawlessly on 2.0.0 but throws the errors on 2.0.2. Or did I misunderstand what you meant? Here is what I did this time:

I completely uninstalled 2.0.0 that was working as expected. I cleared all caches, ran cron, newly installed with composer 2.0.2, upgraded the database (here is the update output from drush):

> [notice] Update started: linkchecker_update_8003
> [notice] Update completed: linkchecker_update_8003
> [notice] Update started: linkchecker_update_8004
> [notice] Entities are updating: finished 10 of 32.
> [notice] Entities are updating: finished 20 of 32.
> [notice] Entities are updating: finished 30 of 32.
> [notice] Entities are updating: finished 32 of 32.
> [notice] Update completed: linkchecker_update_8004
> [notice] Update started: linkchecker_update_8005
> [notice] Update completed: linkchecker_update_8005
> [notice] Update started: linkchecker_update_8006
> [notice] Linkchecker links are updating: finished 0 of 0.
> [notice] Update completed: linkchecker_update_8006
> [notice] Update started: linkchecker_update_8007
> [notice] The entity_id field storage definition successfully uninstalled.
> [notice] Update completed: linkchecker_update_8007
> [notice] Batch process has consumed in excess of 60% of available memory. Starting new thread
> [notice] Update started: linkchecker_post_update_remove_orphaned_queue_data
> [notice] Update completed: linkchecker_post_update_remove_orphaned_queue_data
[success] Finished performing updates.

Cleared caches, and then running drush lccl throws again the same database errors as quoted in #12,

drush lccl
> [error] Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id__target_id' in 'NEW': INSERT INTO "linkchecker_link" ("status", "urlhash", "url",

etc., as above, this time ending with

> In StatementWrapperIterator.php line 113:
>
> SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id__target_id' in
> 'NEW'
>
> In ProcessBase.php line 155:
> Output is empty.

Could it be that the database upgrade is slightly off for D10.5.* while working well for D11? Or am I overlooking sth. obvious?

j_s’s picture

Ran into the same issue on Drupal 10.4. Following the suggestions in #5 fixed it for me. It would've been nice if the module itself fixed the issue.

dgwolf’s picture

Thanks, j_s. You are on Drupal 10.4 but I am on 10.5.1, which may make a difference or not. In any event, I can no longer even clear and re-analyze anything because when I do so I get the error that a database column cannot be found, and removing linkchecker as well as dynamic_entity_reference and then installing linkchecker 2.0.2, applying of course all the database upgrades for 2.0.2 simply does not help. I have tried several times meanwhile to upgrade copies of my functioning live site with 2.0.0 (with a deprecation notice, see at the bottom), removing DER, adding it in again, to no avail. Having beforehand cleared the site of the 2.0.0 module gives me an empty 2.0.2 linkchecker report to begin with, and trying to create a report through the maintenance functions results invariably in this error message:

Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id__target_id' in 'NEW': INSERT INTO "linkchecker_link" ("status", "urlhash", "url", [... etc., longer quote above]

Should I take this to a separate bug report as the solution from #5 does not work and it seems database related?

For completeness' sake, here is also the deprecation notice from 2.0.0 which is still functional in the identical production environment. I get it when opening the configuration page, plus a few more when changing and saving the configuration. Maybe this sheds some light on what may be the problem with 2.0.2:

Deprecated function: Creation of dynamic property Drupal\linkchecker\Form\LinkCheckerAdminSettingsForm::$moduleHandler is deprecated in Drupal\linkchecker\Form\LinkCheckerAdminSettingsForm->__construct() (line 96 of modules/contrib/linkchecker/src/Form/LinkCheckerAdminSettingsForm.php).

Drupal\linkchecker\Form\LinkCheckerAdminSettingsForm->__construct() (Line: 104)
Drupal\linkchecker\Form\LinkCheckerAdminSettingsForm::create() (Line: 41)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 263)
Drupal\shield\ShieldMiddleware->bypass() (Line: 130)
Drupal\shield\ShieldMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

joseph.olstad’s picture

joseph.olstad’s picture

Hmm, ok sorry I mis-read the issue title, this isn't a duplicate.

dgwolf’s picture

@joseph.olstad - Thanks for trying to help. As the error changed with new 7 August DER 4.0-dev update I created https://www.drupal.org/project/dynamic_entity_reference/issues/3540397 - Meanwhile it seems to me the issue could be a DER problem limited to D10.5 and perhaps dot versions not much earlier, especially in the light of https://www.drupal.org/project/dynamic_entity_reference/issues/3056416.

dgwolf’s picture

Update: On D10.5.2 I when clearing links and screening for broken links through the maintenance funktion I get the messages above the following error messages as before (1054 ...)

Links were successfully checked.
Links were not extracted.

Maybe this points in a helpful direction.

kyber’s picture

Figured I might as well document my stumbling progress towards solving this.
We began by updating from drupal 10.3.8 and linkchecker 2.0.0 to drupal 10.5.3 and linkchecker 2.0.2
We got an error in #8004 that field_item:dynamic_entity_reference does not exist.
Fine, we add back in dynamic_entity_reference.

We rerun update. 8004 errors again, this time because parent_entity_type_id does not exist.
I find the comments here, which suggest running the delete operation from the maintenance area of the module. That errors as well, for the same reason, since LinkCleanUp.php in 2.0.2 is also trying to use parent_entity_type_id which does not exist yet.

Reviewing the install file, it seems that 8005 creates this new field.
In desperation, I moved 8005's code to the top of 8004 in the .install file (since 8004 was failing on trying to find it).

This worked, and 8004 completed successfully.

However, 8006 now fails with entity_id not found on line 369 of Tables.php

Reading 8006 it seems to be attempting a cleanup operation for entity_id.
Since this is apparently erroring due to not existing, I just gave up and completely commented out 8006 - presumably there's nothing to clean up if it doesn't exist, and it's just failing right now anyway.

After doing this, the updates (finally) completed.

However this is super hackish, and I don't feel I should be doing it on the production layout, although of course I could write a patch for it easily enough.

I'm not sure what exactly is going on here, but I get the feeling that the current order of operations is a little fragile. Perhaps it expects a very specific update sequence?

Anyway, wrote it all up here in case it offers any clues to devs or other users.

[deleted comment I made here about view errror that might be due to a config decision made by someone in past will restore if it turns out to be actually related to this module's update process ... confirmed, the view worked fine once it was reloaded with the 2.0.2 variant - all the other issues though still apply]

dgwolf’s picture

Thanks, I‘m just a plain user but it‘s good to learn why there hasn‘t been a resolution yet. Wish I could help.

joseph.olstad’s picture

I recommend to anyone seeing this issue, please switch to linkchecker 2.1.0-beta1 or newer

2.1.0-beta1 does not have DER and will not have this problem. The very complex DER module (dynamic_entity_reference) module is no longer a requirement in version 2.1.0 versions of linkchecker.

I recommend to everyone to upgrade to 2.1.x

In order to flush out (uninstall) DER for the linkchecker 2.1.0-beta1 or newer upgrade, you'll need to temporarily require (ironically) the dynamic_entity_reference module (composer require drupal/dynamic_entity_reference and then composer require drupal/linkchecker:'^2.1@beta)

kyber’s picture

Typically try not to put production systems on a beta.
Also I'd swear another bug had a comment saying that 2.1 was only focusing on D11, not D10.

Is it safe to put 2.1 beta on D10? We can't switch to D11 yet (Drupal deliberately deprecating the PHP of Debian stable, so we're going to have to test out SURY solution)

solideogloria’s picture

Is it safe to put 2.1 beta on D10?

Yes. I use it on D10.

kyber’s picture

Bit of an update. Based on recommendation in past couple of comments, tried updating directly to 2.1 instead of 2.0

update.php still failed with:
Update #8006
Failed: Drupal\Core\EntityQuery\QueryException: 'entity_id' not found in Drupal\Core\Entity\Sql\Tables->ensureEntityTable() (line 369 of /var/www/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php)

Based on prior experiments, I can fix this by adjusting the update functions which are failing to check that things exist before attempting to run updates, but, honestly, this is getting a bit too flakey.
We're just going to remove linkchecker for now.

solideogloria’s picture

A fresh module install shouldn't have any issues. If you remove it then re-add the module, it should work.

kyber’s picture

Yeah, that's a bit more complicated than it should be due to the way the folk set this up here, and will require 2 production deploys of the docker, one to remove it, one to add it back, but will consider that as an option.

But the updater is clearly broken and should maybe check to see if the db column it is trying to remove even exists. Why that column doesn't exist, no idea, but perhaps due to some prior action higher up the chain.

BTW, I was doing complete reverts of the entire dev environment before attempting linkchecker update, including the db.

solideogloria’s picture

DER was removed, but the content depends on it. You have to remove all link data then rescan if you don't want it to break. That's the entire reason for this issue, and it's the workaround mentioned in comment #2.

kyber’s picture

I added DER back in after encountering this issue (that's also mentioned in the comments above - recommendation to remove it after completing the upgrade).
It's in the config now, and I'm not hitting issues on that missing dep anymore.

The problem I'm having now is the function linkchecker_update_8006 in linkchecker.install failing due to attempting to execute a removal of entity_id without checking to see that that entity ID exists.

solideogloria’s picture

Do you get the same error as in the issue summary when you view the report? If not, maybe open a separate issue.

kyber’s picture

Initially I got the same issue. It was one of 2 failures I documented in the update procedure.
After rolling back, and running the update with DER enabled, it solved the problem.

I only added an additional update today about the 8006 failure because I had reported it in concert with the DER failure in this issue previously since I thought the 2 were related (now it seems unlikely).

And, alright. I'll make another issue.