Skip to content
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

Fix infinite loop of dispatching when drupal root in symlinked. #3342

Closed
wants to merge 1 commit into from

Conversation

awm086
Copy link

@awm086 awm086 commented Feb 2, 2018

Fix infinite loop of dispatching when drupal root lives in a symlinked directory.

Description:

  • when I have a d8 installation like /home/vagrant/sites/d8 where /home/vagrant/sites -> /var/www/
  • Path::isBasePath keeps returning false.
  • This causes constant dispatching and an infinite loop with messages . [preflight] Redispatch to site-local Drush: /home/vagrant/sites/d8/vendor/drush/drush/drush.

Fixes : #2755

Fix infinite loop of dispatching when drupal root lives in a symlinked directory.
@awm086 awm086 changed the title Fix infinite loop of dispatching. Fix infinite loop of dispatching when drupal root in symlinked. Feb 2, 2018
@awm086
Copy link
Author

awm086 commented Feb 15, 2018

@greg-1-anderson @weitzman could you please review this?

@weitzman
Copy link
Member

I have been removing realpath() links, not adding them. Please say more about your setup, composer usage, etc. As a general principe, I'm ok with Drush not supporting every possible setup.

@kmajzlik
Copy link

@weitzman - there is nothing special about configuration, see #2755 .
Being in /var/www/html drush works.
Being in ~/www (symlink to /var/www/html) drush goes into some kind of loop. Doesnt matter if called Laucher or Drush directly. I tried it on multiple environments.
Drush 9, Drupal 8.

@awm086
Copy link
Author

awm086 commented Feb 16, 2018

@weitzman my set up is simple:

  • d8 site via composer
  • drush (9.0.0) via composer and local to the project. I am executing the drush command via the vendor/drush
  • the only non-standard set up is that I have a symlink in the home directory to the site directory. /home/vagrant/sites/d8 where /home/vagrant/sites -> /var/www/. You can probably reproduce this easily.
  • Finally if symlinks are not supported then feel free to close this or if you have suggestion on how to fix this I will be happy to try again.

@awm086 awm086 closed this Feb 16, 2018
@awm086 awm086 reopened this Feb 16, 2018
@weitzman
Copy link
Member

I set up a symlink as described and Drush bootstraps fine when I'm in ~/www. Do you happen to have any Drush config that sets options.root to /home/vagrant/sites/d8. If so try removing that.

vagrant@mass:~/www$ ls -al ~ 
lrwxrwxrwx  1 vagrant vagrant   19 Feb 17 02:51 www -> /var/www/mass.local
vagrant@mass:~/www$ ./vendor/bin/drush st   
 Drupal version   : 8.4.4                                            
 Site URI         : http://mass.local                                
 DB driver        : mysql                                            
 DB hostname      : 127.0.0.1                                        
 DB port          : 3306                                             
 DB username      : root                                             
 DB name          : drupal                                           
 Database         : Connected                                        
 Drupal bootstrap : Successful                                       
 Default theme    : mass_theme                                       
 Admin theme      : mass_admin_theme                                 
 PHP binary       : /usr/bin/php7.0                                  
 PHP config       : /etc/php/7.0/cli/php.ini                         
 PHP OS           : Linux                                            
 Drush script     : /home/vagrant/www/vendor/bin/drush               
 Drush version    : 9.1.0                                            
 Drush temp       : /tmp                                             
 Drush configs    : /var/www/mass.local/vendor/drush/drush/drush.yml 
                    /var/www/mass.local/drush/drush.yml              
 Install profile  : standard                                         
 Drupal root      : /var/www/mass.local/docroot                      
 Site path        : sites/default                                    
 Files, Public    : sites/default/files                              
 Files, Temp      : /tmp                           

@awm086
Copy link
Author

awm086 commented Feb 17, 2018

@weitzman Thanks. I tried a fresh install with drush 9.1.0 and I cannot reproduce the issue. I also tried 9.0.0 again and everything worked just fine ( I even tried a global drush install). so the reason must be something with configuration. I am closing this PR until I can figure out the exact configs that resulted in the dipatch loop. thanks again.

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

Successfully merging this pull request may close these issues.

3 participants