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

package doesn't exit safely in non-lagoon environment #22

Open
tobybellwood opened this issue Nov 10, 2023 · 1 comment · May be fixed by #24
Open

package doesn't exit safely in non-lagoon environment #22

tobybellwood opened this issue Nov 10, 2023 · 1 comment · May be fixed by #24

Comments

@tobybellwood
Copy link
Member

When used outside of a Lagoon environment, the drupal_integrations package may throw an error like the below:

Fatal error: Uncaught Error: Call to undefined method Drush\Drush::bootstrapManager() in /mnt/www/html/samplesite/drush/Commands/contrib/drupal_integrations/src/LagoonCommands.php:176
Stack trace:
#0 /mnt/www/html/samplesite/drush/Commands/contrib/drupal_integrations/src/LagoonCommands.php(67): Drush\Commands\drupal_integrations\LagoonCommands->getLagoonYml()
#1 /usr/local/drush8/vendor/drush/drush/includes/annotationcommand_adapter.inc(322): Drush\Commands\drupal_integrations\LagoonCommands->__construct()
#2 /usr/local/drush8/vendor/drush/drush/includes/annotationcommand_adapter.inc(297): annotationcommand_adapter_create_commandfile_instance()
#3 /usr/local/drush8/vendor/drush/drush/includes/annotationcommand_adapter.inc(109): annotationcommand_adapter_get_commands()
#4 /usr/local/drush8/vendor/drush/drush/includes/command.inc(1132): annotationcommand_adapter_commands()
#5 /usr/local/drush8/vendor/drush/drush/includes/command.inc(1430): drush_get_commands()
#6 /usr/local/drush8/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(54): drush_parse_command()
#7 /usr/local/drush8/vendor/drush/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#8 /usr/local/drush8/vendor/drush/drush/drush.php(12): drush_main()
#9 {main}
  thrown in /mnt/www/html/samplesite/drush/Commands/contrib/drupal_integrations/src/LagoonCommands.php on line 176
Drush command terminated abnormally due to an unrecoverable error.       [error]

We suspect this is because Drush, in trying to get it's internal commands in order is hitting the _construct of this package and the getLagoonYml function should probably be skipped in a non-Lagoon env to failsafe. We can probably wrap it in a LAGOON env check like we do for settings.php (https://github.com/amazeeio/drupal-integrations/blob/main/assets/settings.lagoon.php#L33)

@skyred
Copy link
Contributor

skyred commented Nov 10, 2023

PR #23

bomoko added a commit that referenced this issue Nov 12, 2023
#22 package doesn't exit safely in non-lagoon environment
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

Successfully merging a pull request may close this issue.

2 participants