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

Problem with drush commands on the terminal (auto yes selected) when exporting/importing configurations #1118

Closed
Gonzalo2683 opened this issue Sep 19, 2018 · 4 comments
Milestone

Comments

@Gonzalo2683
Copy link

Gonzalo2683 commented Sep 19, 2018

Describe the bug
When I execute tasks such as drush cex or cim (actually in any command that involves the user taking a decision), when the console appears if i want(or not want) to export/apply the changes, it selects itself in the Yes option and applies/exports the configurations, that is, I do not have the way of saying NO to the process that will be carried out.

I'm using Windows 10 Pro and I'm using the Cmder terminal.

To Reproduce
Steps to reproduce the behavior:

  1. Go to server ddev ssh -s web
  2. run drush @siteAlias cex
  3. See error

Expected behavior
That allows me to select whether or not I want to apply the changes.

Version and configuration information (please complete the following information):

  • Windows 10 Pro

Docker version information (use docker version)

Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:21:34 2018
 OS/Arch:           windows/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:29:02 2018
  OS/Arch:          linux/amd64
  Experimental:     false

ddev version information (use ddev version)

commit  v1.0.0
domain  ddev.local
cli     v1.0.0

config.yaml contents for the misbehaving project

APIVersion: v1.0.0
name: project-one
type: drupal8
docroot: ""
php_version: "7.1"
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames:
- site-a
- site-b
additional_fqdns: []
provider: default

Do you have any custom configuration (nginx, php, mysql) in the .ddev folder? If so, have you tried without them?

The only thing I have additional is a file called docker-compose.drush.yaml to have the aliases of the site in local volume.

version: '3'
services:
  web:
    volumes:
      - "$HOME/.projectname/.drush/:/home/.drush/"
      - "$HOME/.projectname/.drush/aliases:/home/.drush/aliases"
      - "$HOME/.projectname/.drush/commands:/home/.drush/commands"
@rfay
Copy link
Member

rfay commented Sep 19, 2018

The issue for -y is Always -y on drush commands causes unexpected behavior when using drush in container - I certainly agree that we should fix that up.

However, could you give a simpler example (without site alias) that demonstrates your exact problem?

The problem configuration is in /etc/drush/drushrc.php ($options['yes'] = 1;). If you just unset($options['yes']); in a config file that has precedence that will also solve the problem. For a one-shot fix (which unfortunately is undone when you rebuild the container) you can just edit /etc/drush/drushrc.php.

@Gonzalo2683
Copy link
Author

The problem for me is that sometimes I just want to see what settings have changed but I do not want to apply them yet and the way it is now I can not make this happen.

Question? Can I create a file in the project volume that does the unset you mention?
What file could this be? Where is it advisable to locate it?

I'm not using ddev exec in this project that I have, so I could temporarily dispense with it. And good if you need it I would enable it by changing some file that is over writing the variable $ options ['yes']

Thank you

@Gonzalo2683
Copy link
Author

Ok, after reading the documentation here: http://api.drush.org/api/drush/examples%21example.drushrc.php/8.0.x

Create a new file and place it in /home/.drush/ in my local volumen, with the following code:

drushrc.php

<?php
//unset($options['yes']); // not work
$options['yes'] = 0; // works

Thanks for all the help.

@rfay
Copy link
Member

rfay commented Sep 20, 2018

Thanks so much. I do think it's time for us to fix that, so I'll leave this open and see if we can get that fixed right. Shouldn't be hard. We need 'yes' only when running under ddev exec.

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

No branches or pull requests

3 participants