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

DrupalConsole should guess HOME environment variable #255

Open
novia713 opened this issue Dec 4, 2017 · 2 comments
Open

DrupalConsole should guess HOME environment variable #255

novia713 opened this issue Dec 4, 2017 · 2 comments

Comments

@novia713
Copy link
Contributor

novia713 commented Dec 4, 2017

This is the error it throws when it can't find HOME environment variable

  root@ns3010321.ip-94-23-248.eu   master U:1  ~/root/html/api_nexum  drupal cr all
PHP Fatal error:  Uncaught RuntimeException: Your environment or operation system isn't supported in phar:///usr/local/bin/drupal/vendor/webmozart/path-util/src/Path.php:257
Stack trace:
#0 phar:///usr/local/bin/drupal/vendor/drupal/console-core/src/Utils/ConfigurationManager.php(48): Webmozart\PathUtil\Path::getHomeDirectory()
#1 phar:///usr/local/bin/drupal/vendor/drupal/console-core/src/Bootstrap/DrupalConsoleCore.php(65): Drupal\Console\Core\Utils\ConfigurationManager->loadConfiguration('phar:///usr/loc...')
#2 phar:///usr/local/bin/drupal/bin/drupal.php(40): Drupal\Console\Core\Bootstrap\DrupalConsoleCore->boot()
#3 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')
#4 /usr/local/bin/drupal(10): require('phar:///usr/loc...')
#5 {main}
  thrown in phar:///usr/local/bin/drupal/vendor/webmozart/path-util/src/Path.php on line 257

[coming from https://github.com/hechoendrupal/drupal-console/issues/3612]

@novia713
Copy link
Contributor Author

novia713 commented Dec 4, 2017

@jmolivas well, seems we are already using Path::getHomeDirectory(); in the place that the error appears.
Seems that path-util doesn't guess the home directory if the HOME environment variable is not present.
So, in regarding this, i attached a PR (webmozart/path-util#24) into that project.

Hopefully, we can solve this problem when the PR were merged into path-util

@Triloworld
Copy link

It's actually in Drupal 9. Using cron in server will emit error if not added HOME environment. Reading this issue and adding manually fix issue. Pleas, add patch to check if exist and if not then use --root variable or emit proper information

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

2 participants