-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drush cr
in fresh Drupal 8 install results in Missing $settings['hash_salt'] in settings.php
#1050
Comments
Any news on this one? I have the same problem. |
Can you look at your settings.php file and see if you have $settings['hash_salt'] set to anything? Thats required in D8. |
Also facing this problem by executing |
I have always had a salt value set as far as I know. Interestingly, drush cr is now working for me since reinstalling with Drupal-8.0.0-beta4 |
I think at one time I had traced to this commit - But haven't checked lately or looked deeper. On Sun, Dec 21, 2014 at 5:21 PM, Mark Shropshire notifications@github.com
|
I also have the same error using 7.0.0-alpha7, but not using 7.0.0-alpha6. |
That commit was buggy but has been fixed for some time. Do you guys have |
We only have one [default]. |
@weitzman : Nop. Only one site, settings.php is in the default folder (/sites/default). ( Same thing happens when I use master branch. ) |
Folks - please confirm that this is happenning when you use very latest Drush and Drupal 8 beta4 or later. |
It was happening with beta3. Will test with beta4 and let you know asap |
hm.. yes, indeed it worked with drupal beta4 |
|
Having a hash salt string within settings.php and using the latest drush-master und D8-beta9 i get this error when i se drush cr: |
Just add:
into your |
Here is a really good article that explains the good advice by @kenorb: Drupal Easy -- specifically from a Pantheon POV |
@kenorb thank you that worked: for #1050 (comment)
I then ran drush cr when in mysite.dev/web (as an example) and the command completed without the error. I can also visit mysite.dev in the browser and now longer get unexpected error please try later error. Thank you. |
Can confirm it works and is pretty much needed for Pantheon -> Acquia DevDesktop on Windows I had to drop-tables and re-import and then cache-rebuild though. |
@cleverington I had to make that change running Drupal 8.3.x and DevDesktop, as well, although I believe it would have been the same for other local dev environments. Luckily, though, I didn't need to drop the DB and reimport. |
@carnnia Your problem above is unrelated to the things discussed in this closed issue. Please open a new issue, and compare behavior of Drush 8.1.15 with Drush 9.0.0-beta9 with your site. |
I can confirm that this error also triggers sometimes when Drupal can't find the settings file. It happened to me when I wasn't referencing settings.local.php from my settings.php correctly. It is somewhat different in drupal 8 than drupal 7. |
I can confirm the above comment by @loopy3025 I am getting this error with drush9 though I have |
I am now having this problem with Drupal 8.5.1 and Drush 9.2.1. I don't understand where the hash salt comes from. It is not on any settings.php files in any version of Drupal 8 that I am running. Who supplies it and when in the process. And maybe a bigger question is "why this added complexity". |
I am having this issue as well on a clean D8.5.1 install with Drush 9.2.3. Maybe the most strange thing is that I do have a $settings['hash_salt'] value set... |
Same here, Fresh drupal 8.5.1 install via composer with drush 9.2.3. I have long hash value in $settings['hash_salt'] |
Well, I'm having the same issue with a multisite instalation after launch drush cr :-/ |
Ok, that's my fault xD ...When you're using drush cr in a multisite installation, you have to launch the order within a project folder. Drush cr goes to look for the specific database related with the project and if you are in the global multisite folder, there is no database there xD. Ok. |
I've installed Drupal 8 with composer, arranged my sites/ folder for multisite and immediately encountered this problem. Drush gives the missing salt error even within when ran in a site folder. However, Drush will work by using the --uri= argument: |
Add below line of code in either settings.php or settings.local.php, This was solved the same error for me. Basically we need to set some hash salt for more security and it will be used in string encryption like password. |
Another reason you might get this error: if you're in a Lando container (Pantheon recipe in my case) and you accidentally typed |
i don't have this issue when i setup a d8 site using /sites/default. |
If your are in a multisite context execute the drush command inside the proper site folder. |
Similar to @carnnia
|
For me it also fails.
|
for me, |
Folks, please be sure that your |
Sorry, may be this reply pass for 1 year. but, i ever face same issue $settings['hash_salt'] even I've been set in settings.php or settings.local.php. But, I found and fix the problem with server user : group access. Coz, when I run drush cr with different user group then settings.php or with simple sentence "permission denied". |
also make sure you're not using |
drush cr
in fresh Drupal 8 install results in Missing $settings['hash_salt'] in settings.phpBelow is the full trace after the errors. I have tried a few installs of Drupal 8.0.0-beta3 and continue to get the same results. I am running php 5.5.
exception 'RuntimeException' with message 'Missing $settings['hash_salt'] in settings.php.' in /Users/shrop/Projects/www/core/lib/Drupal/Core/Site/Settings.php:130 [error]
Stack trace:
#0 /Users/shrop/Projects/www/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php(47): Drupal\Core\Site\Settings::getHashSalt()
#1 /Users/shrop/Projects/www/core/includes/utility.inc(35): Drupal\Core\PhpStorage\PhpStorageFactory::get('service_contain...')
#2 /Users/shrop/bin/drush/commands/core/cache.drush.inc(278): drupal_rebuild(Object(Composer\Autoload\ClassLoader), Object(Symfony\Component\HttpFoundation\Request))
#3 [internal function]: drush_cache_rebuild()
#4 /Users/shrop/bin/drush/includes/command.inc(359): call_user_func_array('drush_cache_reb...', Array)
#5 /Users/shrop/bin/drush/includes/command.inc(210): _drush_invoke_hooks(Array, Array)
#6 [internal function]: drush_command()
#7 /Users/shrop/bin/drush/includes/command.inc(178): call_user_func_array('drush_command', Array)
#8 /Users/shrop/bin/drush/lib/Drush/Boot/DrupalBoot.php(46): drush_dispatch(Array)
#9 /Users/shrop/bin/drush/drush.php(76): Drush\Boot\DrupalBoot->bootstrap_and_dispatch()
#10 /Users/shrop/bin/drush/drush.php(16): drush_main()
#11 {main}
The text was updated successfully, but these errors were encountered: