CanastaWiki / Canasta

MediaWiki Docker image for Canasta, an all-in-one MediaWiki stack for easy deployment and management of enterprise-ready MediaWiki on production environments.
https://www.canasta.wiki
MIT License
37 stars 28 forks source link

Can't run `composer install` or `composer update` #251

Open jeffw16 opened 1 year ago

jeffw16 commented 1 year ago

I am getting this error when trying to run those commands from within the container:

➜  canasta-fileauth docker compose exec web bash 
root@4090f0acb35c:/var/www/mediawiki/w# composer update
> ComposerHookHandler::onPreUpdate
This file is part of the Semantic Breadcrumb Links extension. It is not a valid entry point.root@4090f0acb35c:/var/www/mediawiki/w# 

Even when I remove that extension completely, the problem persists.

jeffw16 commented 1 year ago

When I did rm -r canasta-extensions/SemanticBreadcrumbLinks and then ran composer install, this happened:

root@4090f0acb35c:/var/www/mediawiki/w# rm -r canasta-extensions/SemanticBreadcrumbLinks/
root@4090f0acb35c:/var/www/mediawiki/w# composer update
> ComposerHookHandler::onPreUpdate
Script ComposerHookHandler::onPreUpdate handling the pre-update-cmd event terminated with an exception

  [ErrorException]                                                                                                                                                              
  require(/var/www/mediawiki/w/vendor/composer/../../canasta-extensions/SemanticBreadcrumbLinks/SemanticBreadcrumbLinks.php): failed to open stream: No such file or directory  

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

Then I did rm -r canasta-extensions/Semantic* followed by composer install and this happened:

root@4090f0acb35c:/var/www/mediawiki/w# composer update
> ComposerHookHandler::onPreUpdate
Script ComposerHookHandler::onPreUpdate handling the pre-update-cmd event terminated with an exception

  [ErrorException]                                                                                                                                                         
  require(/var/www/mediawiki/w/vendor/composer/../../canasta-extensions/SemanticMediaWiki/includes/GlobalFunctions.php): failed to open stream: No such file or directory  

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...
vedmaka commented 1 year ago

Perhaps happening because of this https://github.com/CanastaWiki/Canasta/blob/master/Dockerfile#L579 , there is no way to run composer updates runtime yet

freephile commented 12 months ago

See my explanation of the problem at https://github.com/SemanticMediaWiki/SemanticMetaTags/issues/76#issuecomment-1813875270

Aside: you can get a look at the autoloads in composer.json files using find with awk: find ./canasta-extensions -name composer.json -exec awk '/"autoload": \{/,/\}/ { print $0 }' {} \;