Errors when sending data to Algolia

  • mcl7
    Participant
    3 years, 5 months ago #22560

    I have been trying to get algolia to work but having problems with errors on every product I am importing. I read some of the related posts that recommended turning on Debug mode and throttling the batch down to one record at a time.

    Every time the product actually goes into the index but I get the same or similar error every time:

    It *looks* like it has something to do with the final line:

    “Error on line 281 of file \/wp-content\/object-cache.php”

    Thoughts? Not a single error with the same config for ElasticSearch test index.
    ——Begin error message—–

    An error or timeout occured.

    Error code: parsererror

    Error message: SyntaxError: Unexpected token { in JSON at position 4799

    {“models_nb_results”:{“product”:1},”nb_results”:1,”status”:true,”indexing_complete”:false,”debug_text”:”Posts excluded from the index:<br><b><\/b><br><br>******** DEBUG ACTIVATED – Beginning of new loop (batch size) *******<br><br>******** DEBUG ACTIVATED – Query documents from last post date *******<br><br>Query:<br><b>SELECT ID, post_modified, post_parent, post_type FROM wp_posts AS A WHERE ((post_modified = ‘2020-10-24 05:20:33’ AND ID > 9509) OR (post_modified > ‘2020-10-24 05:20:33’)) AND ( post_status NOT IN (‘auto-draft’) AND ( post_type = ‘product’ ) ) ORDER BY post_modified ASC, ID ASC LIMIT 1<\/b><br><br>Last post date:<br><b>2020-10-24 05:20:33<\/b><br><br>Last post ID:<br><b>9509<\/b><br><br>Post to be sent:<br><b>{\n \”id\”: 9510,\n \”PID\”: 9510,\n \”type\”: \”product\”,\n \”meta_type_s\”: \”post_type\”,\n \”displaymodified\”: \”2020-10-24T05:20:34Z\”,\n \”title\”: \”Crystal Deodorant Crystal Body Roll-On Deodorant (1×2.25 Oz)\”,\n \”title_s\”: \”Crystal Deodorant Crystal Body Roll-On Deodorant (1×2.25 Oz)\”,\n \”permalink\”: \”http:\\\/\\\/test.com\\\/product\\\/9510\\\/crystal-deodorant-crystal-body-roll-on-deodorant\\\/\”,\n \”post_status_s\”: \”publish\”,\n \”content\”: \”Get Crystal Deodorant Crystal Body Roll-On Deodorant in bulk along with other fantastic deodorant products. This heavenly Crystal health & beauty product uses premium ingredients. This product ships at 0.2 pounds. Crystal Deodorant Crystal Body Roll-On Deodorant has a 2.25 oz pack size for a total of 2.25 oz. Crystal formulates all its products with your well being in mind.\\n\\nNote: This Product Description Is Informational Only. Always Check The Actual Product Label In Your Possession For The Most Accurate Ingredient Information Before Use. For Any Health Or Dietary Related Matter Always Consult Your Doctor Before Use. Deodorant. Crystal. 2.7\”,\n \”post_author_s\”: \”3\”,\n \”author\”: \”mj\”,\n \”menu_order_i\”: 0,\n \”PID_i\”: 9510,\n \”author_s\”: \”http:\\\/\\\/test.com\\\/author\\\/mj\\\/\”,\n \”displaydate\”: \”2020-10-24T05:20:31Z\”,\n \”displaydate_dt\”: \”2020-10-24T05:20:31Z\”,\n \”date\”: \”2020-10-24T05:20:31Z\”,\n \”displaymodified_dt\”: \”2020-10-24T05:20:34Z\”,\n \”modified\”: \”2020-10-24T05:20:34Z\”,\n \”displaymodified_dt_i\”: 1603516834,\n \”displaymodified_dt_y_i\”: 2020,\n \”displaymodified_dt_ym_i\”: 10,\n \”displaymodified_dt_yw_i\”: 43,\n \”displaymodified_dt_yd_i\”: 298,\n \”displaymodified_dt_md_i\”: 24,\n \”displaymodified_dt_wd_i\”: 7,\n \”displaymodified_dt_dh_i\”: 5,\n \”displaymodified_dt_dm_i\”: 20,\n \”displaymodified_dt_ds_i\”: 34,\n \”displaydate_dt_i\”: 1603516831,\n \”displaydate_dt_y_i\”: 2020,\n \”displaydate_dt_ym_i\”: 10,\n \”displaydate_dt_yw_i\”: 43,\n \”displaydate_dt_yd_i\”: 298,\n \”displaydate_dt_md_i\”: 24,\n \”displaydate_dt_wd_i\”: 7,\n \”displaydate_dt_dh_i\”: 5,\n \”displaydate_dt_dm_i\”: 20,\n \”displaydate_dt_ds_i\”: 31,\n \”date_i\”: 1603516831,\n \”date_y_i\”: 2020,\n \”date_ym_i\”: 10,\n \”date_yw_i\”: 43,\n \”date_yd_i\”: 298,\n \”date_md_i\”: 24,\n \”date_wd_i\”: 7,\n \”date_dh_i\”: 5,\n \”date_dm_i\”: 20,\n \”date_ds_i\”: 31,\n \”displaydate_i\”: 1603516831,\n \”displaydate_y_i\”: 2020,\n \”displaydate_ym_i\”: 10,\n \”displaydate_yw_i\”: 43,\n \”displaydate_yd_i\”: 298,\n \”displaydate_md_i\”: 24,\n \”displaydate_wd_i\”: 7,\n \”displaydate_dh_i\”: 5,\n \”displaydate_dm_i\”: 20,\n \”displaydate_ds_i\”: 31,\n \”modified_i\”: 1603516834,\n \”modified_y_i\”: 2020,\n \”modified_ym_i\”: 10,\n \”modified_yw_i\”: 43,\n \”modified_yd_i\”: 298,\n \”modified_md_i\”: 24,\n \”modified_wd_i\”: 7,\n \”modified_dh_i\”: 5,\n \”modified_dm_i\”: 20,\n \”modified_ds_i\”: 34,\n \”comments\”: [],\n \”numcomments\”: 0,\n \”categories_str\”: [],\n \”categories\”: [\n \”Deodorant\”,\n \”Crystal\”,\n \”2.7\”\n ],\n \”flat_hierarchy_categories_str\”: [],\n \”non_flat_hierarchy_categories_str\”: [],\n \”tags\”: [],\n \”product_cat_str\”: [\n \”Deodorant\”\n ],\n \”flat_hierarchy_product_cat_str\”: [\n \”Health & Beauty->Deodorant\”\n ],\n \”non_flat_hierarchy_product_cat_str\”: [\n \”Health & Beauty\”,\n \”Deodorant\”\n ],\n \”yith_product_brand_str\”: [\n \”Crystal\”\n ],\n \”flat_hierarchy_yith_product_brand_str\”: [\n \”Crystal\”\n ],\n \”non_flat_hierarchy_yith_product_brand_str\”: [\n \”Crystal\”\n ],\n \”_regular_price_f\”: [\n 2.7\n ],\n \”_regular_price_str\”: [\n 2.7\n ]\n}<\/b><br><br>”}{“nb_results”:0,”status”:8,”message”:”Error on line 281 of file \/nas\/content\/live\/test\/wp-content\/object-cache.php: Undefined index: delete”,”indexing_complete”:false}

    mcl7
    Participant
    3 years, 5 months ago #22561

    Also getting this error when just deleting data from Algolia:

    An error or timeout occured.

    Error code: parsererror

    Error message: SyntaxError: Unexpected token { in JSON at position 2

    “”{“nb_results”:0,”status”:8,”message”:”Error on line 281 of file \/nas\/content\/live\/sitename\/wp-content\/object-cache.php: Undefined index: delete”,”indexing_complete”:false}

    mcl7
    Participant
    3 years, 5 months ago #22562

    Also getting this error when just deleting data from Algolia:

    An error or timeout occured.

    Error code: parsererror

    Error message: SyntaxError: Unexpected token { in JSON at position 2

    “”{“nb_results”:0,”status”:8,”message”:”Error on line 281 of file \/nas\/content\/live\/sitename\/wp-content\/object-cache.php: Undefined index: delete”,”indexing_complete”:false}

    Its strange though…if I do a small batch I get this error. However, I just tried a batch of 5000 and they all imported to algolia although there was no success message saying X number of records were imported?

    mcl7
    Participant
    3 years, 5 months ago #22563

    Forgive repeated posts here…just trying to get to the bottom of this early this week. I would love to get this up and running during the trial.

    I *think* I am having the same issue as this guy:

    Trying to create index but get an error every time

    Is there an easy way to change the post_modified (if that’s my problem)?

    Just curious why it ran so smoothly with ElasticSearch and Algoli (which is usually super fast) is having a hard time?

    wpsolr
    Keymaster
    3 years, 5 months ago #22564

    Can you see some data in your Algolia index (from Algolia dashboard)?

    Also, if you use another Algolia plugin, please deactivate it.

    mcl7
    Participant
    3 years, 5 months ago #22567

    I did have another Algolia plugin but deactivated already before installing WpSolr.

    Also, does populate in Algolia. Kinda weird that I was able to successfully upload 5k (without a success message indicating how many records were uploaded). Usually, though it feels like every record throws an error almost immediately.

    wpsolr
    Keymaster
    3 years, 5 months ago #22568

    How many documents are in your Algolia index already?

    mcl7
    Participant
    3 years, 5 months ago #22569

    I deleted everything. I wanted to figure out the error before relying on it. There are 20k products currently. I was able to get up to 9000 imported (in two blocks of 5k) but then failed at reaching any higher than 7000 being indexed in Algolia.

    wpsolr
    Keymaster
    3 years, 5 months ago #22571

    You are indexing in batch of 5k documents?

    mcl7
    Participant
    3 years, 5 months ago #22572

    I gave it a shot after it failing at 100, 10, 1, etc. All attempts regardless of the batch size or whether or not I tried each batch size with a fresh index and one that already existed. All tests resulted in the error shown above.

    That’s what’s weird though is that sometimes a batch of 100 or even 500 will go through and then stop when an error is found. However, if you run just one and an error is displayed it stops indexing.

    Never does it incrementally show a document count being indexed up (and reflecting the batch size specified) as it did with my ElasticSearch tests.

    What made it even more strange is that it did actually import 5k products but I have only been able to actually to do that twice so it’s not really a reliable solution. Just odd that different batch sizes result in different behavior.

    mcl7
    Participant
    3 years, 5 months ago #22573

    I would also add that I ended up deleting indexes several times last night and ever time receieved the error that is shown here (even though it did actually successfully delete the index every time)…its the same error (on line 281 as when sending data to algolia in the first error I pasted):

    An error or timeout occured.

    Error code: parsererror

    Error message: SyntaxError: Unexpected token { in JSON at position 2

    “”{“nb_results”:0,”status”:8,”message”:”Error on line 281 of file \/nas\/content\/live\/sitename\/wp-content\/object-cache.php: Undefined index: delete”,”indexing_complete”:false}

    mcl7
    Participant
    3 years, 5 months ago #22574

    Ok, not sure whats going on but I took a break and all the import errors are gone. Im guessing algolia made a change on their end?

    wpsolr
    Keymaster
    3 years, 5 months ago #22577

    You can try to check in your algolia’s dashboard index logs.

    mcl7
    Participant
    3 years, 5 months ago #22582

    The only errors in the algolia logs were two 404’s here:
    /1/indexes/gb_product_index/settings?getVersion=2

    wpsolr
    Keymaster
    3 years, 5 months ago #22589

    Did you ask Algolia support about this?

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.