In following the install instructions for D8:

    Win/Mac/Linux host$ vagrant ssh
    vagrant guest$ cd ~/sites/drupal8
    vagrant guest$ git clone --branch 8.x http://git.drupal.org/project/drupal.git .
    vagrant guest$ drush @drupal8 si standard -y

I get this error on the last step:

vagrant@precise32:~/sites/drupal8/public$ drush @drupal8 si standard -y
Command site-install needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.                          [error]
The drush command 'si standard' could not be executed.                                                                                                                             [error]
The directory /var/www/drupal8 does not contain a valid Drupal installation     

I should also be able to install it manually, but there's something weird with the file permissions has been stopping me from setting the write permissions on sites/default/files to be world writable.

Both options should work though and neither seems to.

Are we using the head version of Drush 7?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ericrdb’s picture

Sorry to hear about the challenges with Drupal8 installation. Yep, we are using Drush 7.

It looks like you cloned to:

~/sites/drupal8

And ran your drush si command from:

~/sites/drupal8/public

The drush command complains that there's no drupal core, which would be true if it was downloaded to the /var/www/drupal8 directory.

I just performed the below on a fresh checkout with no prior existing Drupal8 directory:

vagrant@precise32:~/sites$ cd drupal8/
vagrant@precise32:~/sites/drupal8$ git clone --branch 8.x http://git.drupal.org/project/drupal.git .Cloning into '.'...
remote: Counting objects: 335862, done.
remote: Compressing objects: 100% (64588/64588), done.
remote: Total 335862 (delta 234041), reused 334652 (delta 233262)
Receiving objects: 100% (335862/335862), 77.42 MiB | 479 KiB/s, done.
Resolving deltas: 100% (234041/234041), done.
vagrant@precise32:~/sites/drupal8$ l
composer.json  core/              index.php  profiles/   robots.txt  themes/
composer.lock  example.gitignore  modules/   README.txt  sites/      web.config
vagrant@precise32:~/sites/drupal8$ drush --version
 Drush Version   :  7.0-dev

vagrant@precise32:~/sites/drupal8$ drush @drupal8 si standard -y
You are about to create a /var/www/drupal8/sites/default/settings.php file and empty any Config directories and DROP all tables in your 'drupal8' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a few seconds ...                               [ok]
Installation complete.  User name: root  User password: root                             [ok]
Congratulations, you installed Drupal!Drupal installation complete                       [status]

You might reset the config.json (or project) to a clean checkout and trying again.

EDIT: correct paths.

mgifford’s picture

Ok, this got me closer:

vagrant@precise32:~/sites/drupal8$ drush @drupal8 si standard -y
You are about to empty any Config directories and DROP all tables in your 'drupal8' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a few seconds ... [ok]
Installation complete. User name: root User password: root [ok]
Congratulations, you installed Drupal!Drupal installation complete [status]

But still hit this error http://drupal8.dev/drupal8/:
( ! ) Fatal error: Class '__TwigTemplate_57ad779fd8b7bb4bf3a23848c79b3129849efea611aa87c1a1484dfe056f12aa' not found in /var/www/drupal8/core/lib/Drupal/Core/Template/TwigEnvironment.php on line 125

It's a bit baffling as I've used D8 for a long time and don't think I've run into this error... Seems to be tied to the permissions of the files directory...

rootwork’s picture

FileSize
112.62 KB

I'm seeing the same behavior:

- A manual install fails with errors about sites/default/files, even if I create it and chmod/chown it myself. I suspect this has something to do with the user/group settings set in the box, but I'm not sure what the right ones are.

- A drush install, from inside the box, using drush @drupal8 si standard -y, succeeds at the command line, but then when I try to load the site I get the same error Mike sees: "Fatal error: Class '__TwigTemplate_5889a8cc98ca6933e91c59b349178db252226001da4243451e50031f12ed43c2' not found in /var/www/drupal8/public/core/lib/Drupal/Core/Template/TwigEnvironment.php on line 125"

Fatal error on Drupal 8 install

I haven't had any issues installing Drupal 7; this seems specific to Drupal 8 installs.

rootwork’s picture

I wonder if this has a similar cause to #2054985: default file permissions cause problems for drupal7 sites and drupal8 installs? That was on a previous version (and also somewhat mysteriously marked a minor documentation bug), but maybe whatever was causing that has somehow resurfaced?

ericrdb’s picture

Status: Active » Needs review
FileSize
459 bytes

This patch sets apache to use vagrant:vagrant instead of www-data:www-data. Fixes the issue for me.

I don't yet see any downstream adverse affects for using vagrant:vagrant as the service account locally with apache. Please advise if I'm overlooking anything.

Thanks

mgifford’s picture

Status: Needs review » Reviewed & tested by the community

That works great. Thanks @ericdb!

