Error when using together with Lunr search module

Created on 25 July 2024, 8 months ago
Updated 31 July 2024, 7 months ago

Problem/Motivation

Previously I posted an issue in the Lunr search module thinking that there was the problem I have, this is the issue I am referring to:

https://www.drupal.org/project/lunr/issues/3462510 🐛 Indexing does not work from the command line Active

I am posting this new issue to give more context and explain why it is related to this other module, because when I run a feature of the Lunr search module from the command line that is used to index search data, I repeatedly get the following error in watchdog:

Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Session has not been set. in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of ./vendor/symfony/http-kernel/HttpKernel.php).

That happened to me on a site where I have installed many modules, at first I thought it was due to some change in Drupal 10 and the new version of Symfony, but I decided to test the Lunr search module in a new installation of Drupal 10.3.1 and there it worked correctly, so I considered that the problem could be due to some hook or event generated by another module and in the site that gave me the error I was disabling modules until I identified that the error stopped occurring by disabling the Password Policy module, I mean the main one, not its submodules.

Therefore, I am posting the issue here because I believe that some functionality of Password Policy is interfering with Lunr search, although I have not yet identified which of the two modules should be fixed.

Steps to reproduce

  1. Install and active Password Policy
  2. Install and active Lunr search
  3. Create some content to populate default Lunr search
  4. In command line go to path: web/modules/contrib/lunr
  5. Run command: node js/index.node.js default (nodejs is required to run this command)

The expected result from above command is the following:

Indexing Lunr search default...
Indexed 0 pages for /en/lunr_filters_default.
Indexed 0 pages for /es/lunr_filters_default.
Finished indexing! 🎊

But instead it will just display the following message and log in watchdog the php error I put at the beginning of the issue.

Indexing Lunr search default...

Proposed resolution

None yet.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇲🇽Mexico ovilla

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

Comments & Activities

  • Issue created by @ovilla
  • First commit to issue fork.
Production build 0.71.5 2024