0

I have a drupal 8 website up and running on a server. On this server I use the Drush Launcher to work with Drush on my site.

For some reason the Drush command drush updb doesn't work I get the following error:

  The command "/home/deb91568n5/bin/drush updatedb:status --no-entity-updates --uri=default --root=/home/x/domains/domain.nl/public_html" failed.  
                                                                                                                                                            
  Exit Code: 1(General error)                                                                                                                               
                                                                                                                                                            
  Working directory:                                                                                                                                        
                                                                                                                                                            
  Output:                                                                                                                                                   
  ================                                                                                                                                          
  The Drush launcher could not find a local Drush in your Drupal site.                                                                                      
  Please add Drush with Composer to your project.                                                                                                           
  Run 'cd "/home/x/domains/domain.nl/public_html" && composer require drush/drush'                                                                 
                                                                                                                                                            
                                                                                                                                                            
  Error Output:                                                                                                                                             
  ================

Strange thing is that cr is working normally and even updatedb:status works as it should. My drush can be found in the root of my installation domain.nl/vendor/bin like it should.

On a other server this set-up does work. I can't find out what the problem is. For the time beeing I'm using vendor/bin/drush updb to update my db but I would realy love to have the Launcher back working again.

Update:

I'm running Drush 10.3, and I'm using de drush updb from the root of the site. My setup is like root/public_html/core.

My composer file looks like:

{
    "name": "drupal-composer/drupal-project",
    "description": "Project template for Drupal 8 projects with composer",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "authors": [
        {
            "name": "",
            "role": ""
        }
    ],
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.2",
        "cweagans/composer-patches": "^1.6",
        "drupal-composer/drupal-scaffold": "^2.5",
        "drupal/admin_toolbar": "^2.2",
        "drupal/adminimal_admin_toolbar": "^1.7",
        "drupal/adminimal_theme": "^1.3",
        "drupal/advagg": "^4.0",
        "drupal/ajax_loader": "^1.4",
        "drupal/animated_gif": "^1.1",
        "drupal/anonymous_login": "^1.1",
        "drupal/console": "^1.0.2",
        "drupal/core": "~8.6",
        "drupal/ctools": "^3.0",
        "drupal/devel": "^2.0",
        "drupal/draggableviews": "^1.0",
        "drupal/eck": "^1.0@alpha",
        "drupal/editor_advanced_link": "^1.4",
        "drupal/field_group": "^1.6",
        "drupal/login_destination": "1.x-dev",
        "drupal/login_history": "^1.0",
        "drupal/metatag": "^1.5",
        "drupal/neutral_paths": "^1.1",
        "drupal/node_view_permissions": "^1.2",
        "drupal/override_node_options": "^2.4",
        "drupal/paragraphs": "^1.5",
        "drupal/pathauto": "^1.2",
        "drupal/rabbit_hole": "^1.0@beta",
        "drupal/recaptcha": "^2.4",
        "drupal/redirect": "^1.3",
        "drupal/redis": "^1.4",
        "drupal/restui": "^1.16",
        "drupal/tablefield": "^2.0@alpha",
        "drupal/token": "^1.3",
        "drupal/user_edit": "1.x-dev",
        "drupal/video_embed_field": "^2.0",
        "drupal/views_field_view": "^1.0@beta",
        "drush/drush": "^10.3",
        "symfony/var-dumper": "^4.1",
        "vlucas/phpdotenv": "^2.4",
        "webflo/drupal-finder": "^1.0.0",
        "webmozart/path-util": "^2.3"
    },
    "require-dev": {
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "autoload": {
        "classmap": [
            "scripts/composer/ScriptHandler.php"
        ],
        "files": ["load.environment.php"]
    },
    "scripts": {
        "pre-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "pre-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "post-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ],
        "post-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ]
    },
    "extra": {
        "installer-paths": {
            "public_html/core": ["type:drupal-core"],
            "public_html/libraries/{$name}": ["type:drupal-library"],
            "public_html/modules/contrib/{$name}": ["type:drupal-module"],
            "public_html/profiles/contrib/{$name}": ["type:drupal-profile"],
            "public_html/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/{$name}": ["type:drupal-drush"]
        },
        "patches": {
        },
        "drupal-scaffold": {
            "initial": {
                ".editorconfig": "../.editorconfig",
                ".gitattributes": "../.gitattributes"
            }
        }
    }
}
10
  • What does drush --version return? From where exactly were you calling drush updb? How does your composer.json look like? Can you please add it to your question? – leymannx Sep 18 '20 at 11:04
  • 1
    Could it be that there is another composer.json file inside public_html? – leymannx Sep 22 '20 at 7:38
  • Hi thanks for your quick reply, no there is no composer file in the public_html folder – Joost Sep 22 '20 at 7:47
  • What does drush --version return? To get to know the Drush Launcher version. – leymannx Sep 22 '20 at 7:51
  • 1
    When trying to remove the vendor folder I discovered that there was a composer.json file in the public_html..when you asked me I checked on my local site not the remote one because I thought it should be the same. I removed the composer.json and vendor from public_html and it is working now. Thanks a lot! – Joost Sep 22 '20 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.