WDE0028: Request timed out.

My Wix data queries worked just fine until I doubled my database size to about 150,000 records. Now I pretty regularly get the error message (WDE0028: Request timed out.) Standard query below:

var results = await wixData.query("ResidentialMasterList")
    .eq("PostalCode", zipcode)

What does this error code mean, and what are the recommended solutions?

Thank you!

What happens, if you increase your limitation from 200 to 400, or even 1000?

Same results. I’m curious if it’s a timeout issue, or multiple threads hitting the same database. I’m using multiple async calls to the same database within the function (get a subset of the data to analyze, then iterate through that subset and make more calls to the database for relevant rows). I’ll try changing all the async calls to a then() chain.

Interestingly, when I navigate to the collection via the Editor, my site logging shows “Unknown Error” while the collection attempts to load.

I’ll also try implementing retry logic and hope that clears this up.

@njvanhoff Post the entire function please.

After some testing and forum diving, it looks like I should have had more robust retry logic for my queries on the client side (i.e. not expect wix-data to handle it all). Excited to share that this change seems to have solved the problems! My queries now look something like this:

var results ;
var retry = 0 ;

**while**  ( retry  <  5 ) { 
    **await**  wixData . query ( "ResidentialMasterList" ) 
    . eq ( "StandardStatus" , "A" ) 
    . limit ( 1000 ) 
    . find (). then ( ( res ) => { 
            results  =  res ; 
            retry  =  5 ; 
        } ) 
        . **catch** ( ( err ) => { 
            **let**  errorMsg  =  err ; 
            retry  +=  1 ; 
        } ); 

Regarding your code → i still do not understand how your code works!??

The max. limit of a query as we all know is → 1000 (o.k.-checked)
You also have setted-up the limitation.
But how are you able to get more then 1000-items out of your DB, since you are not using → .skip() in any part of your code?

Do i misunderstand something?

From the UeberMaster (Giedrius) himself: “WDE0028 will usually indicate and expensive query that took longer to run.”
So I think I can explain why the above works:

  1. the query is expensive and times out
  2. it generates an error
  3. any error triggers a retry
    4)but, by now, during the first query, database token has already been generated and containers are spinning (warm load)
    5)just because of 4, the retry now works, by sheer luck
1 Like

Lucky guy! :laughing:

@Giri Zano BTW: I was also searching for some promiseAll-examples, could not find a lot information about it. I wanted to refresh my MEMORY…

Don’t you happen to have some good links on hand?

Working on a Mega-Query-System :sweat_smile::sweat_smile::sweat_smile::sweat_smile:
But the last piece of the puzzle is missing.

skip/limit and promiseAll are some-king of a must have-package.