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

lando drupal broken due to upstream issue/breaking changes #11

Open
mrweiner opened this issue Aug 20, 2020 · 8 comments
Open

lando drupal broken due to upstream issue/breaking changes #11

mrweiner opened this issue Aug 20, 2020 · 8 comments

Comments

@mrweiner
Copy link

Per hechoendrupal/drupal-console#4262, there appears to be an issue with the installer (https://drupalconsole.com/installer) being unavailable. This is causing lando drupal to throw /usr/local/bin/drupal: 2: /usr/local/bin/drupal: Syntax error: redirection unexpected since the 500 page contents are being downloaded instead of the installer itself.

In that issue, the maintainer noted that

We are working to solve this but in future versions this installer will be removed.

Please use the composer require drupal/console to install DC

As such, it might be a good idea to figure out how to remove the dependency on the installer itself. Somebody in the ticket noted that a dirty workaround is to grab a copy of the drupal executable from elsewhere (an env that still/already has it) and use that directly. So, something like adding that executable to a known url and grabbing it from there instead.

In either case, lando drupal is broken until the installer issue is handled.

@mrweiner
Copy link
Author

mrweiner commented Aug 20, 2020

Alright I've got another workaround for the meantime, assuming you've already ran composer drupal/console, so it's sitting in your project's vendor dir, you can add this to your .lando.yml

services:
  appserver:
    build:
      - "rm /usr/local/bin/drupal; ln -s /app/path_to_your/vendor/drupal/console/bin /usr/local/bin/drupal"

Actually, another option would be to include composer global require drupal/console in build, and then symlink the executable that it provides instead of the one from the project's vendor dir. I'm not sure where global req installs items inside of the docker machine, though, but if should be easy enough to figure that out.

@mrweiner
Copy link
Author

mrweiner commented Sep 8, 2020

This started giving me a permissions error that I couldn't sort out, so added a tooling override instead:

tooling:
  drupal:
    cmd: "/app/my_project/vendor/bin/drupal --root=/app/my_project/web"

@yuseferi
Copy link

Add it as a custom tool, by adding the following line to .lando.yaml file

tooling:
  drupal:
    cmd: "/app/web/vendor/bin/drupal --root=/app/web"

then restart lando with lando restart

@mrweiner
Copy link
Author

@yuseferi yup, that's what my last comment says to do :)

@CheckeredFlag
Copy link

What if /app/web/vendor/bin/drupal doesn't exist? Attempts to install it via composer sentenced me to dependency hell and trying to copy it from elsewhere didn't work either.

@mrweiner
Copy link
Author

mrweiner commented Dec 1, 2020

@CheckeredFlag this solution requires that your drupal project itself composer requires drupal/console. I don't think I've hit dependency hell requiring console, so I unfortunately cannot speak to that, but without installing via composer the bin/drupal script and it's reqs won't exist anywhere.

@CheckeredFlag
Copy link

Updated an older symfony/css-selector dependency that resolved things.

@awm086
Copy link

awm086 commented Apr 19, 2021

is there a work around. I am having issues with drupal console using lando's drupal 9 recipe. I tried install and build gloablly and but I get the following:

[ERROR] Drupal Console is not installed at: "                                                                          
         /app"                                                                                                                                                                                                                              
 You must execute the following composer commands:
omposer require drupal/console:~1.0 --prefer-dist --optimize-autoloader                                               

and when I go with the composer route I am having dependency issues and even when I resolve them I get a lot of missing console commands which I presume it's a drupal console issue.

@rtfm-47 rtfm-47 transferred this issue from lando/lando Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants