Problem/Motivation

When trying to view the configuration menu or status report page of a site installed using the 'minimal' profile as a base I receive an error message:
Drupal\Core\Extension\Exception\UnknownExtensionException: The module minimal does not exist or is not installed. in Drupal\Core\Extension\ExtensionList->getExtensionInfo() (line 346 of core/lib/Drupal/Core/Extension/ExtensionList.php).

Steps to reproduce

Install a clean site using the `minimal` profile.
Login and browse to `/admin/reports/status`

Proposed resolution

The hook_requirements implementation in system.install checks the name of the installprofile, and if it is not 'standard' then it attempts to load the profile, but is attempting to load it via the `extension.list.module` service instead of the `extension.list.profile` service.

Replacing the lookup call with one that uses the proper service. appears to fix the issue.

Issue fork drupal-3293463

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

zenphp created an issue. See original summary.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative
zenphp’s picture

This does not appear to be as far as I can tell.

The install profile is properly installed and registered as an install profile and not being disabled.

It's a case where the requirements hook is attempting to load the install profile using the incorrect service.

zenphp’s picture

Status: Postponed (maintainer needs more info) » Needs review
axb’s picture

Hello,

I came across this issue in the wild, indeed when running a custom installation profile.

Confirmed what @zenphp said about requirements_hook incorrectly loading the install profile.

File modified:
core > moudles > system > system.install

Snippets changed:

  // Reset the extension lists.
  
  /** @var \Drupal\Core\Extension\ModuleExtensionList $module_extension_list */
  $module_extension_list = \Drupal::service('extension.list.module');
  $module_extension_list->reset();
  
+  /** @var \Drupal\Core\Extension\ProfileExtensionList $profile_extension_list */
+ $profile_extension_list = \Drupal::service('extension.list.profile');
+ $profile_extension_list->reset();

  /** @var \Drupal\Core\Extension\ThemeExtensionList $theme_extension_list */
  $theme_extension_list = \Drupal::service('extension.list.theme');
  $theme_extension_list->reset();
    // Display the currently active installation profile, if the site
    // is not running the default installation profile.
    $profile = \Drupal::installProfile();
    if ($profile != 'standard') {
-     $info = $module_extension_list->getExtensionInfo($profile);
+    $info = $profile_extension_list->getExtensionInfo($profile);
      $requirements['install_profile'] = [
        'title' => t('Installation profile'),
        'value' => t('%profile_name (%profile-%version)', [
          '%profile_name' => $info['name'],
          '%profile' => $profile,
          '%version' => $info['version'],
        ]),
        'severity' => REQUIREMENT_INFO,
        'weight' => -9,
      ];
    }
```

With this simple change, I was able to complete my task -- accessing the '/admin/config' page.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.

Think the next step for this would be to get a test case added.

Also will need a 10.1.x MR started.

Olarin made their first commit to this issue’s fork.

olarin’s picture

Priority: Normal » Major
Status: Needs work » Needs review

This appears to be a guaranteed issue for any new site audacious enough to attempt to use any install profile other than standard (including the core-provided minimal), and there's no workaround to my knowledge, so I think it would qualify as Major priority.

I added a MR for the 10.1.x branch. I'm not sure where to start on adding a relevant test.

smustgrave’s picture

Status: Needs review » Needs work

May be worth starting in Drupal\FunctionalTests\Installer

Did an Umami install profile yesterday without issue just fyi

johnpitcairn’s picture

Version: 9.5.x-dev » 10.2.x-dev

Just bitten by this with a minimal install. Not the first time either from memory. MR3639 does appear to fix the problem.

Is this still a 10.x candidate or does it need to be 11.x now?

Version: 10.2.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mstrelan’s picture

Status: Needs work » Postponed (maintainer needs more info)

Is this still an issue? I was unable to reproduce the issue after installing 11.x with minimal profile. I put a breakpoint in \Drupal\system\Install\Requirements\SystemRequirements::checkRequirements after $info = $module_extension_list->getExtensionInfo($profile); and can see the profile info has been loaded.

acbramley’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Seeing the same as #15 when following those steps.

Closing this out for now, if you are able to reproduce this on HEAD then please feel free to reopen and provide the steps. Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.