Steps to reproduce:

1.) Create sites directory (sub.domain.com.directory) with writable settings.php (default file).
2.) Launch installer (sub.domain.com/directory).
3.) Enter database information in the "Database configuration" form and submit.

Expected:

Database gets tested, settings file gets written, site gets installed.

Actual:

Database gets successfully tested, but the settings file is not written and the installer reloads an empty "Database configuration" form.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cburschka’s picture

Title: Database installation does not work » Database installation does not work when "default" folder is not writable

I have discovered that the (completely unused) "default" sites directory was not writable, and that making it writable fixed the problem.

This is still a bug, because the installer has no business doing anything with the "default" directory when a writable default settings.php file exists in another sites folder with higher priority (such as "domain.com")

swentel’s picture

Can't reproduce this at this moment, works fine for me.

cburschka’s picture

Priority: Critical » Normal

Okay then, let's deescalate it for the moment. I'll see if I can get it to happen again...

Berdir’s picture

Isn't this somehow related to http://drupal.org/node/332730?

Tor Arne Thune’s picture

@cburschka: Can you reproduce this in Drupal 7.4?

cangeceiro’s picture

I can easily reproduce this on every d7 installation i have configured on my dev server.

grayb’s picture

I have this same issue. Why exactly does the default directory _need_ to be writable?

cmoad’s picture

Ditto. This has happened on every D7 install I have ever performed. Literally hundreds across dozens of machines.

David_Rothstein’s picture

Title: Database installation does not work when "default" folder is not writable » The "default" folder is sometimes requires to be writable even when installing Drupal in sites/example.com
Version: 7.x-dev » 8.x-dev
Status: Active » Needs review
Issue tags: +Needs backport to D7
FileSize
966 bytes

I think the bug report as originally described is slightly out of date, but I can reproduce a different version of the same problem. However, I can only reproduce it when the sites/example.com/settings.php file isn't present also. Maybe that's why not everyone can reproduce it above.

Basically, if the settings.php file isn't there, some of the requirement-checking code doesn't recognize sites/example.com as a valid Drupal site directory. So on the requirements warning page, it thinks it should be trying to write sites/default/files instead, and it fails. The result is that in addition to the settings.php error message, you also get an erroneous message saying that sites/default/files can't be written and you need to make sites/default writeable for that reason.

Here's a patch that should fix it. This seems to work, but may need more thought.

David_Rothstein’s picture

Title: The "default" folder is sometimes requires to be writable even when installing Drupal in sites/example.com » The "default" folder is sometimes required to be writable even when installing Drupal in sites/example.com
skottler’s picture

Status: Needs review » Reviewed & tested by the community

@David_Rothstein's patch works for me. Marking RTBC.

catch’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Makes sense, looks untestable, committed/pushed to 8.x.

sun’s picture

Version: 7.x-dev » 8.x-dev
Status: Patch (to be ported) » Reviewed & tested by the community

Don't see a commit for this.

Albert Volkman’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Needs review
FileSize
946 bytes

D7 backport.

Did the D8 patch get committed? I don't see it in HEAD.

sun’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Reviewed & tested by the community

Back to #11

catch’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed/pushed to 8.x, moving to 7.x for backport.

Albert Volkman’s picture

Status: Patch (to be ported) » Needs review

Backport in #16.

mgifford’s picture

dcam’s picture

Issue summary: View changes

I can't reproduce the issue (default site directory non-writable, no settings.php in either site directory), so I can't RTBC the patch.

#16 contains the exact same change that went into D8. So I'll say RTBC +1.

  • catch committed 8e7a80b on 8.3.x
    Issue #334948 by David_Rothstein, Albert Volkman: Fixed The 'default'...

  • catch committed 8e7a80b on 8.3.x
    Issue #334948 by David_Rothstein, Albert Volkman: Fixed The 'default'...

  • catch committed 8e7a80b on 8.4.x
    Issue #334948 by David_Rothstein, Albert Volkman: Fixed The 'default'...

  • catch committed 8e7a80b on 8.4.x
    Issue #334948 by David_Rothstein, Albert Volkman: Fixed The 'default'...

  • catch committed 8e7a80b on 9.1.x
    Issue #334948 by David_Rothstein, Albert Volkman: Fixed The 'default'...