Problem/Motivation

This is a regression caused by #2208429: Extension System, Part III: ExtensionList, ModuleExtensionList and ProfileExtensionList.

system_get_info() used to return the module name passed in even when it was handed something invalid. ModuleHandler::getName() used to call it, when it was changed to call ExtensionList::getName() directly, that behaviour wasn't preserved.

The issue is that the module list always includes the profile (for example on an 8.5 site I have locally, 'standard' is in core.extension.yml as a module). However the newly added extension list only has the profile as a profile.

I found #2939904: Fix system_get_info() for non-installed modules. ModuleHandler::getName() used to call system_get_info(), but now it calls ExtensionList() directly, so it needs to catch the exception too.

Proposed resolution

If an invalid module name is passed, catch the exception and return the raw module name passed in.

The root cause here is that profiles are sometimes treated as modules and sometimes not, #3023133: [PP-1] Extension System, Part V: Decouple profiles from modules is one issue trying to deal with that, but this is critical bug and clear regression.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Original report

I recently upgraded from Drupal 8.5.6 to 8.6.1 and everything appeared to go well. But I noticed today that when attempting to edit a view or review the user list on the site, I received this message:

Drupal\Core\Extension\Exception\UnknownExtensionException: The module minimal does not exist. in Drupal\Core\Extension\ExtensionList->get() (line 257 of /core/lib/Drupal/Core/Extension/ExtensionList.php).

I happened to be on the Status page for the install and noted the installation profile looked liked this:

Screen Capture of 8.6.1 status page displaying lack of install profile

This is what appears in the error log:

Uncaught PHP Exception Drupal\Core\Extension\Exception\UnknownExtensionException: "The module minimal does not exist." at /core/lib/Drupal/Core/Extension/ExtensionList.php line 257

So it looks like the install profile was removed when the upgrade was conducted.

Comments

Shane Birley created an issue. See original summary.

cilefen’s picture

Version: 8.6.1 » 8.6.x-dev
Component: install system » extension system
Category: Support request » Bug report
Issue tags: -installation, -upgrade, -install profile
Related issues: +#3000293: User warning: The following profile is missing from the file system: xxx in drupal_get_filename() (line 276 of core/includes/bootstrap.inc).
shane birley’s picture

An update for this issue. I was digging around in the repository and I noticed that the file is still present in Drupal 8.5.x (at least in my files) and when I did the upgrade to 8.6.x the file was still there and it was used.

I have a suspicion the Acquia Dev Desktop software flubbed the install or the upgrade somewhere. A quick fix to this particular issue is to generate the file and place it back into that directory.

But moving forward, I should be removing the file in a future upgrade but where can I adjust the settings to make sure the upgrade uses the appropriate setup?

cilefen’s picture

@Shane Birley To which file are you referring?

shane birley’s picture

Ack. The problem has returned.

The file in question is: minimal.install in /core/profiles/minimal

shane birley’s picture

I placed the file into the directory and the problem appeared to be rectified. But after a cron run, the issue has returned.

There must be a process where I can reset the install profile correctly and remove the file that appears to have started the problem.

Update

At the moment, it appears to only be affecting the /admin/people page. Still digging.

Update II

Noted this on the status page. Hadn't seen it before.

Drupal 8 no longer uses the $settings['install_profile'] value in settings.php and it can be removed.

ravi.sidd’s picture

Hi

I am getting the following error when try to upgrade from 8.5.6 to 8.6.1

In ExtensionList.php line 257:

[Drupal\Core\Extension\Exception\UnknownExtensionException]
The profile Array does not exist.

Can someone suggest anything around this?

cilefen’s picture

That could be the problem. This change record may be involved: https://www.drupal.org/node/2538996

shane birley’s picture

StatusFileSize
new6.95 KB

Using the information from issue 2538996, I have:

  • Removed the minimal.install file from the profiles folder.
  • Commented out the profile entry in the settings.php file.
  • Cleared the caches.

Screen capture featuring a change the status page.

The noted change on the status page is the installation profile has changed from "(-)" to "minimal-". It should be displaying "minimal-8.6.1".

shane birley’s picture

After making these changes, the site appears to restore functionality (no more white screens of death on certain pages). But two errors are now being generated in watchdog.

Error 1:

