Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existing project blt setup issue #3338

Closed
arjunpws opened this issue Jan 21, 2019 · 10 comments
Closed

Existing project blt setup issue #3338

arjunpws opened this issue Jan 21, 2019 · 10 comments
Labels
Support A support request

Comments

@arjunpws
Copy link

arjunpws commented Jan 21, 2019

My system information:

  • Operating system type: Centos 7
  • Operating system version: [replace]
  • BLT version: 9.2.0

Output of blt doctor:

+------------------------------------------+--------------------------------------------------------------+
| Check                                    | Problem                                                      |
+------------------------------------------+--------------------------------------------------------------+
| BehatCheck:checkBaseUrl:uri              | base_url in tests/behat/local.yml does not match the site    |
|                                          | URI.                                                         |
|                                          |   Behat base_url is set to                                   |
|                                          | http://dmultilingual.local.org.                              |
|                                          |   Drush site URI is set to default.                          |
| ComposerCheck:checkPrestissimo:plugins   | hirak/prestissimo plugin for composer is not installed.      |
|                                          |   Run composer global require                                |
|                                          | hirak/prestissimo to install it.                             |
|                                          |   This will improve composer install/update performance by   |
|                                          | parallelizing the download of dependency information.        |
| DbCheck:checkRequiredKeys                | drush status is missing the 'db-hostname' key.               |
| DrupalCheck:checkDrupalBootstrapped      | Could not bootstrap Drupal via drush without alias.          |
| DrupalCheck:checkDrupalInstalled         | Drupal is not installed.                                     |
|                                          |                                                              |
|                                          | Run `blt drupal:install` to install Drupal locally.          |
| FileSystemCheck:checkFileSystem:%files   | Public files directory is not set.                           |
| FileSystemCheck:checkFileSystem:%private | Private files directory is not set.                          |
| FileSystemCheck:checkFileSystem:%temp    | Temporary files directory is not set.                        |
| NodeCheck:checkNodeVersionFileExists     | Neither .nvmrc nor .node-version file found in repo root.    |
| PhpCheck:checkPhpDateTimezone            | PHP setting for date.timezone is not set.                    |
|                                          |   Define date.timezone in /etc/php.ini                       |
| WebUriCheck:checkUri                     | Site URI is not set                                          |
|                                          | Is options.uri set correctly in                              |
|                                          | /var/www/html/bltproject/dmultilingual/docroot/sites/default |
|                                          | /local.drush.yml?                                            |
+------------------------------------------+--------------------------------------------------------------+
[error]  BLT Doctor discovered one or more critical issues. 


When I run this command:

blt setup

Setting up local environment for site default.
Using drush alias @self
> source:build
> tests:behat:init:config
> source:build:composer
Gathering patches for root package.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
PHP CodeSniffer Config installed_paths set to ../../drupal/coder/coder_sniffer/
> blt:init:git-hooks
Installing pre-commit git hook...
Installing commit-msg git hook...
> blt:init:settings
Hash salt already exists.
> source:build:frontend
> source:build:frontend-reqs
> source:build:frontend-assets
> drupal:deployment-identifier:init
Generating deployment identifier...
> drupal:install
[error]  MySql is not available. Please run `blt doctor` to diagnose the issue. 
[error]  Command `drupal:install ` exited with code 1. 

[replace with command, add -vvv for very very verbose output.]

blt setup -vvv

[debug] Drupal VM is not initialized.
Setting up local environment for site default.
Using drush alias @self
> source:build
[debug] Verifying that Drupal is installed...
[Robo\Common\ProcessExecutor] Running '/var/www/html/bltproject/dmultilingual/vendor/bin/drush' @self sqlq "SHOW TABLES LIKE 'config'" in /var/www/html/bltproject/dmultilingual/docroot
PHP Fatal error:  Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/html/bltproject/dmultilingual/docroot/core/includes/bootstrap.inc on line 83
 [error]  Drush command terminated abnormally due to an unrecoverable error.
