Problem/Motivation
When installing Drupal 8 HEAD (or Drupal 8.0.0 beta12) on a cluster of servers using a shared files directory (using either drush si
or the web UI), I get the following error during installation:
Warning: mkdir(): File exists in Drupal\Component\PhpStorage\FileStorage->createDirectory() (line 171 of core/lib/Drupal/Component/PhpStorage/FileStorage.php).
I clear out the entire contents of the 'files' directory between installation attempts, and continue to get that error.
If I switch from trying to install Drupal 8 with HEAD to using Drupal 8 beta 11, installation succeeds. Beta 12 also fails, so it seems it's something between beta 11 and beta 12.
Steps to Reproduce
Configure a cluster of servers (in my case, I'm using a cluster of Raspberry Pi 2 computers running Debian Wheezy with PHP 5.6.11) with a shared filesystem (in my case, I'm using GlusterFS, but NFS also exhibited this issue).
- Mount the share at
/mnt/gluster
, and create a folder inside (e.g.files
) with permissions that allow the web user to write to the dir. - Check out D8 head to your webroot, and symlink the files directory to (e.g.)
/var/www/drupal/sites/default/files
(so that's symlinked to/mnt/gluster/files
). - Try to install Drupal 8, either using Drush on the command line, or via the web UI.
Proposed resolution
N/A
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#15 | installation_fails_on-2540912-15.patch | 641 bytes | geerlingguy |
Comments
Comment #1
cilefen CreditAttribution: cilefen commentedAre you using a web server persistence strategy? I guess it should not matter, but I am just curious.
Comment #2
cilefen CreditAttribution: cilefen commentedComment #3
geerlingguy CreditAttribution: geerlingguy commentedComment #4
geerlingguy CreditAttribution: geerlingguy commentedWas just informed by Fabianx this might be resolved by the patch in #2497243-188: Replace Symfony container with a Drupal one, stored in cache.
Comment #5
geerlingguy CreditAttribution: geerlingguy commentedComment #6
cilefen CreditAttribution: cilefen commentedSome cluster solutions can pin clients to a given web server. That is why I think this may not affect all cluster types. I can test that concept tomorrow.
Comment #7
geerlingguy CreditAttribution: geerlingguy commented@cilefen - I've also tried the following scenarios, none of which worked:
ip_hash
balancing strategy (which pins all requests for one IP to the same backend).None of those worked, but all of them worked fine once I switched to beta11. I'm retesting with Fabianx's patch in the related issue.
Comment #8
cilefen CreditAttribution: cilefen commentedSo is it more of an issue with the filesystem clustering, not the web server clustering?
Comment #9
geerlingguy CreditAttribution: geerlingguy commentedCould be... I've been reading through the following:
It looks like it could be an issue with the version of Gluster available for Debian Jessie, so I'm going to switch back to NFS and do a little more testing.
Of course, this brings up another fun topic: why the heck are we doing so many stats and mtime lookups in Drupal 8? Ugh. A prescient quote from efflugentsia 5 years ago in #678292-22: Add a development mode to allow changes to be picked up even when CSS/JS aggregation is enabled:
But I digress. Still digging here.
Comment #10
geerlingguy CreditAttribution: geerlingguy commentedFull trace of the error that's wasting away my life right now:
I have the files directory symlinked to
/mnt/gluster/files
, which is a mount of a GlusterFS share. I've now tried GlusterFS 3.2.x and 3.5.x. Also hitting the issue with NFS shares mounted and symlinked.Comment #11
Fabianx CreditAttribution: Fabianx as a volunteer commented#9 There should be no stats and mtime lookups during warm caches.
Cold caches wil have lots due to how many files need to be read for the plugin system, etc.
Thanks for testing my patch and I am glad it resolves it.
Comment #12
geerlingguy CreditAttribution: geerlingguy commentedAnd through the UI / Drush, I'm sometimes also getting the following during requirements phase:
I have (as stated above) sites/default/files set as a symlink. No clue why it's not working here; I can read/write to files in there with no issue, and installing different Drupal 8 tags/commits (always with a clean slate and re-symlinked directory) gives different results :P
Comment #13
geerlingguy CreditAttribution: geerlingguy commentedSo the rabbit hole gets a little deeper... Seems like PHP is possibly the culprit.
I created a quick test file in the docroot:
And running it (from either command line or through webserver/Nginx) returns:
From the same directory as that file, I can see the directory is clearly a symlink:
So... now I'm trying to see what kind of settings in PHP might be causing the symlink to not appear as a directory.
Comment #14
geerlingguy CreditAttribution: geerlingguy commentedAlso note that:
is_link()
returnstrue
is_writable()
returnstrue
Maybe we are a bit too brittle with our installer requirements for the files directory?
Comment #15
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedAttached patch allows Drupal to install successfully, and when used in tandem with the patches in the other issues mentioned previously, Drupal 8 HEAD finally runs on the #Dramble again!
So... I'm surely not the only person who's ever run Drupal with a symlinked files folder; is there any better way to fix this? Am I missing something obvious in the PHP config?
Comment #16
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedNote that after Drupal installation is complete, I'm still getting Twig-related errors like the following:
I've also set all permissions on the gluster mount directory (including the files directory within) and the symlink to 777 with www-data as owner/group. Still no dice.
Comment #17
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedI'm going to close out this particular issue, because I've finally thrown in the towel on getting Gluster working with shared files on the Raspberry Pi. Too many little problems, and I finally switched to NFS: https://github.com/geerlingguy/raspberry-pi-dramble/issues/55
Ah well... at least I tried.
Comment #18
cilefen CreditAttribution: cilefen commented