Resume upload after crash
-
We have a site with 80k records, 40k in each language that we are trying to get re-uploaded to Algolia via the Search page sync. However we are usually only able to get 16k or in fact the latest sync we got to 30k. We try a few times a day, we’ve tweaked the server timeouts, we tweaked some of the algolia timouts based on some troubleshooting items we found here in this support.
Im just wondering what the best way to get this data back into Aloglia.Is there something we can run to batch 10k or 5k at a time and then resume the next day? Does the pro plugin add additional support for this? Happy to pay, just need to get it sorted
-
Hi @chillybin
We don’t batching in the UI version of the indexing process, and Pro doesn’t add that as a feature either.
The closest for batch processing would be with the WP-CLI integration. https://github.com/WebDevStudios/wp-search-with-algolia/wiki/WP-CLI
For example:
# Reindex content starting from the 5th batch...
wp algolia reindex --from_batch=5That said, I’m curious if it’s a true timeout, or if it’s possible that an error is occurring at the time of it stopping, and that’s preventing it from continuing. Do you have any access to error logs that could be checked to help verify?
Are you getting some sort of alert that perhaps says “An error occurred: undefined” or similar? I am hoping we can get that specific messaging fixed, as it’s not helpful and could be preventing seeing the actual errors occurring.
We havent found any significant errors in the logs, its essentually returning a browser alert with “undefined” which doesn’t tell us much.
Its a multi-language site so we’re not sure if its a bad character in one of the records or really where to go from here
Ocasioanlly we got a 503 error as well, but its usually the “undefined”
We have added this code as well
function my_algolia_timeout_increase( $args ) {
// Increase timeout to 3 minutes.
$args['CURLOPT_TIMEOUT'] = 180;
return $args;
}
add_filter( 'algolia_http_client_options', 'my_algolia_timeout_increase' );
function wds_algolia_custom_searchclient_config( $config ) {
$config['connectTimeout'] = 5; // default: 2
$config['readTimeout'] = 120; // default: 30
$config['writeTimeout'] = 120; // default: 30
return $config;
}
add_filter( 'algolia_custom_search_config', 'wds_algolia_custom_searchclient_config' );
add_filter( 'algolia_indexing_batch_size', function () { return 25; } );I feel like you’re a prime person who could help test/confirm this change that I have worked up, but haven’t merged anywhere yet.
https://github.com/WebDevStudios/wp-search-with-algolia/pull/457/files
The line numbers should all match up still, in case you haven’t yet updated to the 2.8.3 release we pushed out late yesterday.
If you could make these same changes and try again, and report if something besides “undefined” gets shown, that’d be awesome.
We don’t have CLI access on this install, we may have to check with the host for SSH access.
So for now, i’ve made that change, we haven’t updated the plugin yet but ive manually made the change and run the sync again. We did have up to 30k records in there so hopefully, this runs smoothly overnight and doesn’t get rid of the 30k already in there.
Will check back in the morning, thanks!
Not sure how you’re potentially automating the “Re-index All Content” button usage, unless it’s someone who’s up late/over night manually clicking it.
Regardless, looking forward to see if this provides any new information.
We got the same error: An error occurred: undefined
Trying again
-
This reply was modified 1 year, 2 months ago by
Shaan Nicol.
this is in a browser alert popup, correct?
yes, the same in my original screenshot
Are you familiar with looking at XHR/AJAX requests in your browser’s developer console?
I know with successful requests, it returns say:
totalPagesCount: 11
finished: trueWhen finished processing, and i’m curious if you’re somehow still getting just nothing back on the request that fails, at minimum, I’d expect a
responseTextproperty, even if that itself is empty, if the changes were made properly based on my linked PR.It failed again, but this time i’ve checked the response and it seems to be returning:
{"totalPagesCount":4023,"finished":false}It’s at 1% now → https://www.dropbox.com/scl/fi/uc0oknkzflqmji0x6uneh/Screenshot-2025-04-04-at-9.26.12-am.png?rlkey=0gcy5ib959s83iiyh5ypks37j&dl=0
Here is the edited file → https://pastetext.org/0znmarsxnx
-
This reply was modified 1 year, 2 months ago by
Shaan Nicol.
-
This reply was modified 1 year, 2 months ago by
Shaan Nicol.
This is as far as im able to get → https://www.dropbox.com/scl/fi/hfrsii7zikhr5wsckq2k6/Screenshot-2025-04-04-at-9.19.42-pm.png?rlkey=s9anlkjx29o1cqsnsv2tcfafq&dl=0
hmm, the “response” tab would be what I’d want to see for the failing XHR request, to see if at least it has a
responseTextproperty set, even if its value is potentially empty.Once the error shows, the response tab is empty: it failed at page 218
When i clicked OK on the “undefined” warning, this is what I got: https://www.dropbox.com/scl/fi/gwx00h1lsnmg8l3cvpagg/Screenshot-2025-04-05-at-9.38.30-am.png?rlkey=i7sicbsbgg144ni29rrrsc03g&dl=0
I’ve managed to get nearly 14 hours into the sync and then it crashed
Page: 1121/1610
https://www.dropbox.com/scl/fi/79rwvaho93elr6xg5bsbx/Screenshot-2025-04-06-at-1.00.42-am.png?rlkey=cgdyzz4lp2jfl1baqgydp7mxd&dl=0
So close, i’d rather not start againAnd to be certain, there hasn’t been errors in your server logs as well, correct?
I’m a little irked that I can’t locale where the “undefined” value is coming from in the ajax/alert.
-
This reply was modified 1 year, 2 months ago by
The topic ‘Resume upload after crash’ is closed to new replies.
