I'm running a fresh checkout of the latest 8.x-dev

I'm using MAMP 2.0.2 (upgraded from previous versions of MAMP) and experienced the following problems both with PHP 5.2.30 and 5.4.10.

When I visit install.php on my localhost, I am redirected to /core/install.php and get the following error:

Additional uncaught exception thrown while handling exception.

Original
Drupal\Core\Config\StorageException: Missing configuration file: system.theme.global in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Config/InstallStorage.php).

Additional
Drupal\Core\Config\StorageException: Missing configuration file: system.site in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Config/InstallStorage.php).

I've done a lot of research trying to find out what could cause this, and eliminated a few PHP settings.

safe_mode is not the problem, as per: https://drupal.org/node/1959062
open_basedir is not the problem, as per: https://drupal.org/node/2019911

I suspect there is another undocumented PHP setting that is causing this error since it seems to be a problem in Russia and China and perhaps these people are using non-standard PHP configurations? Unfortunately, it also comes up for me, and I'm using MAMP.

If anyone has any idea what setting could be causing this issue, can we please document it, update the installer to detect an incorrect setting, and also add the requreiment to the list of Drupal 8 requirements?

Comments

quicksketch’s picture

I was looking into this on @jenlampton's laptop and it doesn't seem to be related to a setting in PHP. It seems like a bug in Drupal\Core\SystemListing::scan().

There's this section of code in scan():

    // Search for the directory in core.
    $searchdir = array('core/' . $directory);
    foreach ($this->profiles($directory) as $profile) {
      $searchdir[] = $profile;
    }

The call to $this->profiles() is where things go wrong. If you look at the protected profiles method, it looks like this:

  protected function profiles($directory) {
    return $this->profiles;
  }

So the method profiles() does nothing but return $this->profiles, and it doesn't even use the single parameter that's passed to the method in the first place? This is really, really weird.

So I think what's happening here is that $this->profiles is both a VARIABLE and a METHOD. This is confusing PHP. When you say $this->profiles, it doesn't know what it is. I don't know how it's arriving at this result, but pretty much no matter what you pass into $this->profiles(), it will always return an array with a single value. i.e.

print $this->profiles('banana');

Results in:

array(
  [0] => '/banana',
);

So when "modules" is passed in, a search path of "/modules" is returned. The end result is that Drupal can't locate the core modules, which means it can't locate the config files they include, resulting in the error posted by @jenlampton.

quicksketch’s picture

Status: Active » Needs work
StatusFileSize
new901 bytes

This patch doesn't fix what is most likely a bug in the profiles() method. Surely that method is supposed to use the $directory variable that is passed in? But it renames the "profiles" method to "getProfiles", which avoids the PHP confusion and lets Drupal install and function normally.

jenlampton’s picture

Title: Unspecified PHP setting causes installation failure » Installation failure
Priority: Normal » Major

bumping up priority because I expect this will cause havoc on friday if not resolved :)

jenlampton’s picture

Issue summary: View changes

add mamp

pingers’s picture

SystemListing::profiles() was committed from #1831350: Break the circular dependency between bootstrap container and kernel in 6f3268.
Given the method comment, was implementation was never completed (I.e. listing profiles in the current directory).

jenlampton’s picture

Status: Needs work » Reviewed & tested by the community

I'm still experiencing this problem. Though I (and the Russians and Chinese) may be experiencing a strange edge-case bug in PHP, the problem stems to from bad coding practices on our part, and I think we should still clean up Drupal's code.

The patch in #2 fixes the problem and allows me to load the install screen without the exception/exception issue.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, SystemListing_getProfiles_rename-2096741.patch, failed testing.

alexpott’s picture

StatusFileSize
new1.41 KB
new559 bytes

SystemListingInfo overrides the profiles method

alexpott’s picture

Status: Needs work » Needs review

Go testbot go

alexpott’s picture

StatusFileSize
new463 bytes

I wonder if this works... I can not reproduce

jenlampton’s picture

Status: Needs review » Needs work

Both of the above patches do not solve the problem.

jenlampton’s picture

Issue summary: View changes

added mamp and php versions