rootwork’s picture

Agreed -- patch applies cleanly, and Drupal installs cleanly as a result :)

Just in time for the Portland frontend meetup on Twig tonight. Thanks!

  • Commit 5b9921b on 8.x-1.x by ericrdb:
    Issue #2238729 by ericrdb | mgifford: Fix Drush/D8 Installation Issue.
    
ericrdb’s picture

Status: Reviewed & tested by the community » Fixed

Committed - thanks!

mgifford’s picture

Great.. Thanks for the mention. But in running vagrant provision I get the following error:
/tmp/vagrant-chef-1/chef-solo-2/cookbooks/vdd/recipes/apache.rb:16:in `from_file'

After commenting that out and running it I get it for line 17.

 16:  # node['apache']['user'] = "vagrant"
 17>> node['apache']['group'] = "vagrant"

It could well be that I'm doing something wrong, but I thought's that how I was supposed to use this.

rootwork’s picture

When I tried the patch out, I wiped the vagrant instance completely and started from scratch, and it worked. But I agree vagrant provision after patching should work, at least as I understand it. Maybe someone with more vagrant chops can offer insight.

mgifford’s picture

Status: Fixed » Needs work

Just changing status back. No need to revert, but..

ericrdb’s picture

Status: Needs work » Active

I'm not able to re-create this issue. What are the steps taken?

With a clean checkout, I destroyed the existing box I had, performed "vagrant up" did a "vagrant provision". Nothing yet...

Thanks

mgifford’s picture

After you've installed your VM, run:

vagrant@precise32:~$ sudo ./postinstall.sh

I actually ran into this error, but not sure it mattered:

+ apt-get -y clean
+ rm -f /var/lib/dhcp3/*
+ rm /etc/udev/rules.d/70-persistent-net.rules
rm: cannot remove `/etc/udev/rules.d/70-persistent-net.rules': Is a directory
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
mkdir: cannot create directory `/etc/udev/rules.d/70-persistent-net.rules': File exists
+ rm -rf /dev/.udev/
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm: cannot remove `/lib/udev/rules.d/75-persistent-net-generator.rules': No such file or directory
+ rm -f /home/vagrant/{*.iso,postinstall*.sh}
+ dd if=/dev/zero of=/EMPTY bs=1M
dd: writing `/EMPTY': No space left on device
78376+0 records in
78375+0 records out
82183098368 bytes (82 GB) copied, 117.13 s, 702 MB/s
+ rm -f /EMPTY
+ exit

Then run:
My-Laptop:vdd $ vagrant reload

Which gives you this:
==> default: VM already provisioned. Run `vagrant provision` or use `--provision` to force it
My-Laptop:vdd $ vagrant provision

Which then gives me:

[2014-04-19T18:01:22+00:00] INFO: Could not find previously defined grants.sql resource
[2014-04-19T18:01:22+00:00] WARN: Cloning resource attributes for service[mysql] from prior resource (CHEF-3694)
[2014-04-19T18:01:22+00:00] WARN: Previous service[mysql]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/server.rb:154:in `from_file'
[2014-04-19T18:01:22+00:00] WARN: Current service[mysql]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/server.rb:218:in `from_file'

================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-2/cookbooks/vdd/recipes/apache.rb
================================================================================

Chef::Exceptions::ImmutableAttributeModification
------------------------------------------------
Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'

Cookbook Trace:
---------------
/tmp/vagrant-chef-1/chef-solo-2/cookbooks/vdd/recipes/apache.rb:25:in `from_file'

Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-2/cookbooks/vdd/recipes/apache.rb:

18: append true
19: end
20:
21: web_app "localhost" do
22: template "localhost.conf.erb"
23: end
24:
25>> node['apache']['user'] = "vagrant"
26: node['apache']['group'] = "vagrant"
27:
28: template "/etc/apache2/conf.d/vdd_apache.conf" do
29: source "vdd_apache.conf.erb"
30: mode "0644"
31: notifies :restart, "service[apache2]", :delayed
32: end
33:

[2014-04-19T18:01:22+00:00] ERROR: Running exception handlers
[2014-04-19T18:01:22+00:00] ERROR: Exception handlers complete
[2014-04-19T18:01:22+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-04-19T18:01:22+00:00] ERROR: Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'
[2014-04-19T18:01:22+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

mgifford’s picture

It is also my habit (although not here) to run:

$ sudo apt-get update
$ sudo apt-get upgrade -y

It's probably not required for a virtual box, but gets the environment closer to what I would use on a live server so is useful. Ideally it would be as close as possible.

danylevskyi’s picture

Status: Active » Closed (cannot reproduce)

  • Commit 5b9921b on 8.x-1.x, berkshelf by ericrdb:
    Issue #2238729 by ericrdb | mgifford: Fix Drush/D8 Installation Issue.