yeswework / fabrica-dev-kit

A toolkit for faster, smoother WordPress 5 development
https://fabri.ca/
MIT License
274 stars 27 forks source link

Error when try to install a new language #37

Closed gustavorps closed 1 year ago

gustavorps commented 5 years ago
$ fdk --version
/home/gustavorps/.nvm/versions/node/v8.10.0/lib
└── fabrica-dev-kit@2.0.13
$ fdk wp language core install pt_BR
yarn run v1.9.4
$ docker-compose exec -u www-data -T wp wp language core install pt_BR
[15-Feb-2019 13:13:34 UTC] PHP Warning:  An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /var/www/html/wp-admin/includes/translation-install.php on line 65
[15-Feb-2019 13:13:34 UTC] PHP Stack trace:
[15-Feb-2019 13:13:34 UTC] PHP   1. {main}() /usr/local/bin/wp:0
[15-Feb-2019 13:13:34 UTC] PHP   2. include() /usr/local/bin/wp:4
[15-Feb-2019 13:13:34 UTC] PHP   3. include() phar:///usr/local/bin/wp/php/boot-phar.php:11
[15-Feb-2019 13:13:34 UTC] PHP   4. WP_CLI\bootstrap() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php:25
[15-Feb-2019 13:13:34 UTC] PHP   5. WP_CLI\Bootstrap\LaunchRunner->process() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php:74
[15-Feb-2019 13:13:34 UTC] PHP   6. WP_CLI\Runner->start() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:23
[15-Feb-2019 13:13:34 UTC] PHP   7. WP_CLI\Runner->_run_command_and_exit() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1116
[15-Feb-2019 13:13:34 UTC] PHP   8. WP_CLI\Runner->run_command() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:389
[15-Feb-2019 13:13:34 UTC] PHP   9. WP_CLI\Dispatcher\Subcommand->invoke() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:366
[15-Feb-2019 13:13:34 UTC] PHP  10. call_user_func:{phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:449}() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:449
[15-Feb-2019 13:13:34 UTC] PHP  11. WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:449
[15-Feb-2019 13:13:34 UTC] PHP  12. call_user_func:{phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:93}() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:93
[15-Feb-2019 13:13:34 UTC] PHP  13. Core_Language_Command->install() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:93
[15-Feb-2019 13:13:34 UTC] PHP  14. Core_Language_Command->download_language_pack() phar:///usr/local/bin/wp/vendor/wp-cli/language-command/src/Core_Language_Command.php:197
[15-Feb-2019 13:13:34 UTC] PHP  15. Core_Language_Command->get_all_languages() phar:///usr/local/bin/wp/vendor/wp-cli/language-command/src/WP_CLI/CommandWithTranslation.php:210
[15-Feb-2019 13:13:34 UTC] PHP  16. translations_api() phar:///usr/local/bin/wp/vendor/wp-cli/language-command/src/WP_CLI/CommandWithTranslation.php:289
[15-Feb-2019 13:13:34 UTC] PHP  17. trigger_error() /var/www/html/wp-admin/includes/translation-install.php:65
Error: An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>. "cURL error 28: Resolving timed out after 3512 milliseconds"
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
tiojoca commented 5 years ago

It seems WP is timing out while trying to fetch the translations data. WP is setting only 3 seconds to timeout for this particular request. Can you try changing this value to 30 or more in www/wp-admin/includes/translation-install.php around line 44 in the $options array?

This is obviously not a proper way to fix or even workaround this but it can help us make sure this is indeed where the error is coming from and since the request $options parameter overrides all default settings I can't think of any other way to do this at this time.