Notice: Undefined index: name in system_requirements() (line 52 of /core/modules/system/system.install) 
#0 /core/includes/bootstrap.inc(584): _drupal_error_handler_real(8, 'Undefined index...', '/...', 52, Array) 
#1 /core/modules/system/system.install(52): _drupal_error_handler(8, 'Undefined index...', '/...', 52, Array) 
#2 [internal function]: system_requirements('runtime') 
#3 /core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array('system_requirem...', Array) 
#4 /core/modules/system/src/SystemManager.php(112): Drupal\Core\Extension\ModuleHandler->invokeAll('requirements', Array) 
#5 /core/modules/system/src/Controller/SystemInfoController.php(49): Drupal\system\SystemManager->listRequirements() 
#6 [internal function]: Drupal\system\Controller\SystemInfoController->status() 
#7 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) 
#8 /core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
#9 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) 
#10 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) 
#11 /vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
#12 /vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) 
#13 /core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#14 /core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#15 /core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#16 /core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#18 /core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#19 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#20 /core/lib/Drupal/Core/DrupalKernel.php(665): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#21 /index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) 
#22 {main}.

Error 2:

Notice: Undefined index: name in system_requirements() (line 52 of /core/modules/system/system.install)
#0 /core/includes/bootstrap.inc(584): _drupal_error_handler_real(8, 'Undefined index...', '/...', 52, Array) 
#1 /core/modules/system/system.install(52): _drupal_error_handler(8, 'Undefined index...', '/...', 52, Array) 
#2 [internal function]: system_requirements('runtime') 
#3 /core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array('system_requirem...', Array) 
#4 /core/modules/system/src/SystemManager.php(112): Drupal\Core\Extension\ModuleHandler->invokeAll('requirements', Array) 
#5 /core/modules/system/src/Controller/SystemInfoController.php(49): Drupal\system\SystemManager->listRequirements() 
#6 [internal function]: Drupal\system\Controller\SystemInfoController->status() 
#7 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) 
#8 /core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
#9 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) 
#10 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) 
#11 /vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
#12 /vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#13 /core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#14 /core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#15 /core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#16 /core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#17 /core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#18 /core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#19 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /core/lib/Drupal/Core/DrupalKernel.php(665): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#21 /index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#22 {main}.

I haven't followed these down the rabbit hole yet.

cilefen’s picture

shane birley’s picture

For my records here, after a couple of days, this error resurfaces when accessing /admin/people:

Drupal\Core\Extension\Exception\UnknownExtensionException:
The module minimal does not exist. in Drupal\Core\Extension\ExtensionList->get()
(line 257 of /core/lib/Drupal/Core/Extension/ExtensionList.php).

Clearing the cache fixes it. Then reappears a day or two later.

myriam_b’s picture

Do you find a solution ? Same problem with standard profile.

catch’s picture

Priority: Normal » Critical
Related issues: +#3005074: The module standard does not exist

Bumping to critical. Marking #3005074: The module standard does not exist as duplicate.

googletorp’s picture

It would be helpful to know how your core.extensions.yml configuration looks like. I have a hunch this might be related to some of the changes done in 8.3.x. I remember having similar issues back then, but not quite the same.

myriam_b’s picture

I looked at my core.extensions.yml and found this line: "profile: standard", is it required ?

googletorp’s picture

Re #16

Do you mind sharing it. Also very important that what you get is your active configuration in case you use yml files to sync configs from dev to production in which case your files might not reflect the state of your site 100%.

asghar’s picture

Hi All,

I upgraded the 8.5.6 to 8.6.1 with lando(docker) development environment and could not produce the error. I used the fresh version of 8.5.6 and upgraded to 8.6.1. Everything working fine. Thanks

badzilla’s picture

I got the same symptoms as https://www.drupal.org/project/drupal/issues/3005074 with the message 'The module standard does not exist'. I commented out the profile reference in settings.php with #$settings['install_profile'] = 'standard';
then
drush cr
and that solved the problem for me.

ConradFlashback’s picture

Same error, I have not updated the core but only migrated the site to another database with a simple settings.php change.

Drupal\Core\Extension\Exception\UnknownExtensionException: The module standard does not exist. in Drupal\Core\Extension\ExtensionList->get() (line 257 of /home/core/lib/Drupal/Core/Extension/ExtensionList.php).

In the status panel I have this:

INSTALLATION PROFILE (-)

I've commented this as suggested by #19

$settings['install_profile'] = 'standard';

but nothing.

[EDIT]

I've run update.php and it works.

asghar’s picture

Hi @ConradFlashback,

