I suggest you clone the parse server repo locally and set a breakpoint on error. This way you can look at the stack trace and see what caused the error.
I fixed it dividing object requests into 10 pieces of chunks.
Seems parse user object saving needs time to process and resolve.
for (h = 0, k = addingList.length; h < k; h += chunk2) {
temparray = addingList.slice(h, h + chunk2);
await Parse.Object.saveAll(temparray,{useMasterKey:true}).then((success) => {
console.log(h + chunk2 + β customers were added from total β + k);
return h + chunk2 + β customers were added from total β + k
}).catch((error) => {
console.log('Some customers were failed to import in chunk : β + h + β. Error:β + error);
console.log(error)
return 'Some customers were failed to import in chunk : β + h + β. Error:β + error
});
}
Parse Server already supports the batchSize parameter that divides the objects passed to saveAll into batches. There is a default batchSize if Iβm not mistaken, so even if you donβt set the parameter explicitly, it is saving the objects in batches.
That behavior can be expected, depending on the context. If you are saving large objects and the database or server or network between server and database is near resource limits, a smaller batch size may be required.
However, if you are saving small objects and the metrics donβt indicate a resource constraint, that would look suspicious.