localgovdrupal / localgov

Installation profile for the LocalGov Drupal distribution.
GNU General Public License v2.0
83 stars 18 forks source link

Error when installing demo content #494

Closed keelanfh closed 1 year ago

keelanfh commented 1 year ago

Steps to replicate

  1. Start with clean localgov_project install
  2. Install localgov_demo

Observed behaviour I see the following error: image Everything seems to work fine, and it doesn't seem to cause any actual issues, but it is a bit off-putting.

Error logs

RuntimeException while trying to render item entity:node/4:en with view mode search_index for search index Sitewide search: Failed to start the session because headers have already been sent by "/var/www/html/vendor/symfony/http-foundation/Response.php" at line 384. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 152 of /var/www/html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).

DivisionByZeroError: Division by zero in Drupal\search_api\Task\TaskManager->processBatch() (line 373 of /var/www/html/web/modules/contrib/search_api/src/Task/TaskManager.php)

0 /var/www/html/web/core/includes/batch.inc(295): Drupal\search_api\Task\TaskManager->processBatch(Array, Array, Array)

1 /var/www/html/web/core/includes/batch.inc(137): _batch_process()

2 /var/www/html/web/core/includes/batch.inc(93): _batch_do()

3 /var/www/html/web/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request))

4 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request))

5 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)

6 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()

7 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))

8 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)

9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()

10 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)

11 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

12 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

13 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

14 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)

15 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

16 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

17 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

18 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

19 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))

20 {main}

.

andybroomfield commented 1 year ago

I seem to remember a while back it being a bug trying to install via the UI (should be addressed though if we can). Could you check if you can install via the command line? drush en localgov_demo

keelanfh commented 1 year ago

Yes, that looks right. When I run that command, I just get this - one warning but no errors.

The following module(s) will be enabled: localgov_demo, default_content, localgov_alert_banner, condition_field, localgov_directories, search_api, facets, localgov_directories_db, search_api_db, localgov_directories_location, localgov_geo_address, localgov_geo, geofield, geofield_map, leaflet, geocoder, leaflet_views, localgov_directories_page, localgov_directories_venue, localgov_events, date_recur, datetime_range, date_recur_modular, localgov_geo_area, geocoder_geofield, geocoder_field, localgov_guides, localgov_news, entity_reference_facet_link, search_api_autocomplete, schema_metatag, metatag, schema_article, localgov_search, localgov_search_db, localgov_services_status, localgov_step_by_step, localgov_subsites, entity_hierarchy, dbal, entity_hierarchy_breadcrumb, layout_paragraphs, layout_discovery, localgov_subsites_paragraphs, tablefield, viewsreference, localgov_homepage_paragraphs, field_formatter_class, fontawesome, localgov_workflows, diff, preview_link, responsive_preview, scheduled_transitions, dynamic_entity_reference, localgov_review_date

 Do you want to continue? (yes/no) [yes]:
 > 

>  [notice] Message: Successfully executed 1 pending task.
> 
 [notice] Added localgov_directories_page content type to localgov_directories_channel_search_block block.
>  [notice] Message: Successfully executed 1 pending task.
> 
 [notice] Added localgov_directories_venue content type to localgov_directories_channel_search_block block.
 [success] Successfully enabled: localgov_demo, default_content, localgov_alert_banner, condition_field, localgov_directories, search_api, facets, localgov_directories_db, search_api_db, localgov_directories_location, localgov_geo_address, localgov_geo, geofield, geofield_map, leaflet, geocoder, leaflet_views, localgov_directories_page, localgov_directories_venue, localgov_events, date_recur, datetime_range, date_recur_modular, localgov_geo_area, geocoder_geofield, geocoder_field, localgov_guides, localgov_news, entity_reference_facet_link, search_api_autocomplete, schema_metatag, metatag, schema_article, localgov_search, localgov_search_db, localgov_services_status, localgov_step_by_step, localgov_subsites, entity_hierarchy, dbal, entity_hierarchy_breadcrumb, layout_paragraphs, layout_discovery, localgov_subsites_paragraphs, tablefield, viewsreference, localgov_homepage_paragraphs, field_formatter_class, fontawesome, localgov_workflows, diff, preview_link, responsive_preview, scheduled_transitions, dynamic_entity_reference, localgov_review_date
 [warning] An overlong word (more than 50 characters) was encountered while indexing: 5d77a474d548c38c30ed2891f8c59b3ea97bb74984819680d74bb4bbef390c89.<br />Since database search servers currently cannot index words of more than 50 characters, the word was truncated for indexing. If this should not be a single word, please make sure the "Tokenizer" processor is enabled and configured correctly for index Sitewide search.
andybroomfield commented 1 year ago

@finnlewis was it @ekes or @stephen-cox who was looking at this? Its the issue where directories is installing, but search is not set up correctly or something to that effect if I recall.

stephen-cox commented 1 year ago

The Demo module should not be installed through the UI on a fresh install because it will hit the PHP max execution time and max memory limits and crash. We need to make it as clear as possible that the Demo module should be enabled with Drush.

It should be possible to enable with through the UI by setting both memory_limit and max_execution_time to reasonably high numbers, but you don't want to be making these changes permanent and the exact numbers are going to depend on the environment. Installing through Drush is the most reliable method.