Are you facing issue on Acquia Dev Desktop(https://dev.acquia.com/downloads)?. I tried on Lando but could not produce the error. Thanks

asghar’s picture

As mentioned in the settings.php

/**
 * The active installation profile.
 *
 * Changing this after installation is not recommended as it changes which
 * directories are scanned during extension discovery. If this is set prior to
 * installation this value will be rewritten according to the profile selected
 * by the user.
 *
 * @see install_select_profile()
 *
 * @deprecated in Drupal 8.3.0 and will be removed before Drupal 9.0.0. The
 *   install profile is written to the core.extension configuration. If a
 *   service requires the install profile use the 'install_profile' container
 *   parameter. Functional code can use \Drupal::installProfile().
 */
# $settings['install_profile'] = '';

I think we can fix this by commeting *$settings['install_profile'] = '';* line.

ConradFlashback’s picture

Hi asghar

No I'm not in Acquia.

shane birley’s picture

I have already removed my settings.php entry but the problem persists. Just want to point out that the removal of the entry in settings.php is not the only solve.

catch’s picture

StatusFileSize
new546 bytes
Uncaught PHP Exception Drupal\Core\Extension\Exception\UnknownExtensionException: "The module minimal does not exist." at /core/lib/Drupal/Core/Extension/ExtensionList.php line 257

It would help to get a backtrace from when this error occurs. If you don't know how to get one, this is a quick way - in ExtensionList.php, or apply the attached files using patch p1 < backtrace.txt

public function get($extension_name) {
$extensions = $this->getList();
if (isset($extensions[$extension_name])) {
return $extensions[$extension_name];
}

$e = new \Exception();
print_r($e->getTraceAsString());exit;

throw new UnknownExtensionException("The {$this->type} $extension_name does not exist.");
}

Obviously remove this change after you've got the backtrace.

joachim’s picture

Here is my backtrace of the crash on admin/modules

This is on a plain Drupal core site that I use for working on core patches. It was installed with the 'standard' distribution and I recently updated it to 8.7.x from (IIRC) 8.5.x.

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Extension\Exception\UnknownExtensionException</em>: The module standard does not exist. in <em class="placeholder">Drupal\Core\Extension\ExtensionList-&gt;get()</em> (line <em class="placeholder">257</em> of <em class="placeholder">core/lib/Drupal/Core/Extension/ExtensionList.php</em>). <pre class="backtrace">Drupal\Core\Extension\ExtensionList-&gt;getName(&#039;standard&#039;) (Line: 780)
Drupal\Core\Extension\ModuleHandler-&gt;getName(&#039;standard&#039;) (Line: 226)
Drupal\user\PermissionHandler-&gt;getModuleNames() (Line: 204)
Drupal\user\PermissionHandler-&gt;sortPermissions(Array) (Line: 110)
Drupal\user\PermissionHandler-&gt;getPermissions() (Line: 119)
Drupal\user\PermissionHandler-&gt;moduleProvidesPermissions(&#039;admin_toolbar&#039;) (Line: 235)
Drupal\system\Form\ModulesListForm-&gt;buildRow(Array, Object, &#039;Drupal&#039;) (Line: 161)
Drupal\system\Form\ModulesListForm-&gt;buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 518)
Drupal\Core\Form\FormBuilder-&gt;retrieveForm(&#039;system_modules&#039;, Object) (Line: 275)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;system_modules&#039;, Object) (Line: 93)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 669)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>
catch’s picture

Status: Active » Needs work
Issue tags: +Needs tests
StatusFileSize
new632 bytes

OK this is a regression caused by #2208429: Extension System, Part III: ExtensionList, ModuleExtensionList and ProfileExtensionList.

The issue is that the module list always includes the profile (for example on an 8.5 site I have locally, 'standard' is in core.extension.yml as a module). However the newly added extension list only has the profile as a profile.

I found #2939904: Fix system_get_info() for non-installed modules. ModuleHandler::getName() used to call system_get_info(), but now it calls ExtensionList() directly, so it needs to catch the exception too.

Here's a patch, but we need test coverage for it.

Yet another reason install profiles shouldn't double up as modules.

catch’s picture

StatusFileSize
new632 bytes

Needs to return a string, not an array.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new637 bytes

That's not right either. This is the code that was replaced:

  public function getName($module) {
-    $info = system_get_info('module', $module);
-    return isset($info['name']) ? $info['name'] : $module;
+    return \Drupal::service('extension.list.module')->getName($module);
   }

Not worth an interdiff.

catch’s picture

Issue tags: -Needs tests
StatusFileSize
new797 bytes
new1.4 KB

The last submitted patch, 30: 3000677-30-test-only.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 30: 3000677-30.patch, failed testing. View results

tritof’s picture

Hi, not sure to give any new info, but I have the same pb without using any profile ($settings['install_profile'] = 'standard'; is my settings but I suppose it is just the installation profile type), and I'm still on 8.6.0 version of Drupal.
Drupal\Core\Extension\Exception\UnknownExtensionException : The module standard does not exist. dans Drupal\Core\Extension\ExtensionList->get() (ligne 257 de [...]/core/lib/Drupal/Core/Extension/ExtensionList.php).
Also it came up without any update or anything. Yesterday working just fine on some views, today crashing. The ony action I did was sending a simplenews test. (Like 15 times.)
And I have an active duplicate version of the site just in case, hidden but on the same server, and it still works.
EDIT : 5 minutes later, I cleared the cache, and now it works, not right away clearing the cache though...

eppik’s picture

Following this thread. I run a Thunder profile on a build and a have a similar error now that we're up to 8.6.1.

Drupal\Core\Extension\Exception\UnknownExtensionException: The module thunder does not exist. in Drupal\Core\Extension\ExtensionList->get() (line *** of /var/www/***/core/lib/Drupal/Core/Extension/ExtensionList.php).

shelane’s picture

Right after updating from Drupal 8.5.6 to 8.6.2 and running drush cache:rebuild, I got this error:

In ExtensionList.php line 257:
                                     
  The profile Array does not exist.  

I am using a custom profile that is a sub-profile of lightning. Both exist and my settings.php file has:

$settings['install_profile'] = 'thunder';

If I try to run drush updatedb, I get this error:

 [warning] Illegal offset type in isset or empty ExtensionList.php:253

In ExtensionList.php line 257:
                                     
  The profile Array does not exist.  
catch’s picture

The test needs fixing, but if you're getting this issue and confident trying a patch, please test the patch in #30.

shane birley’s picture

@catch,

Will try the patch today and see if it helps to resolve the issue. I will run it against 8.6.2.

cesarg’s picture

I had this same issue and was resolved by simply doing a cache rebuild using Drush.

shane birley’s picture

@cesarg,

Make sure to track how long this holds. I have a couple of sites with similar issues and one of them requires a cache clear every week to prevent this problem. Let us know if the problem returns in the future.

juagarc4’s picture

@shelane (#35),
I think your problem is more related to this issue: https://www.drupal.org/project/drupal/issues/3009548

shane birley’s picture

I am running with Drupal 8.6.2 now and so far the issue might be fixed. I will monitor over the next week or two to confirm. And to clarify, the status page now as the proper profile displayed (minimal-8.6.2).

yazzbe’s picture

Had this issue too.
After updating to 8.6.2 + run update +run cron the problem was gone.

jweirather’s picture

I just did a clean install (8.6.2) for the first time today and experienced this issue when visiting "Extend". Simply running update.php resolved the issue for me.

jonathanshaw’s picture

#30 works for me reliably

featherbelly’s picture

StatusFileSize
new29.39 KB

Removing/commenting the install_profile from settings.php seems to do the job.

$settings['install_profile'] = 'PROFILE';

Use drush cr or drupal cr (Drupal Console) to clear the cache from the command line.

Status image

shelane’s picture

@juagarc4 Turns out my issue is related to this https://www.drupal.org/project/lightning_core/issues/2997990

cesarg’s picture

@shane-birley (#39) I encountered the issue once more today. Once again, a cache rebuild did the trick.

brightbold’s picture

Confirming that removing the install profile line from settings.php and clearing the cache has fixed the problem, for now at least. Mine was occurring on the admin/modules page (maybe elsewhere but that's the one I noticed before fixing it.)

dave kopecek’s picture

I've had #30 in place for about a week and the error hasn't happened again.

scrumorg’s picture

We have encountered this about once a week since our upgrade to 8.6.2, today being the most recent. Every time, a cache refresh fixes the issue.

We don't have an install profile in our settings.php file.

biigniick’s picture

I've encountered this error today on the views page clicking on the 'edit' button. Thanks for the info, and clearing the cache fixed it for me.

Drupal 8.6.0
PHP 5.6.37

Thanks

jonathanshaw’s picture

Anyone got an idea why the test in #30 is failing? It looks like the exception is not being caught, but I don't see why.

scrumorg’s picture

Is it possible the failed tests are identifying the problem that the patch is compensating for? The exception thrown is not the exception caught (or expected)...

jonathanshaw’s picture

I figured out what it was: it's simply a unit test so no container is available, but the method being called in the ModuleHandler needs a container. It should be a simple fix to the test.

vrwired’s picture

updating database worked for me to resolve.

drush updatedb required for system module
Force cache clear to ensure aggregated JavaScript files are regenerated. @see
https://:www.drupal.org/project/drupal/issues/2995570

bitcookie’s picture

I experienced this bug on a fresh install of 8.6.3.

I don't have any install_profile declared in settings.php

Patch #30 seems to have helped. I applied it without clearing the cache and the error resolved.

ikaros123’s picture

I also had the same issue after moving my site to a new database.
Running update.php solved the problem.

joelpittet’s picture

@catch, how does the 'standard' profile get in the module list to begin with?

EDIT: I did #45 to resolve the problem. Remove $settings['install_profile'] = 'standard'; from my settings.php

Prabhu.shan’s picture

Even we face the same issue after we upgraded to 8.6.2 Core. Any idea why it happens only in prod environment but not in lower environments.

Does load on the prod site is creating this issue?

BalrajB’s picture

Had a similar issue, but clearing cache fixed it for me.

brightbold’s picture

On Nov. 2 I said:

Confirming that removing the install profile line from settings.php and clearing the cache has fixed the problem, for now at least.

But as @Shane Birley reported, that only solved it temporarily. Today I was locked out of admin/people, admin/modules, and at least one other key admin page. Fixed with another cache clear. I'm moving the site to a new host later this week so I'll try the patch then.

shane birley’s picture

@BrightBold,

I upgraded the site to the latest Drupal 8.6.x and applied the patch. I haven't seen the issue since. I am still watching, however.

scrumorg’s picture

We have not seen this issue since applying patch #30 2 weeks ago. Looks like it probably takes care of it.

tjtj’s picture

I got:

Error      Drupal\Core\Extension\Exception\UnknownExtens
                                                    ionException: The module standard does not
                                                    exist. in
                                                    Drupal\Core\Extension\ExtensionList->get()
                                                    (line 257 of
                                                    /home/orcmaorg/public_html/core/li

when I display the people page.

oujasper’s picture

We just upgraded from 8.5.6 to 8.6.4 and we are getting this when you click "Extend", but when you click "Install New Module" you get a Drupal "Access Denied" and when you click "Uninstall module" you get in. Makes no sense. Once in "Uninstall module" if you click the "List" tab, you get the "The module standard does not exist" error again. We have similar issues other areas of the admin as well.

catch’s picture

Version: 8.6.x-dev » 8.7.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.13 KB
new1.75 KB

Same patch with a test that should pass/fail properly.

The last submitted patch, 66: 3000677-66-test-only.patch, failed testing. View results

catch’s picture

StatusFileSize
new852 bytes
new1.45 KB

Tidied up the test a bit.

The last submitted patch, 68: 3000677-68-tests-only.patch, failed testing. View results

nchase’s picture

Drupal\Core\Extension\Exception\UnknownExtensionException: The module standard does not exist. in Drupal\Core\Extension\ExtensionList->get() (line 257 of /core/lib/Drupal/Core/Extension/ExtensionList.php). in a Drupal 8.6.4.

The problem leads to the entire site crashing and only showing "The website encountered an unexpected error. Please try again later.". The above error message is the only error message in the log.

antojose’s picture

The patch in #68 worked fine for me. Thank You!

catch’s picture

Issue summary: View changes

Updated the issue summary.

alexpott’s picture

+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -747,7 +747,12 @@ public function getModuleDirectories() {
+    catch (UnknownExtensionException $e) {
+      return $module;
+    }

Can we deprecate this path? I feel like thew module handler shouldn't be dealing with modules that are not installed.

The situation where we have a profile configured but not in the module list should never happen. As a follow-up I think we should consider always adding the profile to module list once Drupal installation is finished.

catch’s picture

I think these are pretty standard Drupal installations that are hitting this though, although given it's a bug then getting the deprecation is probably OK.

As a follow-up I think we should consider always adding the profile to module list once Drupal installation is finished.

That's the opposite direction to #3023133: [PP-1] Extension System, Part V: Decouple profiles from modules.

tjtj’s picture

I am getting

  111841   06/Jan 17:05   php              Error      Drupal\Core\Extension\Exception\UnknownExtensionException: The module standard does
                                                      not exist. in Drupal\Core\Extension\ExtensionList->get() (line 257 of
                                                      /home/orcmaorg/public_html/core/li
  111840   06/Jan 17:04   php              Error      Error: Class 'Drupal\toolbar\PageCache\AllowToolbarPath' not found in
                                                      Drupal\Component\DependencyInjection\Container->createService() (line 258 of
                                                      /home/orcmaorg/public_html/core/lib/Drupa

I tried the patch 3000677-68, and it totally broke my site. I get errors accessing the People pages.

begun’s picture

I am periodically experiencing the same issue on a site. Would be happy to test any fixes, but not sure how to reliably reproduce the issue. Seems to be intermittent.

mlzr’s picture

Ok, I had found te error found in the logfile "The module standard does not exist." and the path /admin/modules was given a blank page.

I read this page and places $settings['install_profile'] = 'standard'; in settings.php as mentioned in #19 and did a /update.php as I don't have command-line acces for this website as mentioned in #20.

Now I can acces /admin/modules again. So far so good :-)

Thanks,
MarchelloDePello

larowlan’s picture

Status: Needs review » Needs work

Needs work for the deprecation in #73

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new1.6 KB
new2.01 KB

Adding the deprecation.

prlw1’s picture

StatusFileSize
new843 bytes

3000677-79.patch works for me on php 7.2, drupal 8.6.4.

Before patching, trying to enter maintenance mode:

Drupal\Core\Extension\Exception\UnknownExtensionException: The module standard does not exist. in Drupal\Core\Extension\ExtensionList->get() (line 257 of /usr/pkg/share/drupal/core/lib/Drupal/Core/Extension/ExtensionList.php).

After applying the first part of that patch (attached), I can successfully enter maintenance mode. [Obviously you want the whole of the above - I'm just being clear about what I tested.]

Status: Needs review » Needs work

The last submitted patch, 80: drupal3000677.diff, failed testing. View results

catch’s picture

Status: Needs work » Needs review

Patch in #79 is the one to review still.

catch’s picture

Title: Installation profile missing after upgrade to 8.6.1 » Fatal error after upgrade to 8.6x [due to regression in extension system]
alexpott’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -747,7 +747,13 @@ public function getModuleDirectories() {
+      @trigger_error('Calling ModuleHandler::getName() with an unknown module is deprecated in Drupal 8.7.0 and support for this will be removed in Drupal 9.0.0, check that the module exists before calling this method. See https://www.drupal.org/node/3024541.', E_USER_DEPRECATED);

So I think we should target 8.6.x with this. Apart from changing this I think we're rtbc - for the mitigation. But I feel we need a following to deal with sites where the install profile goes missing because I think this might break more than just this in the long run.

catch’s picture

Status: Needs work » Needs review

I think we should introduce the deprecation in 8.7.x, and commit #68 to 8.6.x without it. https://www.drupal.org/project/drupal/issues/3000677#comment-12897126

alexpott’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +needs backport to 8.6.x

That's a good plan.

catch’s picture

larowlan’s picture

review credits

  • larowlan committed 6cbe4ea on 8.7.x
    Issue #3000677 by catch, Shane Birley, featherbelly, alexpott: Fatal...
larowlan’s picture

Version: 8.7.x-dev » 8.6.x-dev

Committed as6cbe4ea and pushed to 8.7.x. Thanks!

Didn't commit to 8.6 because release window

  • larowlan committed 12dbf59 on 8.6.x
    Issue #3000677 by catch, Shane Birley, featherbelly, alexpott, larowlan...
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Seems I was wrong about commit freeze

Committed #68as 12dbf59 and pushed to 8.6.x. Thanks!

tjtj’s picture

This is still not fixed in the latest Drupal 8.6.6. And no patch here for 8.6.x

catch’s picture

That's because Drupal 8.6.6 is a security release, not a bugfix release, it will go out with the latest bugfix release. The patch in #79 applies to 8.6 too.

tjtj’s picture

Status: Fixed » Active
tjtj’s picture

Seems to me that a critical bug that stops sites from working needs to be put in any new release. It is very time-consuming to update the core and remembering how to get around this bug, and repatching it is a real issue. I spent a morning doing the updates

cilefen’s picture

Status: Active » Fixed

@tjtj You will have to make a case that security releases are also bugfix releases (or with criticals) in another issue. We are not going to change the policy in this issue.

razunter’s picture

This is not fixed, no stable release with this fix yet.

cilefen’s picture

Hi @Razunter: Issues are marked fixed here when they are committed, not upon release. Many OSS projects work the same way.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ejah’s picture

I encounter the same message with different origin after upgrade to 8.6.8 from 8.6.7:
"Uncaught PHP Exception Drupal\\Core\\Extension\\Exception\\UnknownExtensionException: "The module standard does not exist." ....core/lib/Drupal/Core/Extension/ModuleHandler.php line 176"
Commenting out install_profile and flushing caches did not fix it.

calbasi’s picture

This fix has been added at 8.6.8 release

alexmoreno’s picture

I can confirm after upgrading to 8.6.9 the issue is not present anymore

shakeeltariq’s picture

Experienced this issue on 8.6.3 (with pending updates etc.) after clearing cache, there was no $settings['install_profile'] = 'standard'; line in settings.php, had to add this line to resolve the issue.

Abhinaw’s picture

follow these steps for unexpected shutdown

1. rm -rf sites/default/files/php

2.TRUNCATE TABLE cache_bootstrap;
3.TRUNCATE TABLE cache_config ;
4.TRUNCATE TABLE cache_container ;
5.TRUNCATE TABLE cache_data ;
6.TRUNCATE TABLE cache_default ;
7.TRUNCATE TABLE cache_discovery;
8.TRUNCATE TABLE cache_dynamic_page_cache;

9. execute rebuild.php eg.(www.abc.com/rebuild.php)
10.execute update.php eg.(www.abc.com/update.php)
11.clear the cache

if some modules is making problem or not uninstalling remove modules to use step 1

niky_chavan’s picture

$settings['install_profile'] = 'standard'; adding this has solved the issue for me.

jlbrewster47’s picture

I started with 8.7.6, and was getting this error. Upgraded to 8.7.7, as well as trying patch #79 above, and still same.

Notice: Undefined index: standard in Drupal\Core\Extension\ModuleExtensionList->doList() (line 180 of core/lib/Drupal/Core/Extension/ModuleExtensionList.php). 
]]

I also tried adding the "profile" :standard line to settings.php and running update.php. Still get the error. I think I tried everything. most don't apply because my version is the latest..Shouldn't this be fixed for me?

I'm out of things to try..

junaidpv’s picture

We are getting same error after updating from 8.7.9 to 8.8.1.

Drupal\Core\Extension\Exception\UnknownExtensionException: The module minimal does not exist or is not installed. in Drupal\Core\Extension\ExtensionList->getExtensionInfo() (line 346 of /xxxxx/xxxxx/core/lib/Drupal/Core/Extension/ExtensionList.php).

nulf’s picture

Getting the same as @junaidpv, did an upgrade from 8.7.5 to 8.8.1.

Edit: I have only seen it on "Status report" so far. Clearing caches didn't help. I get a "The website encountered an unexpected error. Please try again later.".

Edit2: And in "Recent log messages" I get the same error as @junaidpv

cola’s picture

same issue here with 8.8.1
we installed the drupal with existing configs. the profile (on core.extension.yml) is set to "profile: minimal". This is needed because Drupal only allow install with existing configs if the profile is minimal.

solution: We found our issue. If you install drupal over configs, take care, that you als enable the module "minimal: 1000" (section module) in core.extension.yml

nulf’s picture

@cola's solution seems to sort out the error for me.

meendru’s picture

StatusFileSize
new979 bytes

I have an installation that is set to

$settings['install_profile'] = NULL;

(no installation profile)

This simple patch is working for me. I checked it for side-effects but can't find some until now.

Please note: In my case, the Drupal 8.8.2 project is running in Docker Containers. It is powered by composer, but because of restrictions in our setup, I was not able to apply it as a composer patch. Instead, I use git apply

pasan.gamage’s picture

We are getting same error after updating from 8.7.9 to 8.8.1.

Drupal\Core\Extension\Exception\UnknownExtensionException: The module minimal does not exist or is not installed. in Drupal\Core\Extension\ExtensionList->getExtensionInfo() (line 346 of /xxxxx/xxxxx/core/lib/Drupal/Core/Extension/ExtensionList.php).

I'm having the same issue after updating from 8.7.9 to 8.8.3.
And my install profile is null as well, but I cannot change it like @cola said because Drupal doesn't allow it to be changed to something else after installation.

I tried what @meendru did and seems to be working. But I'm not sure if it will cause different issues down the line.
But thanks for coming up with it.

Thanks

aw-developer’s picture

I have the same issue after updating 8.7.8 to 8.8.3. Our install profile is minimal.

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).

Clearing the cache doesn't help and I don't see a clear resolution in this thread.
Does anyone have any suggestions?

vrwired’s picture

As noted in #104, adding $settings['install_profile'] = 'standard'; to settings.php resolved issue on my end.

swentel’s picture

I've ran into this one myself, adding or removing $settings['install_profile'] line in settings.php didn't fix it at all, clearing caches neither.

The problem in the end was that 'standard' still was in system.schema at schema version 8000, but nothing in core.extension.

To get around the problem, I just did an unset of the standard module and finally upgrades could run.

function update_get_update_list() {
  // Make sure that the system module is first in the list of updates.
  $ret = ['system' => []];

  $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);
  unset($modules['standard']);
  // ....
tneo’s picture

@swentel #116
Which file did you edit for that change?

I've tried all options in the thread and none of them worked for me.

tneo’s picture

I was able to sort out my issue. By removing the entry from the key_value table as I found in this forum topic.

inders’s picture

Today got same issue & was able to fix it by using #116
File:- core/includes/update.inc

After running update.php i reverted to previous code without any issues. "I am not using standard profile"

meendru’s picture

I dag a bit deeper into the context of my issue and want to annotate my patch in #112.

Please keep in mind: I'm coming from the error

Drupal\Core\Extension\Exception\UnknownExtensionException: The profile does not exist or uis not installed. in Drupal\Core\Extension\ExtensionList->getExtensionInfo() (line 346 of core/lib/Drupal/Core/Extension/ExtensionList.php).

when I try to open, for instance, /admin/module.

ExtensionList->getExtensionInfo() is called by core/modules/system/system.install on line 58 (Drupal 8.9). Line 57 in system.install is introducing a hardcoded if statement relying to standard profile:

$profile = \Drupal::installProfile();
if ($profile != 'standard') {
  // ... 
}

As far as I know, Drupal uses installation profiles only during the first run. Once installed, they won't be needed substantially again. So, as far as I can currently suggest, you should first try to set $settings['install_profile'] to standard (#115) for existing installations before you consider my patch in #112.

bob.hinrichs’s picture

This issue is still not fixed. Steps to reproduce:
1) a config install Drupal, that has minimal profile specified in core.extension config.
2) updated Drupal core code (via composer update). to 8.9.10
3) Visit the admin/config page.
Fatal Error: 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).

Tried everything here. Nothing works.

Why does system.install hard-code 'standard'? If I add into system_requirements() in system.install if ($profile != 'standard' && $profile != 'minimal') { then it works.

Update: in Drupal 8.9, the $settings variable does not work as per the fix above (anymore); but if you put install_profile: standard into your services.yml file, it works. This points to another very confusing issue with Drupal currently, which is where you should put parameters (settings.php or services.yml parameters), and changes are in the works according to Drupal 9 issues.

However: this is still a hack, around the fact that 'standard' is hard-coded into the system_requirements. Because this "fix" involves putting a lie into the configuration and tricking Drupal to think it is using standard profile, when it is anything but. That is the real issue here, I think.

gpsloco’s picture

I have this problem, too. Can you please clarify, where I would find the system.install? statement or file? I cannot open admin/people and admin/modules as well as I can't edit any views.

avpaderno’s picture

@bob.hinrichs If you can reproduce the issue for Drupal 8.9.x, you should open a new issue, and provide a link to this issue too.

ikit-claw’s picture

I can confirm I have just found this issue on 8.9.13

danielmmda’s picture

Using #121 worked for me.

edmund.dunn’s picture

#121 worked for me. I found this issue in 9.1.10. Created new issue at https://www.drupal.org/project/drupal/issues/3219126

ajay gadhavana’s picture

#110 @cola's solution working fine for me

j.b’s picture

I've just upgraded from 8.9.18 to 9.2.5 and i am having this problem.

Drupal\Core\Extension\Exception\UnknownExtensionException: The module does not exist or is not installed. in Drupal\Core\Extension\ExtensionList->getExtensionInfo() (line 346 of core/lib/Drupal/Core/Extension/ExtensionList.php). 

running drush updatedb :

The module standard does not exist.

loopy1492’s picture

quietone’s picture

publish the change record