Error: Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/html/bltproject/dmultilingual/docroot/core/includes/bootstrap.inc, line 83 
> tests:behat:init:config
> source:build:composer
[Exec] Running export COMPOSER_EXIT_ON_PATCH_FAILURE=1; composer install --ansi --no-interaction in /var/www/html/bltproject/dmultilingual
Gathering patches for root package.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
PHP CodeSniffer Config installed_paths set to ../../drupal/coder/coder_sniffer/
[Exec] Done in 0.648s
> blt:init:git-hooks
Installing pre-commit git hook...
[Filesystem\FilesystemStack] mkdir ["/var/www/html/bltproject/dmultilingual/.git/hooks"]
[Filesystem\FilesystemStack] remove ["/var/www/html/bltproject/dmultilingual/.git/hooks/pre-commit"]
[Filesystem\FilesystemStack] symlink ["../../vendor/acquia/blt/scripts/git-hooks/pre-commit","/var/www/html/bltproject/dmultilingual/.git/hooks/pre-commit"]
Installing commit-msg git hook...
[Filesystem\FilesystemStack] mkdir ["/var/www/html/bltproject/dmultilingual/.git/hooks"]
[Filesystem\FilesystemStack] remove ["/var/www/html/bltproject/dmultilingual/.git/hooks/commit-msg"]
[Filesystem\FilesystemStack] symlink ["../../vendor/acquia/blt/scripts/git-hooks/commit-msg","/var/www/html/bltproject/dmultilingual/.git/hooks/commit-msg"]
> blt:init:settings
Hash salt already exists.
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/default",511]
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/default/settings.php",511]
[File\Write] Writing to /var/www/html/bltproject/dmultilingual/docroot/sites/default/settings.php.
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/default/settings.php",420]
[debug] Switching site context to simpletest.
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/simpletest",511]
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/simpletest/settings.php",511]
[File\Write] Writing to /var/www/html/bltproject/dmultilingual/docroot/sites/simpletest/settings.php.
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/simpletest/settings.php",420]
 12/12 [============================] 100% < 1 sec/< 1 sec 10.0 MiB
[debug] Switching site context to default.
> source:build:frontend
> source:build:frontend-reqs
[info] Skipped frontend-reqs target hook. No hook is defined.
> source:build:frontend-assets
[info] Skipped frontend-assets target hook. No hook is defined.
[info] Skipped post-setup-build target hook. No hook is defined.
> drupal:deployment-identifier:init
Generating deployment identifier...
[File\Write] Writing to /var/www/html/bltproject/dmultilingual/deployment_identifier.
> drupal:install
[debug] Verifying that MySQL is available...
[Robo\Common\ProcessExecutor] Running '/var/www/html/bltproject/dmultilingual/vendor/bin/drush' @self sqlq "SHOW DATABASES" in /var/www/html/bltproject/dmultilingual/docroot
PHP Fatal error:  Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/html/bltproject/dmultilingual/docroot/core/includes/bootstrap.inc on line 83
 [error]  Drush command terminated abnormally due to an unrecoverable error.
Error: Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/html/bltproject/dmultilingual/docroot/core/includes/bootstrap.inc, line 83 


I get the following output:

Setting up local environment for site default.
Using drush alias @self
> source:build
> tests:behat:init:config
> source:build:composer
Gathering patches for root package.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
PHP CodeSniffer Config installed_paths set to ../../drupal/coder/coder_sniffer/
> blt:init:git-hooks
Installing pre-commit git hook...
Installing commit-msg git hook...
> blt:init:settings
Hash salt already exists.
> source:build:frontend
> source:build:frontend-reqs
> source:build:frontend-assets
> drupal:deployment-identifier:init
Generating deployment identifier...
> drupal:install
[error]  MySql is not available. Please run `blt doctor` to diagnose the issue. 
[error]  Command `drupal:install ` exited with code 1. 


[replace with ENTIRE command output. DO NOT enter partial output.]

And I expected this to happen:

@lcatlett
Copy link
Contributor

@arjunpws - do you have any custom BLT commands, or overrides to default BLT behavior in blt.yml or hooks? In the output logs you posted I see:

