As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Inconsistent collectionAccess query inside of custom endpoint. Returning null with "Error: No repli
P
Patrick Gold
started a topic
about 10 years ago
When querying the "user" collection using collectionAccess inside of a custom endpoint, the query occasionally (every 5-10 queries) returns null and produces the following error:
"Error: No replica set primary available for query with ReadPreference PRIMARY"
This is a occurring issue in our backend. I am surprised you see it as often as you mention, last time I looked it was at around 1% of all requests. We are doing some architectural improvements over the next few weeks that would eliminate it. I agree it is annoying, and we are working hard to get rid of it. In the meantime, you could add retry logic either in BL or in your app, because retries succeed, and this happens only on reads, so it's safe to retry.
J
Joel Margolese
said
about 10 years ago
I'm seeing the same problem. On some operations it's at about 10-20% of operations and users are complaining. What's the status on fixing this?
Retrofitting all of our BL with retry logic is a bit daunting and I'd like to avoid it if possible.
thx
I
Ivan Stoyanov
said
about 10 years ago
We are working on it, but a full elimination of the problem requires reworking some of the deeper layers of the platform. By the end of the month max.
P
Patrick Gold
said
almost 10 years ago
Is there an update on this? This problem is still very prevalent. I am sometimes having to retry the request up to 5 times for it to succeed.
Patrick Gold
"Error: No replica set primary available for query with ReadPreference PRIMARY"
Sample code that produces this error:
function onRequest(request, response, modules){
// Module instances
var collectionAccess = modules.collectionAccess,
logger = modules.logger,
username = request.username,
collectionAccess.collection("user").findOne({"username":username}, function(err, requestingUser){
if (err){
logger.info(err);
response.error("query failed:" + err);
} else if (!requestingUser) {
response.error("didn't find user, no error");
} else {
response.body = requestingUser;
response.complete();
}
});
}
To clarify - When querying with identical parameters, this error only occurs every few attempts. Can somebody provide some insight?
Thank you.