-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: after going to 5.0, saving a post causes Deprecated: mb_strlen(): Passing null to parameter #1 errors #3760
Comments
Hi @bsabalaskey, can you please send the full Status Report? I wonder why a post would come in completely empty. |
What exactly is a "full status report"? |
Hi @bsabalaskey, if you go to the WordPress dashboard, then ElasticPress > Status Report, you'll see a page with some debugging information. You can download that info by clicking on the button at the top and share the file with us here. |
Update: I do tweak the post type and post status options based on my custom additions in those areas. I index posts (of various types), pages, users and terms. I installed local debugging in send_bulk_index_request(). Here is the output when I update the Hello World post. 2023-11-22 15:44:43 | 127.0.0.1 | POST | send_bulk_index_request: $documents: Array Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\r\n","post_content":"\r\n Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\r\n","post_status":"publish","post_name":"hello-world","post_modified":"2023-11-22 15:44:42","post_modified_gmt":"2023-11-22 19:44:42","post_parent":0,"post_type":"post","post_mime_type":"","permalink":"https://wp2.example.com/hello-world/","terms":{"category":[{"term_id":1,"slug":"uncategorized","name":"Uncategorized","parent":0,"term_taxonomy_id":1,"term_order":0,"facet":"{"term_id":1,"slug":"uncategorized","name":"Uncategorized","parent":0,"term_taxonomy_id":1,"term_order":0}"}],"post_tag":[{"term_id":83,"slug":"test-tag","name":"Test Tag","parent":0,"term_taxonomy_id":83,"term_order":0,"facet":"{"term_id":83,"slug":"test-tag","name":"Test Tag","parent":0,"term_taxonomy_id":83,"term_order":0}"}]},"meta":[],"date_terms":{"year":2023,"month":3,"week":9,"dayofyear":59,"day":1,"dayofweek":3,"dayofweek_iso":3,"hour":20,"minute":44,"second":29,"m":202303},"comment_count":1,"comment_status":"open","ping_status":"open","menu_order":0,"guid":"https://wp2.example.com/?p=1","thumbnail":null,"term_suggest":["Uncategorized","Test Tag"]} ) 2023-11-22 15:44:44 | 127.0.0.1 | POST | send_bulk_index_request: $documents: Array
{"term_id":83,"ID":83,"name":"Test Tag","slug":"test-tag","term_group":null,"term_taxonomy_id":83,"taxonomy":"post_tag","description":"","parent":0,"count":1,"meta":[],"hierarchy":{"children":{"terms":0,"count":0},"ancestors":{"terms":0}},"object_ids":{"value":[1]}} ) 2023-11-22 15:44:44 | 127.0.0.1 | POST | send_bulk_index_request: $documents: Array ) 2023-11-22 15:44:44 | 127.0.0.1 | POST | send_bulk_index_request: $documents: Array ) 2023-11-22 15:44:45 | 127.0.0.1 | POST | send_bulk_index_request: $documents: Array 2023-11-22 15:44:45 | 127.0.0.1 | POST | send_bulk_index_request next_document is empty - debug_backtrace(0): Array
) 2023-11-22 15:44:45 | 127.0.0.1 | POST | send_bulk_index_request: $documents: Array 2023-11-22 15:44:45 | 127.0.0.1 | POST | send_bulk_index_request next_document is empty - debug_backtrace(0): Array
) 2023-11-22 15:44:45 | 127.0.0.1 | POST | send_bulk_index_request: $documents: Array 2023-11-22 15:44:45 | 127.0.0.1 | POST | send_bulk_index_request next_document is empty - debug_backtrace(0): Array
) |
Full status report, right after full delete all index and sync: Failed Querieshttps://wp2.example.com (2023-11-22 15:44:45)error: request body is required https://wp2.example.com (2023-11-22 15:44:45)error: request body is required https://wp2.example.com/wp-json/elasticpress/v1/sync?include&indexables&put_mapping=true&post_type&trigger=manual (2023-11-22 15:31:18)error: failed to parse https://wp2.example.com/wp-json/elasticpress/v1/sync?include&indexables&put_mapping=true&post_type&trigger=manual (2023-11-22 15:30:08)error: failed to parse https://wp2.example.com/wp-json/elasticpress/v1/sync?include&indexables&put_mapping=true&post_type&trigger=manual (2023-11-22 15:21:19)error: failed to parse WordPressWordPress Environmentwp_version: 6.4.1 Server Environmentphp_version: 8.1.25 Indexable Contentexample — https://wp2.example.compost_count: 1 ElasticPressSettingshost: http://search.example.com:20080 Timeoutsrequest_timeout: 15 Elasticsearch Indiceswp2examplecom-post-1health: green wp2examplecom-comment-1health: green wp2examplecom-term-1health: green wp2examplecom-userhealth: green Last Sync2023/11/22 3:05:19 pmmethod: WP Dashboard Feature SettingsAutosuggestactive: true Commentsactive: true Custom Search Resultsactive: true Filtersactive: true Post Searchactive: true # Defined sets (equivalent synonyms). weighting: array ( 'post' => array ( 'post_title' => array ( 'weight' => 100, 'enabled' => true, ), 'post_content' => array ( 'enabled' => true, 'weight' => 25, ), 'post_excerpt' => array ( 'enabled' => true, 'weight' => 50, ), 'author_name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.post_tag.name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.category.name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.ep_custom_result.name' => array ( 'enabled' => true, 'weight' => 9999, 'fuzziness' => false, ), ), 'page' => array ( 'post_title' => array ( 'weight' => 100, 'enabled' => true, ), 'post_content' => array ( 'enabled' => true, 'weight' => 25, ), 'post_excerpt' => array ( 'enabled' => true, 'weight' => 50, ), 'author_name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.ep_custom_result.name' => array ( 'enabled' => true, 'weight' => 9999, 'fuzziness' => false, ), ), 'campaign' => array ( 'post_title' => array ( 'weight' => 100, 'enabled' => true, ), 'post_content' => array ( 'enabled' => true, 'weight' => 25, ), 'post_excerpt' => array ( 'enabled' => true, 'weight' => 50, ), 'author_name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.category.name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.ep_custom_result.name' => array ( 'enabled' => true, 'weight' => 9999, 'fuzziness' => false, ), 'terms.post_tag.name' => array ( 'weight' => 0, 'enabled' => false, ), ), 'p2p' => array ( 'post_title' => array ( 'weight' => 100, 'enabled' => true, ), 'post_content' => array ( 'enabled' => true, 'weight' => 25, ), 'post_excerpt' => array ( 'enabled' => true, 'weight' => 50, ), 'author_name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.category.name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.ep_custom_result.name' => array ( 'enabled' => true, 'weight' => 9999, 'fuzziness' => false, ), 'terms.post_tag.name' => array ( 'weight' => 0, 'enabled' => false, ), ), 'update' => array ( 'post_title' => array ( 'weight' => 100, 'enabled' => true, ), 'post_content' => array ( 'enabled' => true, 'weight' => 25, ), 'post_excerpt' => array ( 'enabled' => true, 'weight' => 50, ), 'author_name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.ep_custom_result.name' => array ( 'enabled' => true, 'weight' => 9999, 'fuzziness' => false, ), ), 'faq' => array ( 'post_title' => array ( 'weight' => 100, 'enabled' => true, ), 'post_content' => array ( 'enabled' => true, 'weight' => 25, ), 'post_excerpt' => array ( 'enabled' => true, 'weight' => 50, ), 'author_name' => array ( 'weight' => 1, 'enabled' => true, ), 'terms.ep_custom_result.name' => array ( 'enabled' => true, 'weight' => 9999, 'fuzziness' => false, ), 'terms.help.name' => array ( 'weight' => 0, 'enabled' => true, ), ), 'user_alias' => array ( 'post_title' => array ( 'enabled' => true, 'weight' => 1, ), 'post_content' => array ( 'enabled' => true, 'weight' => 1, ), 'post_excerpt' => array ( 'enabled' => true, 'weight' => 1, ), 'author_name' => array ( 'enabled' => true, 'weight' => 1, ), 'terms.ep_custom_result.name' => array ( 'enabled' => true, 'weight' => 9999, 'fuzziness' => false, ), ), ) Search Algorithm Versionactive: true Termsactive: true Usersactive: true |
@bsabalaskey it seems the problem was related to #3755, which has been fixed. Would you be able to test it using this pre-release version and let us know if it fixes the problem for you as well? Thanks. |
Yes, that fixed it. Good job. |
Describe the bug
When saving or updating a post:
Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/lifefunderwp/public/wp-content/plugins/elasticpress/includes/classes/Indexable.php on line 496
Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/lifefunderwp/public/wp-content/plugins/elasticpress/includes/classes/Indexable.php on line 499
Steps to Reproduce
Screenshots, screen recording, code snippet
Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/lifefunderwp/public/wp-content/plugins/elasticpress/includes/classes/Indexable.php on line 496
Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/lifefunderwp/public/wp-content/plugins/elasticpress/includes/classes/Indexable.php on line 499
Note: my quick fix hack was to add a "!empty($next_document) &&" as the first part of the if statement for those lines.
Environment information
OS: Ubuntu 22.04 LTS
PHP: 8.1.25
ElasticPress instance privately hosted 7.17.13
WordPress and ElasticPress information
WP: WordPress 6.4.1
EP plugin: ElasticPress 5.0
Code of Conduct
The text was updated successfully, but these errors were encountered: