@@ -530,6 +530,53 @@ public function testAhoyWorkflowProvisionFallbackToProfile(): void {
530530 $ this ->logSubstep ('Assert that Shield module is enabled ' );
531531 $ this ->cmd ('ahoy drush pm:list --status=enabled --type=module --format=list ' , '* shield ' , 'Shield module should be enabled after fallback provision ' );
532532
533+ // Diagnostic probes to understand why the homepage hits the redirect
534+ // module after a fallback profile install. Each command's full output is
535+ // streamed to the test log; failures here are non-fatal so we still reach
536+ // the original assertions below.
537+ // @todo Remove once the underlying cause is understood and fixed.
538+ $ this ->logSubstep ('DEBUG: enabled modules per core.extension ' );
539+ $ this ->cmd ('ahoy drush pm:list --status=enabled --type=module --format=list ' );
540+
541+ $ this ->logSubstep ('DEBUG: core.extension config dump ' );
542+ $ this ->cmd ('ahoy drush config:get core.extension ' );
543+
544+ $ this ->logSubstep ('DEBUG: redirect module status (should be disabled after fallback) ' );
545+ $ this ->cmd ('ahoy drush pm:list --filter=redirect --format=list ' );
546+
547+ $ this ->logSubstep ('DEBUG: all DB tables ' );
548+ $ this ->cmd ('ahoy drush sql:query "SHOW TABLES" ' );
549+
550+ $ this ->logSubstep ('DEBUG: redirect-related DB tables (should be empty) ' );
551+ $ this ->cmd ('ahoy drush sql:query "SHOW TABLES LIKE \'redirect% \'" ' );
552+
553+ $ this ->logSubstep ('DEBUG: cache_container row count ' );
554+ $ this ->cmd ('ahoy drush sql:query "SELECT COUNT(*) FROM cache_container" ' );
555+
556+ $ this ->logSubstep ('DEBUG: PhpStorage layout under web/sites/default/files/php ' );
557+ $ this ->cmd ('ahoy cli "ls -la web/sites/default/files/php/ 2>/dev/null || echo NO_PHP_DIR" ' );
558+ $ this ->cmd ('ahoy cli "ls -la web/sites/default/files/php/container/ 2>/dev/null || echo NO_CONTAINER_DIR" ' );
559+ $ this ->cmd ('ahoy cli "find web/sites/default/files/php -type f 2>/dev/null | head -30 || echo NO_FILES" ' );
560+
561+ $ this ->logSubstep ('DEBUG: presence of redirect references in cached container files ' );
562+ $ this ->cmd ('ahoy cli "grep -l \"Drupal..redirect\" web/sites/default/files/php/container/*.php 2>/dev/null || echo NO_REDIRECT_IN_CONTAINER_CACHE" ' );
563+ $ this ->cmd ('ahoy cli "grep -c \"redirect.request_subscriber \\|RedirectRequestSubscriber\" web/sites/default/files/php/container/*.php 2>/dev/null || echo NO_REDIRECT_SUBSCRIBER_IN_CACHE" ' );
564+
565+ $ this ->logSubstep ('DEBUG: hash_salt and deployment_identifier ' );
566+ $ this ->cmd ('ahoy drush php:eval "print \"hash_salt=\" . substr(\Drupal\Core\Site\Settings::get(\"hash_salt\"), 0, 12) . PHP_EOL . \"deployment_identifier=\" . (\Drupal\Core\Site\Settings::get(\"deployment_identifier\") ?? \"(null)\") . PHP_EOL;" ' );
567+
568+ $ this ->logSubstep ('DEBUG: runtime active modules per Drupal kernel ' );
569+ $ this ->cmd ('ahoy drush php:eval "foreach (array_keys(\Drupal::moduleHandler()->getModuleList()) as \$m) { print \$m . PHP_EOL; }" ' );
570+
571+ $ this ->logSubstep ('DEBUG: registered path_processor_inbound services ' );
572+ $ this ->cmd ('ahoy drush php:eval "foreach (\Drupal::getContainer()->getServiceIds() as \$id) { if (str_contains(\$id, \"path_processor\") || str_contains(\$id, \"redirect\")) { print \$id . PHP_EOL; } }" ' );
573+
574+ $ this ->logSubstep ('DEBUG: last 30 watchdog entries ' );
575+ $ this ->cmd ('ahoy drush watchdog:show --count=30 || true ' );
576+
577+ $ this ->logSubstep ('DEBUG: head of homepage response ' );
578+ $ this ->cmd ('ahoy cli "curl -sS -o - -w \" \\nHTTP_STATUS=%{http_code} \\n\" http://nginx:8080/ | head -c 4000" ' );
579+
533580 $ this ->logSubstep ('Assert that homepage does not contain database dump content ' );
534581 $ this ->assertWebpageNotContains ('/ ' , 'This demo page is sourced from the Vortex database dump file ' , 'Homepage should not show database dump content after fallback provision ' );
535582
0 commit comments