500s on redirects? Call to a member function get_queried_object_id() on null
-
We are seeing 500s on some, but not all, permanent redirects in our production environment with the cache-control plugin enabled. Here’s what we see:
2018/12/07 17:22:29 [error] 18523#18523: *2917 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_queried_object_id() on null in WEBROOT/wp-includes/query.php:60 Stack trace: #0 WEBROOT/wp-includes/class-wp-query.php(3989): get_queried_object_id() #1 WEBROOT/wp-includes/class-wp-query.php(3100): WP_Query->setup_postdata(Object(WP_Post)) #2 WEBROOT/wp-content/plugins/cache-control/cache-control.php(185): WP_Query->the_post() #3 WEBROOT/wp-content/plugins/cache-control/cache-control.php(244): cache_control_is_future_now_maxtime(86400) #4 WEBROOT/wp-content/plugins/cache-control/cache-control.php(380): cache_control_build_directive_from_option('redirect_perman...') #5 WEBROOT/wp-includes/class-wp-hook.php(286): cache_control_handle_redirects(301, 'https://www.was...') #6 WEBROOT/wp-include" while reading response header from upstream, client: 127.0.0.1, server: HOSTNAME, request: "GET /PATH/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "HOSTNAME" 2018/12/07 17:22:46 [error] 18523#18523: *3297 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_queried_object_id() on null in WEBROOT/wp-includes/query.php:60 Stack trace: #0 WEBROOT/wp-includes/class-wp-query.php(3989): get_queried_object_id() #1 WEBROOT/wp-includes/class-wp-query.php(3100): WP_Query->setup_postdata(Object(WP_Post)) #2 WEBROOT/wp-content/plugins/cache-control/cache-control.php(185): WP_Query->the_post() #3 WEBROOT/wp-content/plugins/cache-control/cache-control.php(244): cache_control_is_future_now_maxtime(86400) #4 WEBROOT/wp-content/plugins/cache-control/cache-control.php(380): cache_control_build_directive_from_option('redirect_perman...') #5 WEBROOT/wp-includes/class-wp-hook.php(286): cache_control_handle_redirects(301, 'https://www.was...') #6 WEBROOT/wp-include" while reading response header from upstream, client: 127.0.0.1, server: HOSTNAME, request: "GET /PATH/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "HOSTNAME"
Haven’t validated this yet, but I wonder if adding
redirect_permanent
to the list of option_names in #239-243 might help.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘500s on redirects? Call to a member function get_queried_object_id() on null’ is closed to new replies.