[debug] Switching site context to simpletest.
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/simpletest",511]
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/simpletest/settings.php",511]
[File\Write] Writing to /var/www/html/bltproject/dmultilingual/docroot/sites/simpletest/settings.php.
[Filesystem\FilesystemStack] _chmod ["/var/www/html/bltproject/dmultilingual/docroot/sites/simpletest/settings.php",420]
12/12 [============================] 100% < 1 sec/< 1 sec 10.0 MiB
[debug] Switching site context to default.

This seems like it could be related to your issue since simpletest is typically overriding the default database config

@arjunpws
Copy link
Author

@lcatlett - I haven't used any custom commands in blt.yml file

@arjunpws
Copy link
Author

arjunpws commented Jan 21, 2019

@lcatlett
my blt.yml file code is

project:
  machine_name: bltproj1
  prefix: BLT
  human_name: 'BLTed 8'
  profile:
    name: lightning
  local:
    protocol: http
    hostname: 'local.${project.machine_name}.com'
git:
  default_branch: master
  remotes: {}
deploy:
  tag_source: true
drush:
  aliases:
    remote: '${project.machine_name}.test'
    local: self
    ci: self
  default_alias: '${drush.aliases.local}'
modules:
  local:
    enable: [dblog, devel, seckit, views_ui]
    uninstall: [acquia_connector, shield]
  ci:
    enable: {  }
    uninstall: [acquia_connector, shield]
  dev:
    enable: [acquia_connector, shield]
    uninstall: {  }
  test:
    enable: [acquia_connector, shield]
    uninstall: [devel, views_ui]
  prod:
    enable: [acquia_connector, shield]
    uninstall: [devel, views_ui]

i have enabled simple test module in my existing project

I am using LAMP Server for this project

@mikemadison13 mikemadison13 added the Support A support request label Jan 22, 2019
@mikemadison13
Copy link
Contributor

I found a post on D.O that has a similar issue, can you do a drush -v to see what version of drush you have installed?

https://www.drupal.org/forum/support/post-installation/2016-04-11/d8-drupalcoresessionaccountinterface-not-found#comment-11817025

@arjunpws
Copy link
Author

@mikemadison13
I am getting the below issue when I am running "drush -v"

sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `BASH_FUNC_module'
PHP Fatal error: Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/html/bltproject/dmultilingual/docroot/core/includes/bootstrap.inc on line 83
[error] Drush command terminated abnormally due to an unrecoverable error.
Error: Class 'Drupal\Core\Session\AccountInterface' not found in /var/www/html/bltproject/dmultilingual/docroot/core/includes/bootstrap.inc, line 83

@arjunpws
Copy link
Author

arjunpws commented Jan 23, 2019

If I am running "drush --version"

sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `BASH_FUNC_module'
Drush Commandline Tool 9.5.2

But actually I a have installed drush 8.1.18 version in my system

@mikemadison13
Copy link
Contributor

So I think this is actually not a BLT issue, it sounds like an issue related to Bash or Drush. I just found drush-ops/drush#2065. Might be worth a look?

@mikemadison13
Copy link
Contributor

it also might be worth updating drush on your system to a newer version?

@arjunpws
Copy link
Author

arjunpws commented Jan 23, 2019

Please let me know if this the right process or not

In my local system( LAMP ), I have working Drupal 8.6 version project(/var/www/html/myproject/docroot) and I need to add blt to this project.
I have performed the steps as mentioned in the link https://blt.readthedocs.io/en/latest/adding-to-project/

I have moved the composer.json file from the docroot to myproject location, removed vendor directory and composer.lock file from the docroot and I have performed below steps

composer config minimum-stability dev
composer config prefer-stable true

composer require acquia/blt:^9.2.0 --no-update
composer update

after that, I have changed my project credentials in local.settings.php file generated by blt.
If I am accessing the project in the browser it is giving 500 error

@mikemadison13
Copy link
Contributor

closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support A support request
Projects
None yet
Development

No branches or pull requests

3 participants