chrisjlee’s picture

I have this issue as well. I had removed the files folder in '/sites/default/files' folder and it resolved the issue.

nerilka’s picture

I have this issue as well : I'm running wamp 2.2.22, php 5.3.13 and mariadb-5.5.24, the safe_mode is off and the open_basedir is commented. And I tried all the patches ; it failed.
I could install the d8 alpha4 with no issue, but not the d8 alpha5. Both fresh installs.

enhdless’s picture

I am experiencing this issue on wamp 2.4 with php 5.4.16, and the patches don't fix it for me.

jenlampton’s picture

Title: Installation failure » Installation failure: Missing configuration files
Issue summary: View changes
jenlampton’s picture

Just an update that this problem persists. Alpha 7 now, these are the errors I'm getting:

Additional uncaught exception thrown while handling exception.

Original
Drupal\Core\Config\StorageException: Missing configuration file: system.theme.global in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Config/InstallStorage.php).

Additional
Drupal\Core\Config\StorageException: Missing configuration file: system.site in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Config/InstallStorage.php).

The patch in #2 still solves the problem for me, I'm able to install after changing function names.

The patch in #7 still fails. Perhaps SystemListingInfo should *not* override the profiles (getProfiles) method?

jenlampton’s picture

Issue summary: View changes
jenlampton’s picture

Error still occurring on latest dev:

Additional uncaught exception thrown while handling exception.

Original
Drupal\Core\Config\StorageException: Missing configuration file: system.theme.global in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Config/InstallStorage.php).

Additional
Drupal\Core\Config\StorageException: Missing configuration file: system.site in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Config/InstallStorage.php).

Patch in #2 still fixes the problem.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new1.84 KB

So I think what's happening is something like this - some exception is occurring somewhere and the theme system is trying to display the error but it can't. Looking at the "fix" in #2 I think the problem must be in SystemListingInfo::profile() (which is overriding SystemListing::profile()) and hence never called if the patch in #2 is applied.

@jenlampton I've tried to add some code to catch whatever is going on in there in the patch attached - if you get debug output if you can pastebin or something - thanks!

alexpott’s picture

sun’s picture

@jenlampton: Heya, some questions:

  1. If I got it right, then you get this uncaught exception screen in the very first installer page, before you even see the installer - is that correct?
  2. Do you have any custom installation profiles anywhere in your filesystem or is it a plain/unmodified core checkout?
  3. Unfortunately, the error/exception handler is not working correctly in the installer and early bootstrap environment right now - could you try whether the patch in #2176105: Installer catches exceptions and manually re-prints them; does not use error/exception handler perhaps improves at least the error handling?
sun’s picture

StatusFileSize
new9.22 KB

Alternatively, can you try once more with attached patch?

It contains the changes from aforementioned issue + some more error handler fixes.

It also forces the error level to be verbose in the early installer screens, which means that we should get a proper backtrace for the exception that you are seeing. → Given the backtrace, we can figure out where exactly the error is triggered from.

sun’s picture

Note that the patch in #2194111: Error handler throws exception when service container is not (fully) available yet fixes the last remaining "errors caused by errors" problems. Once that has landed, we should be able to properly debug what's going here.

jenlampton’s picture

@sun++
@alexpott++

First, sorry I didn't get back to this sooner. The good news is that a fresh checkout of 8.x today ran the installer with no issues. so HOORAY!!!

I'm not sure exactly what the solution was, but I'm very happy I can work on core again with less hassle :) To answer some older questions (which may not be relevant, but I'm doing it anyway)

  1. No, the wizzard part of the installer worked great, it wasn't until database tables needed to be created (or popilated?) - whenver the batch operation starts with the progress bar - that the crash happened.
  2. Nothing custom, it was always a fresh, squeaky clean installation of core straight from git on the 8.x branch that caused trouble.
  3. Sorry I didn't get around to trying that patch, but it's in now, and Drupal finally installs again for me :)

<3 you both!!

jenlampton’s picture

Status: Needs review » Closed (duplicate)

So, I guess we can mark this issue as duplicate of one of those two... not sure which but I spose it doesn't matter since it's fixed. :) :)