When testing a local copy of d6, if I delete and re-create the database, then refresh the homepage, drupal redirects to the installer and suggests a re-install. The installer helpfully pre-populates the initial form fields based on the settings.php file from the last time.

In d7, performing the exact same steps results in:

Drupal already installed
  • To start over, you must empty your existing database.
  • To install to a different database, edit the appropriate settings.php file in the sites folder.
  • To upgrade an existing installation, proceed to the update script.
  • View your existing site.

This entire page is wrong:

  • Drupal is not "already installed", except for the stale settings file and directory which Drupal has inconveniently made read-only.
  • The database is already mysql -e 'drop database drupal; create database drupal;' empty. It can't get any emptier than that.
  • Visiting either of the links results in an equally unhelpful PDOException accompanied by a suggestion that the user "Please try again later."

It takes real imagination to come up with an error page as spectacularly unhelpful as this one.

Comments

damien tournoud’s picture

Status: Active » Postponed (maintainer needs more info)

There are two ways to get to this page:

  • Drupal managed to load something from the {variable} table, and as a consequence can safely assume that it is already installed,
  • As a safety mechanism, if your settings file fails validation and contains a legacy (Drupal 6) db_url setting.

Could you check which one you are bumping into?

damien tournoud’s picture

Issue tags: -Regression
pillarsdotnet’s picture

Issue tags: +Regression

install.core.inc around line 305:

    // Since previous versions of Drupal stored database connection information                    
    // in the 'db_url' variable, we should never let an installation proceed if                    
    // this variable is defined and the settings file was not verified above                       
    // (otherwise we risk installing over an existing site whose settings file                     
    // has not yet been updated).                                                                  
    if (!empty($GLOBALS['db_url'])) {

My additional comment:

      // If we can connect to the database and verify that the system table does                   
      // not exist, it should be safe to install.
damien tournoud’s picture

      // If we can connect to the database and verify that the system table does                   
      // not exist, it should be safe to install.

Well, that's not actually the point. Your settings file fail to validate. Why?

pillarsdotnet’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new3.82 KB

Settings fail to validate because I'm switching back and forth between d6 and d7. Seems silly that switching from d7 to d6 should be no problem, but switching from d6 to d7 gives me that spectacularly unhelpful error page.

Here's a first-try patch. Need to test.

pillarsdotnet’s picture

Title: Gracefully handle d7 install with an empty database and d6 settings.php file » Re-install with empty database invites me to empty the database -- huh?
Version: 8.x-dev » 7.x-dev
Status: Needs work » Needs review
Issue tags: -Needs backport to D7

Looks good to me. Here's what I did.

  1. mysql -e 'drop database drupal; create database drupal;'
  2. git checkout 6.x
  3. Install Drupal 6 via browser
  4. git checkout 1123628-d7 (Drupal 7.x with the above patch)
  5. Refresh browser page
  6. Got the "Drupal already installed" page. Good.
  7. mysql -e 'drop database drupal; create database drupal;'
  8. Refresh browser page
  9. Got to the "Select an installation profile" page.
  10. Proceeded to install Drupal 7
pillarsdotnet’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7
StatusFileSize
new3.47 KB
new3.47 KB

Bumping to 8.x and tagging.

pillarsdotnet’s picture

Title: Re-install with empty database invites me to empty the database -- huh? » Gracefully handle d7 install with an empty database and d6 settings.php file
pillarsdotnet’s picture

Status: Needs review » Needs work

Oops. After installation, clicking on the "Visit your new site" goes back to the "Drupal already installed" error. So CNW.

damien tournoud’s picture

Title: Re-install with empty database invites me to empty the database -- huh? » Gracefully handle d7 install with an empty database and d6 settings.php file
Version: 7.x-dev » 8.x-dev
Status: Needs review » Closed (won't fix)
Issue tags: -Regression

Sounds like the issue is between the computer and the chair.

pillarsdotnet’s picture

(chuckle) Sure; if you say so.