Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Allow Drupal 8 to Install in Git Mode #36

Open
dustinleblanc opened this issue May 1, 2015 · 21 comments
Open

Allow Drupal 8 to Install in Git Mode #36

dustinleblanc opened this issue May 1, 2015 · 21 comments

Comments

@dustinleblanc
Copy link

Getting this trying to install Drupal 8 with beta10

Warning: file_put_contents(/srv/bindings/c4d5b76556834511adc9eabdd3fc78b7/code/sites/default/settings.php): failed to open stream: Permission denied in drupal_rewrite_settings() (line 319 of core/includes/install.inc).
drupal_rewrite_settings(Array)
install_write_profile(Array)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal(Object)
Exception: Failed to modify <em class="placeholder">sites/default/settings.php</em>. Verify the file permissions. in drupal_rewrite_settings() (line 320 of core/includes/install.inc).
drupal_rewrite_settings(Array)
install_write_profile(Array)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal(Object)

Install stops there

@dustinleblanc
Copy link
Author

Running my installer locally and commiting the changes, then pushing up to Pantheon solved the problem.

The diff was just this line:
$settings['install_profile'] = 'standard'; so it seems adding a install profile line to the settings file would alleviate the issue

@populist
Copy link

populist commented May 6, 2015

This is a known issue since Drupal 8 requires write access to the settings.php to write this information. Our default is SFTP mode which allows this writability ,but presumably you are in Git mode. Leaving this open until we figure out a way to get this value set in both SFTP + Git mode.

@weitzman
Copy link

I wrote a patch which will avoid the problem for all sites based on Distros - https://www.drupal.org/node/2156401. Please help review.

@seanr
Copy link

seanr commented Jul 25, 2015

Yep, I had to switch back to SFTP and was then able to proceed with the install. Perhaps you guys can set the permissions of that directory differently for install? Or at least some help text around this - I figured it out on my own pretty quickly, but less experienced users (or even long-term Drupal folks without Pantheon experience) might not. :-)

@populist populist changed the title Attempts to update settings.php fail on install Allow Drupal 8 to Install in Git Mode Aug 17, 2015
@populist populist added the minor label Aug 17, 2015
@populist
Copy link

It would be ideal to get Moshe's patch to work in Drupal so we can install in either case, otherwise we can just provide a bit more documentation to tell users that first time installs need to happen in settings.php.

@weitzman
Copy link

I could use help with that issue. I ran out of steam and dont plan to return to it.

@greg-1-anderson
Copy link
Member

The big bug-a-boo here is the question catch raised. If people are really concerned that someone might run into problems by converting a single-distro multisite into a multiple-distro multisite, then the issue will probably never get committed. No one responded to that concern, though; maybe this means the concern is minor enough that it might move forward anyway?

At this point, we can install cleanly without it, so the benefit we get is that it would allow us to install in 'git' mode, instead of requiring a switch to sftp mode. I don't think that's critical for us, but I might return there as time permits if it seemed the efforts might be fruitful.

@4aficiona2
Copy link

Looks like this is still an issue. Tried to install a site on Pantheon in git mode and get the following error:

Warning: file_put_contents(sites/default/settings.php): failed to open stream: Permission denied in drupal_rewrite_settings() (line 337 of core/includes/install.inc).
drupal_rewrite_settings(Array)
install_write_profile(Array)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal(Object)

Because the issue got closed I assumed that it got also resolved. What is the current state?

@greg-1-anderson
Copy link
Member

This issue is open. See also the issue on Drupal.org: https://www.drupal.org/node/2156401. If that is fixed and committed to Drupal core, then installation in "git" mode will work on Pantheon. For now, though, you must switch to SFTP mode before installing.

@heddn
Copy link

heddn commented Jul 14, 2016

Where's the status on this and on relocatable docroot?

@greg-1-anderson
Copy link
Member

The main problem with this issue is that even once https://www.drupal.org/node/2156401 is committed, it doesn't really help the DX here unless we (a) make a 'Pantheon' distribution in drops-8, or (b) write the 'standard' profile into settings.php. Either of those options would make it inconvenient for folks who want to install the 'minimal' profile. Because of that, we probably won't take any action vis-a-vis 2156401 in drops-8 -- we will inherit this fix once it is committed to Drupal core. Therefore, installing in git mode will only be available for those who update their settings.php prior to installing. Practically speaking, this will probably mostly be folks who set up a custom upstream.

@deborah-ufw
Copy link

deborah-ufw commented Nov 20, 2016

I've just run into this problem and have not been able to re-run the installer after switching to SFTP in my Pantheon dashboard. 5 minutes into Pantheon and the install failure is compromising - an error as immediate as getting Drupal installed, which completely blocks further progress, creates a poor start for evaluating Pantheon.

I chose "minimal" as my Drupal install. Pantheon should not allow users to choose this if it causes an error the user can't easily fix, without warning them or telling them in advance they will have to fix it and how to do so. Alternatively, Pantheon could suppress presenting user with a choice between Git and SFTP until after the install is complete.

Using an SFTP tool (Filezilla) to try to manually update settings.php also did not work for me. Neither did pushing my local install (which succeeded).

@ari-gold
Copy link
Contributor

@deborah-ufw Can you try again with another site? I was just able to install successfully. If you're still having issues, please contact support.

The fix is upstream, not something directly in our control, but since this issue was opened, we added an error message to prompt you to change to Git mode for installation:
screenshot 2016-11-21 11 23 32

Successful install today:
screenshot 2016-11-21 11 28 56

@greg-1-anderson
Copy link
Member

I was also able to install successfully using the minimal installation profile.

@GuyPaddock
Copy link

Looks like SFTP mode is still required for installs:
image

@dustinleblanc
Copy link
Author

Correct, but now that its been that way long enough to graduate college, I've just learned to live with it :)

@weitzman
Copy link

FWIW, my patch was accepted into Drupal core 3 years ago so it may be possible for Pantheon to get past the limitation.

And yeah, perhaps its no longer a priority for anyone, given the duration of the limitation.

@deborah-ufw
Copy link

Thank you for the patch !! I was amazed to get a notification 5 years after commenting on this thread.

And yeah, perhaps its no longer a priority for anyone, given the duration of the limitation.

Pantheon may have difficulty evaluating how many potential users have dropped off (and will continue to drop off) when they experience this kind of a failure on an install where the purpose is to evaluate the platform. Blocking first time users is usually a business killer.

@dustinleblanc
Copy link
Author

I'd agree, but the platform now warns you specifically about what the cause of the issue is, and I believe it even spins up Drupal 8 sites in SFTP mode, so the experience is not the same as it was when us fledgling D8 developers tried to use the new fancy and hit problems. I think that is why the issue went four years without a comment :)

@powpow12
Copy link

Confirmed that I got the notification today while trying to install on git. Just my two cents, I was concerned that switching from git to sftp was going to break something. I didn't feel confident it wouldn't until I found this issue and read the comments.

@namespacebrian
Copy link

namespacebrian commented Mar 23, 2022

Greetings from the future!

A fix has been merged so it's no longer necessary to be in "SFTP mode" to install Drupal. The configuration change will roll out gradually to existing sites.. new sites should get it immediately.

I'll leave this issue open for a couple days and close it if no issues arise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests