Installed D7 without a pre-made settings.php for the first time in months today, this is what it looks like:

Configure site | Drupal_1262237212305.png

Adding 'alpha blocker' tag since this is likely to stop people before they even get started.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Garrett Albright’s picture

Here's a text dump of all those warnings (paths different, obviously):

Warning: PDO::__construct(): [2002] Invalid argument (trying to connect via unix://) in /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc on line 332 Call Stack: 0.0065 1318144 1. {main}() /Users/garrett/Drupal/drupal/drupal/install.php:0 0.0099 1730064 2. install_drupal() /Users/garrett/Drupal/drupal/drupal/install.php:1755 0.1011 13114920 3. install_run_tasks() /Users/garrett/Drupal/drupal/drupal/install.php:87 0.2792 14136848 4. install_run_task() /Users/garrett/Drupal/drupal/drupal/install.php:347 0.2865 15061728 5. drupal_build_form() /Users/garrett/Drupal/drupal/drupal/install.php:397 0.2917 15764520 6. drupal_process_form() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:224 0.2946 15883056 7. drupal_validate_form() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:611 0.2946 15883968 8. _form_validate() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:789 0.2954 15943872 9. form_execute_handlers() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:934 0.2955 15948192 10. install_settings_form_validate() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:990 0.2955 15950264 11. install_database_errors() /Users/garrett/Drupal/drupal/drupal/install.php:938 0.2962 15952552 12. db_run_tasks() /Users/garrett/Drupal/drupal/drupal/install.php:974 0.2962 15953488 13. DatabaseTasks->runTasks() /Users/garrett/Drupal/drupal/drupal/includes/install.inc:1106 0.2962 15953488 14. DatabaseTasks->connect() /Users/garrett/Drupal/drupal/drupal/includes/install.inc:336 0.2962 15953488 15. Database::getConnection() /Users/garrett/Drupal/drupal/drupal/includes/install.inc:373 0.2963 15953624 16. Database::openConnection() /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc:1392 0.2963 15957672 17. DatabaseConnection_mysql->__construct() /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc:1537 0.2963 15961072 18. DatabaseConnection->__construct() /Users/garrett/Drupal/drupal/drupal/includes/database/mysql/database.inc:36 0.2963 15962024 19. PDO->__construct() /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc:332

You'll see similar warnings at other steps in installation.

tobiasb’s picture

FileSize
672 bytes
tobiasb’s picture

Status: Active » Needs review
David_Rothstein’s picture

The patch works, but rather than converting it to an array always, I think it might be better to use some kind of !empty() check before looping through the databases?

@catch, I can reproduce this bug, but only on the "Verify requirements" screen... how did you get past the requirements verification to make this screenshot? (If you don't have a settings file at all, you shouldn't be able to get past that stage, right?)

@Garrett Albright: Looks to me like the warnings you're seeing are a different issue.

catch’s picture

@David - my install was already there, so I didn't have to get past 'verify requirements' since file directory, settings.php etc. permissions were filled in. Also I get a full screen of warnings, but can still fill out and submit the form etc.

Sivaji_Ganesh_Jojodae’s picture

#2 works like a charm.

webchick’s picture

Ouch. :\

To clarify: you'll get this problem if the installer attempts to trigger an error message in the step prior to asking for database info because settings.php isn't there.

I confirmed the patch works but agreed with David that it feels very much like "treating the symptom". For instance, why are we even attempting to parseConnectionInfo() if we don't have a settings.php file?

webchick’s picture

Status: Needs review » Needs work
Issue tags: +webchick's D7 alpha hit list
Steve Dondley’s picture

I just found the problem and created a similar patch. I think it's a little more logical to put it in the _db_check_install_needed function. See http://drupal.org/node/672940#comment-2429284 for my patch. Though, yeah, ideally, the function to parse the file should not be called at all.

Sivaji_Ganesh_Jojodae’s picture

#672820: Bad foreach() argument in database.inc looks like a duplicate of this.

Steve Dondley’s picture

Status: Needs work » Needs review
FileSize
931 bytes

OK, here's a patch with a different approach. It also gets rid of what appears to be an unnecessary line now. I ran through the install and it got rid of the errors.

Steve Dondley’s picture

FileSize
934 bytes

Thinking about this a bit, I think it should explicitly check to see if $databases is an array. Not sure, though.

Damien Tournoud’s picture

Status: Needs review » Closed (duplicate)

This is basically a duplicate of #315513: Catch the absence of $databases settings array early, which is needed anyway.

atheneus’s picture

Patch #12 works and fixes the issue. However, I would tend to agree with webchick #7 that there should probably be a check for the settings file before trying to read information from it.

In fact - it seems really clumsy to me that we are setting new users up for failure on the first install by having an error be almost certain to be their first experience of installing Drupal. Shouldn't we be helping them to create the settings file from the installer? Basically, most people have to jump to their file browser / terminal and copy the default.settings.php file to settings.php and proceed. Why can't we automate the creation of the settings.php file since it gets updated with database information during the install process anyway?

I'd rather we could make the install process as fail-safe as possible.

atheneus’s picture

@david (#4) - If you click on continue without creating the settings.php file, ignoring the warning you will go to the database setup page shown in the screenshot. I think this should be considered a separate bug. If I receive a warning but can continue regardless I can only assume the warning is not that serious. Again, I think there needs to be more work done on the installer to make it as fail-safe as possible. Let's adopt the Kaizen principle of Poka-Yoke (fool proofing) here.

Steve Dondley’s picture

Garrett Albright’s picture

In fact - it seems really clumsy to me that we are setting new users up for failure on the first install by having an error be almost certain to be their first experience of installing Drupal. Shouldn't we be helping them to create the settings file from the installer? Basically, most people have to jump to their file browser / terminal and copy the default.settings.php file to settings.php and proceed. Why can't we automate the creation of the settings.php file since it gets updated with database information during the install process anyway?

I guess that the reasoning is that we want the user to have to take some sort of certain manual action on the server before installation can succeed (besides just installing/uploading the Drupal directory, anyway) in order to ensure the person doing the installation is indeed the administrator of the site instead of just some slob who managed to find the directory and can now wreak havoc with it. I agree, though, that having the requirement to do this initially presented to the user (making the safe assumption that they're ignoring any sort of documentation - does anyone still read the instruction manuals that come with video games?) be in the form of an error is unpleasant.

atheneus’s picture

My concerns on the ease of installation is really a user experience issue so I will followup in the appropriate forum:
http://www.d7ux.org/installation/#comments

webchick’s picture

There's an issue at #418302: Copy default.settings.php to settings.php during install IFF webserver owns files (FTP on shared hosting) to solve the issue you're talking of atheneus... but it's doubtful that'll make it into 7.x at this point unless someone dives in on that right now.

webchick’s picture

Removing tag, since this is a dupe now. If all else fails, I can come back and commit that cast patch, but I'd rather solve the underlying issues. See you folks in them. :)