Incorrect values inside of $install_state global variable could lead to fatal errors. For example, execution of drush si standart -y will fails with a fatal error, because the standart - is not valid name of installation profiles.

Full stack trace:

BR0kEN@Macintosh:/var/www/drupal/drupal8 (8.3.x) $ drush si standart -y
You are about to DROP all tables in your 'drupal8' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                                                                                     [ok]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302                                                                                                                                                [warning]
The following module is missing from the file system: standart bootstrap.inc:235                                                                                                                 [warning]
Error: Call to a member function getPath() on null in /private/var/www/drupal/drupal8/core/includes/install.core.inc on line 793 #0 /private/var/www/drupal/drupal8/core/includes/install.core.inc(679): install_tasks(Array)
#1 /private/var/www/drupal/drupal8/core/includes/install.core.inc(531): install_tasks_to_perform(Array)
#2 /private/var/www/drupal/drupal8/core/includes/install.core.inc(115): install_run_tasks(Array)
#3 /usr/local/Cellar/drush/8.1.3/libexec/includes/drush.inc(726): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4 /usr/local/Cellar/drush/8.1.3/libexec/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#5 /usr/local/Cellar/drush/8.1.3/libexec/commands/core/drupal/site_install.inc(80): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#6 /usr/local/Cellar/drush/8.1.3/libexec/commands/core/site_install.drush.inc(247): drush_core_site_install_version('standart', Array)
#7 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(373): drush_core_site_install('standart')
#8 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#9 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(192): drush_command('standart')
#10 /usr/local/Cellar/drush/8.1.3/libexec/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#11 /usr/local/Cellar/drush/8.1.3/libexec/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 /usr/local/Cellar/drush/8.1.3/libexec/drush.php(12): drush_main()
#13 {main}
Error: Call to a member function getPath() on null in install_tasks() (line 793 of /private/var/www/drupal/drupal8/core/includes/install.core.inc).
Drush command terminated abnormally due to an unrecoverable error.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fgm’s picture

Category: Task » Bug report

Noticed this today too. Of course, in the Web UI, profiles are selected from a list of available values, so the problem can not be triggered.

In today's HEAD, this is at line 771 of install.core.inc, where install_tasks() accesses profile date without assessing whether or not they are present, probably assuming only a valid profile may have been passed for install. I would say this is not a Drush issue, at least not entirely, especially since the param documentation for $install_state, from which the profile name is drawn, mentions the variability of the $install_state content.

So IMHO, this is a core bug.

fgm’s picture

Status: Active » Needs review
FileSize
4.97 KB

Possible patch : add the profile to the list of missing extensions during the requirements check, and don't barf elsewhere on this.

mgifford’s picture

Status: Needs review » Needs work

Patch no longer applies.

csheltonlcm’s picture

I've rerolled the patch; I didn't need to change anything, it auto merged just fine; however I didn't have any trouble applying the original patch either.

heykarthikwithu’s picture

Status: Needs work » Needs review

#4 patch applies.

heykarthikwithu’s picture

FileSize
2.73 KB
andypost’s picture

ajalan065’s picture

I have reviewed the last patch in comment #4
And here is my review.
1. First of all, the patch applies neatly to the issue, without any conflicts.
2. It passes the Drupal Coding Standards.
(a) Indenting done with 2 spaces, and no tabs.
(b) Proper Control Structure and Line length wrapping
(c) Comments and Naming Conventions followed.
3. Comments are readable and grammatically correct.
4. No duplicacy, code is efficient and the patch's test sufficient.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

BR0kEN’s picture

Title: Getting not so useful information on wrong install profile name » Call to a member function getPath() on null when trying to install non-existent profile
Version: 8.2.x-dev » 8.3.x-dev
Assigned: Unassigned » BR0kEN
Priority: Minor » Normal
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +installation, +install profile
BR0kEN’s picture

BR0kEN’s picture

+++ b/core/includes/install.core.inc
@@ -816,10 +816,9 @@ function install_tasks($install_state) {
-  if (!empty($install_state['parameters']['profile'])) {

I've decided to use already existing $profile variable instead of $install_state['parameters']['profile'], because the last one could be changed by the PROFILE_install_tasks() hook.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Category: Bug report » Feature request
Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.

The issue described in the issue summary I was not able to reproduce I get

 [notice] Starting Drupal installation. This takes a while.

In ExtensionList.php line 522:
                                        
  The profile standart does not exist.  
                                        

Failed to run drush si standart -y: exit status 1

When I apply the patch I get

In install.core.inc line 1295:
                                                                                                                                                                                                               
  standart - is not valid name of installation profile. Use one of the following: demo_umami, minimal, nightwatch_testing, standard, testing, testing_config_import, testing_config_overrides, testing_instal  
  l_profile_all_dependencies, testing_install_profile_dependencies, testing_missing_dependencies, testing_multilingual, testing_multilingual_with_english, testing_requirements, testing_site_config, testing  
  _themes_blocks.                                                                                                                                                                                              
                                                                                                                                                                                                               

Failed to run drush si standart -y: exit status 1

Even though the error is not reproducible maybe the message listing the installation profiles could be an improvement?

Moving to NW for the issue summary update.

If not a valid feature please close.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.