Skip to content

Undefined constant in *docker-integration.php*

Problem

The php-fpm container crashes with the following in the logs since 5c3d0f0a if /app/media1 is populated2:

Fatal error: Uncaught Error: Undefined constant "S3_DEBUG" in /app/wp-content/mu-plugins/docker-integration.php:71
Stack trace:
#0 /app/wp-includes/class-wp-hook.php(324): WP_CLI\Runner->{closure}(Array)
#1 /app/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#2 /app/wp-content/mu-plugins/s3-uploads/inc/class-plugin.php(373): apply_filters('s3_uploads_s3_c...', Array)
#3 /app/wp-content/mu-plugins/s3-uploads/inc/class-plugin.php(334): S3_Uploads\Plugin->get_aws_sdk()
#4 /app/wp-content/mu-plugins/s3-uploads/inc/class-wp-cli-command.php(199): S3_Uploads\Plugin->s3()
#5 [internal function]: S3_Uploads\WP_CLI_Command->upload_directory(Array, Array)
#6 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#8 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(497): call_user_func(Object(Closure), Array, Array)
#9 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(441): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#10 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(464): WP_CLI\Runner->run_command(Array, Array)
#11 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1295): WP_CLI\Runner->run_command_and_exit()
#12 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#13 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#14 phar:///usr/local/lib/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#15 phar:///usr/local/lib/wp-cli.phar/php/boot-phar.php(20): include('phar:///usr/loc...')
#16 /usr/local/lib/wp-cli.phar(4): include('phar:///usr/loc...')
#17 {main}
  thrown in /app/wp-content/mu-plugins/docker-integration.php on line 71
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

Solution

The debug switches need to be set earlier in the setup steps.


  1. An additional problem to address: s3_setup needs to use the dynamic value of the uploads directory, not static /app/media.

  2. It seems some plugins pollute populate the upload directory even when there is no media there.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information