Andreas
Andreas

Reputation: 2193

Sulu Massive Search Bundle exception

after calling in bash

bin/adminconsole -vvv massive:search:reindex && bin/websiteconsole massive:search:reindex

we get in our sulu 1.6 soon to be production environment the following permanent error:

provider "doctrine_orm"

-- reindexing "0" instances of "Sulu\Bundle\ContactBundle\Entity\Account"

    0 [>---------------------------] < 1 sec 22.0 MiB

-- reindexing "5" instances of "Sulu\Bundle\ContactBundle\Entity\Contact"

 5/5 [============================] 100% < 1 sec/< 1 sec 26.0 MiB

-- reindexing "15" instances of "Sulu\Bundle\MediaBundle\Entity\FileVersionMeta"

 15/15 [============================] 100% < 1 sec/< 1 sec 26.0 MiB

-- reindexing "0" instances of "Sulu\Bundle\CategoryBundle\Entity\CategoryTranslation"

    0 [>---------------------------] < 1 sec 26.0 MiB

provider "sulu_structure"

-- reindexing "5" instances of "Sulu\Bundle\ContentBundle\Document\HomeDocument"

 0/5 [>---------------------------]   0% < 1 sec/< 1 sec 30.5 MiB[2019-10-07 23:56:19] console.ERROR: Error thrown while running command "-vvv massive:search:reindex". Message: "Call to a member function getLocalization() on null" {"exception":"[object] (Error(code: 0): Call to a member function getLocalization() on null at /app/vendor/sulu/sulu/src/Sulu/Component/Content/Compat/LocalizationFinder.php:40)","command":"-vvv massive:search:reindex","message":"Call to a member function getLocalization() on null"} []
23:56:19 ERROR     [console] Error thrown while running command "-vvv massive:search:reindex". Message: "Call to a member function getLocalization() on null"
[
  "exception" => Error {
    #message: "Call to a member function getLocalization() on null"
    #code: 0
    #file: "./vendor/sulu/sulu/src/Sulu/Component/Content/Compat/LocalizationFinder.php"
    #line: 40
    trace: {
      ./vendor/sulu/sulu/src/Sulu/Component/Content/Compat/LocalizationFinder.php:40 { …}
      ./vendor/sulu/sulu/src/Sulu/Component/Content/Document/Subscriber/FallbackLocalizationSubscriber.php:118 { …}
      ./vendor/sulu/sulu/src/Sulu/Component/Content/Document/Subscriber/FallbackLocalizationSubscriber.php:93 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:214 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:44 { …}
      ./vendor/sulu/document-manager/lib/Collection/QueryResultCollection.php:85 { …}
      ./vendor/sulu/sulu/src/Sulu/Bundle/ContentBundle/Search/Reindex/StructureProvider.php:105 { …}
      ./vendor/massive/search-bundle/Command/ReindexCommand.php:200 { …}
      ./vendor/massive/search-bundle/Command/ReindexCommand.php:150 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:255 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:981 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:254 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:147 { …}
      ./bin/console.php:23 {
        › $application = new Application($kernel);
        › $application->run($input);
        › 
        arguments: {
          $input: Symfony\Component\Console\Input\ArgvInput {#1 …}
        }
      }
      ./bin/adminconsole:7 { …}
    }
  },
  "command" => "-vvv massive:search:reindex",
  "message" => "Call to a member function getLocalization() on null"
]

I did remove already manually var/indexes, but the issue prevails.

I have search tags <tag name="sulu.search.field" /> added to text_line, text_editor fields.

Has anybody experience in resolving this issue?

locally I fixed it by droping and reinizializing the complete database but in our staging system I would rather not like to do it this way ;).

Thx a lot!

Upvotes: 0

Views: 576

Answers (1)

Alexander Schranz
Alexander Schranz

Reputation: 2460

Make sure with the following commands that no webspace data of a removed or renamed webspace still exists:

bin/adminconsole doctrine:phpcr:shell 'query "SELECT jcr:uuid FROM [nt:base] AS n WHERE ISCHILDNODE(n, \'/cmf\')"'
bin/websiteconsole doctrine:phpcr:shell 'query "SELECT jcr:uuid FROM [nt:base] AS n WHERE ISCHILDNODE(n, \'/cmf\')"'

If there is still old data of a removed webspace use the following commands to remove it:

bin/adminconsole doctrine:phpcr:node:remove /cmf/oldwebspacekey
bin/websiteconsole doctrine:phpcr:node:remove /cmf/oldwebspacekey

Its recommended to create a backup before running the remove commands.

Upvotes: 1

Related Questions