git-updater: E_WARNING: array_merge(): Argument #1 is not an array

New Relic logs the following when cron is run: E_WARNING: array_merge(): Argument #1 is not an array

  • GitHub Updater 9.0.0
  • WordPress: 5.2.x
  • PHP 7.2.22

Stack trace:

… /opt/wordpress/wp-content/plugins/github-updater/src/GitHub_Updater/
Theme.php (156)
… /opt/wordpress/wp-content/plugins/github-updater/src/GitHub_Updater/
Theme.php (82)
…press/wp-content/plugins/github-updater/vendor/afragen/singleton/
Singleton.php (45)
…p-content/plugins/github-updater/src/GitHub_Updater/WP_CLI/
CLI_Integration.php (38)
…p-content/plugins/github-updater/src/GitHub_Updater/WP_CLI/
CLI_Integration.php (30)
…p-content/plugins/github-updater/src/GitHub_Updater/WP_CLI/
CLI_Integration.php (18)
…t /opt/wordpress/wp-content/plugins/github-updater/src/GitHub_Updater/
Init.php (84)
…t/wordpress/wp-content/plugins/github-updater/src/GitHub_Updater/
Bootstrap.php (73)
… called at /opt/wordpress/wp-content/plugins/github-updater/
github-updater.php (40)
in include_once called at /opt/wordpress/wp-settings.php (310)
… called at phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/
Runner.php (1191)
… called at phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/
Runner.php (1114)
…///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/
LaunchRunner.php (23)
…cess called at phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/
bootstrap.php (74)
…otstrap called at phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/
in WP_CLI\bootstrap called at phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php
wp-cli.php (25)
in include called at phar:///usr/local/bin/wp/php/boot-phar.php (11)
in include called at /usr/local/bin/wp (4)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

@afragen, I believe you can ignore the E_COMPILE_ERROR, New Relic has only logged it once. That is, it doesn’t fail any more, not on the first run either.

Just checked the source and think I see the problem.

In Theme::get_theme_meta(), if there are no themes managed by by GHU, then $paths will be empty so the foreach( $paths ) never loops. And $repos_arr never gets updated.

If you just do $repos_arr = array() before that foreach loop it should fix it.