When I try to run drush dmu-analyze my_module, I get this error:
[mikl:~/Sites … okmeister/modules/bookmeister_bookmark] % drush dmu-analyze bookmeister_bookmark
require_once(modules/drupalmoduleupgrader/vendor/autoload.php): failed to open stream: No such file or directory [warning]
drupalmoduleupgrader.drush.inc:75Fatal error: require_once(): Failed opening required 'modules/drupalmoduleupgrader/vendor/autoload.php' (include_path='/Users/mikl/Sites/d8/core/vendor/phpunit/php-text-template:/Users/mikl/Sites/d8/core/vendor/phpunit/php-timer:/Users/mikl/Sites/d8/core/vendor/phpunit/php-token-stream:/Users/mikl/Sites/d8/core/vendor/phpunit/php-file-iterator:/Users/mikl/Sites/d8/core/vendor/phpunit/php-code-coverage:/Users/mikl/Sites/d8/core/vendor/phpunit/phpunit:/Users/mikl/Sites/d8/core/vendor/symfony/yaml:/Users/mikl/Sites/d8/core/vendor/phpunit/phpunit-mock-objects:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-token-stream:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-text-template:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/phpunit-mock-objects:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-timer:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-file-iterator:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-code-coverage:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/phpunit:/ in /Users/mikl/Sites/d8/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc on line 75
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: require_once(): Failed opening required 'modules/drupalmoduleupgrader/vendor/autoload.php'
(include_path='/Users/mikl/Sites/d8/core/vendor/phpunit/php-text-template:/Users/mikl/Sites/d8/core/vendor/phpunit/php-timer:/Users/mikl/Sites/d8/core/vendor/phpunit/php-token-stream:/Users/mikl/Sites/d8/core/vendor/phpunit/php-file-iterator:/Users/mikl/Sites/d8/core/vendor/phpunit/php-code-coverage:/Users/mikl/Sites/d8/core/vendor/phpunit/phpunit:/Users/mikl/Sites/d8/core/vendor/symfony/yaml:/Users/mikl/Sites/d8/core/vendor/phpunit/phpunit-mock-objects:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-token-stream:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-text-template:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/phpunit-mock-objects:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-timer:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-file-iterator:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/php-code-coverage:/usr/local/Cellar/drush/HEAD/libexec/vendor/phpunit/phpunit:/
in /Users/mikl/Sites/d8/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc, line 75
I'm using the latest version of Drush and the latest version of this module.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | drupalmoduleupgrader_autoload_missing_message.patch | 541 bytes | nigelcunningham |
Comments
Comment #1
miklAh, this is what happens when you don't read the README file, which states you must go in to
modules/drupalmoduleupgraderand runcomposer installComment #2
webchickStill, we could stand to fail a bit more gracefully here.
Comment #4
phenaproximaI concur. I have made it much smarter; it'll check for autoload.php before trying to do anything, and set an error message if it's not found.
Comment #5
miklShouldn't you do an
exit()or similar after callingdrush_set_error()? Otherwise, I guess the execution would continue and throw other interesting errors about the missing code…Comment #6
phenaproxima@mikl: That's what I thought initially, but drush seems to exit as soon as drush_set_error() is called in a validation callback. Which is fine by me, since that allows Drush to do whatever cleanup/pre-exit tasks it needs to do.
Comment #7
webchickLovely!
Comment #10
nigelcunningham commentedSorry to reopen this, but I'd argue that the message is not helpful. It says nothing about needing to cd to upgrader directory first, so the natural assumption is that you need to run composer install from the site root (achieving nothing). The message should be modified to say that you need to run composer install from the drush directory.
The attached patch does this.
Comment #12
webchickNice improvement, thanks!
Committed and pushed to 8.x-1.x.