- πΊπΈUnited States traviscarden
I've created a related issue upstream: Provide meaningful exception codes Β· Issue #71 Β· php-tuf/composer-stager.
- Assigned to tedbow
- πΊπΈUnited States phenaproxima Massachusetts
I think this might be closeable as outdated after π Add a validate() method to ComposerInspector to ensure that Composer is usable Fixed because:
- ComposerExecutableValidator is (nearly) gone; all it does is add a nice help link.
- If Composer is not found, the error message from the ComposerIsAvailable precondition is bubbled up.
So when this is improved in Composer Stager, we'll automatically inherit the fix, it sounds like.
Leaving open and assigned to @tedbow for confirmation that we can close this.
- Status changed to RTBC
over 1 year ago 1:28pm 27 February 2023 - Status changed to Postponed
over 1 year ago 1:37pm 28 February 2023 - πΊπΈUnited States tedbow Ithaca, NY, USA
This should postponed on Provide meaningful exception codes Β· Issue #71 Β· php-tuf/composer-stager.
We need to confirm it actually has a better message when this is done
- πΊπΈUnited States tedbow Ithaca, NY, USA
- Also since we expect a different message when Composer is not found we should have test for that.
As of now we are stilling getting this ugly messages
-
Related for some reason my web server locally cannot find Composer.
If install Automatic Updates with
$config['package_manager.settings']['executables']['composer'] = '/usr/local/bin/composer4';
set in settings.php to incorrect value I will get the messages above on installation.But if install Automatic Updates with no value set in settings.php I get this hard error.
I assume anyone who tried to install Auto Updates and they didn't have access to Composer on their hosting would have this same messages
This needs a follow-up should be core-mvp for Automatic Updates. So setting to Needs Work until the follow-up is made.
The website encountered an unexpected error. Please try again later.
PhpTuf\ComposerStager\Domain\Exception\LogicException: The "composer" executable cannot be found. Make sure it's installed and in the $PATH. in PhpTuf\ComposerStager\Infrastructure\Service\Finder\ExecutableFinder->find() (line 25 of vendor/php-tuf/composer-stager/src/Infrastructure/Service/Finder/ExecutableFinder.php).
Drupal\package_manager\ExecutableFinder->find('composer') (Line: 67)
PhpTuf\ComposerStager\Infrastructure\Service\ProcessRunner\AbstractRunner->findExecutable() (Line: 51)
PhpTuf\ComposerStager\Infrastructure\Service\ProcessRunner\AbstractRunner->run(Array, Object) (Line: 253)
Drupal\package_manager\ComposerInspector->getVersion('/Users/ted.bowman/sites/au-contrib') (Line: 123)
Drupal\package_manager\ComposerInspector->validate('/Users/ted.bowman/sites/au-contrib') (Line: 195)
Drupal\package_manager\ComposerInspector->getConfig('allow-plugins', '/Users/ted.bowman/sites/au-contrib') (Line: 165)
Drupal\package_manager\Validator\ComposerPluginsValidator->validate(Object, 'Drupal\package_manager\Event\StatusCheckEvent', Object)
call_user_func(Array, Object, 'Drupal\package_manager\Event\StatusCheckEvent', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object) (Line: 45)
Drupal\automatic_updates\Validation\StatusChecker->runStatusCheck(Object, Object) (Line: 72)
Drupal\automatic_updates\Validation\StatusChecker->run() (Line: 204)
automatic_updates_modules_installed(Array, )
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'automatic_updates') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('modules_installed', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('modules_installed', Array) (Line: 373)
Drupal\Core\Extension\ModuleInstaller->install(Array, 1) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array) (Line: 502)
Drupal\system\Form\ModulesListForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 595)
Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object) (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 680)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
require('/Users/ted.bowman/sites/au-contrib/index.php') (Line: 234) - This same situation does not happen with Package Manager because without another module that depends on installed the status checks will not be run but I would think that any module that used would run into this same problem
I confirmed this by installing
package_manager_test_api
and going to/package-manager-test-api
. This same error happensI confirmed that if reload
/package-manager-test-api
with even a wrong value for$config['package_manager.settings']['executables']['composer']
The error changes to
The website encountered an unexpected error. Please try again later.
Drupal\package_manager\Exception\StageValidationException: The command "'/usr/local/bin/composer4' '--format=json' '--working-dir=/Users/ted.bowman/sites/au-contrib'" failed. Exit Code: 126(Invoked command cannot execute) Working directory: /Users/ted.bowman/sites/au-contrib Output: ================ Error Output: ================ sh: /usr/local/bin/composer4: No such file or directory sh: line 0: exec: /usr/local/bin/composer4: cannot execute: No such file or directory See the help page β for information on how to configure the path to Composer. Unable to determine Composer
secure-http
setting. The command "'/usr/local/bin/composer4' '--format=json' '--working-dir=/Users/ted.bowman/sites/au-contrib'" failed. Exit Code: 126(Invoked command cannot execute) Working directory: /Users/ted.bowman/sites/au-contrib Output: ================ Error Output: ================ sh: /usr/local/bin/composer4: No such file or directory sh: line 0: exec: /usr/local/bin/composer4: cannot execute: No such file or directory Unable to determine Composerallow-plugins
setting. The command "'/usr/local/bin/composer4' '--format=json' '--working-dir=/Users/ted.bowman/sites/au-contrib'" failed. Exit Code: 126(Invoked command cannot execute) Working directory: /Users/ted.bowman/sites/au-contrib Output: ================ Error Output: ================ sh: /usr/local/bin/composer4: No such file or directory sh: line 0: exec: /usr/local/bin/composer4: cannot execute: No such file or directory in Drupal\package_manager\Stage->dispatch() (line 528 of modules/automatic_updates/package_manager/src/Stage.php).
Drupal\package_manager\Stage->create() (Line: 151)
Drupal\package_manager_test_api\ApiController->createAndApplyStage(Object) (Line: 96)
Drupal\package_manager_test_api\ApiController->run(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 680)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
require('/Users/ted.bowman/sites/au-contrib/index.php') (Line: 234)So it seems 1 is handled by our status checker and 1 is not.
So either need to handle that problem in this issue make a
core-mvp
Package Manager issue for this
- Also since we expect a different message when Composer is not found we should have test for that.
- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 1:59pm 28 February 2023