Meteor.logout() take long time to run until error

For some reasons, I cannot reply under this topic, so I edit this post.

I think the reason was database connection drop off for some reasons, so the log out process waited until timeout and then call client logout process.

The random database connection drops also happen on other parts. The page hangs there until database connection is back


Few months ago, we found Meteor.logout() behaved strange. logout process hangs there until Meteor console pops up error message: The error message is a HTML doc: Error: failed[503]… Request forbidden …

I have debugged the code, the waiting happens in code accounts_client:

After self.connection.apply was executed, about 10 minutes, the function (error, result) was called, with error is null, result is null, and then jump to execute: self.makeClientLoggedOut();

logout(callback) {
var self = this;
self.connection.apply(‘logout’, [], {
wait: true
}, function (error, result) {
if (error) {
callback && callback(error);
} else {
self.makeClientLoggedOut();
callback && callback();
}
});
}

Can you post the exact error message? You referenced a 503 error code but then said “request forbidden”; 503 error codes mean that a service is unavailable. 403 is more in-line with a forbidden request. Posting the exact error message will help us troubleshoot.

=> App running at: http://localhost:3000/
I20160215-09:15:25.513(11)? { [Error: failed [503]
I20160215-09:15:25.515(11)?
I20160215-09:15:25.515(11)?
I20160215-09:15:25.516(11)?
I20160215-09:15:25.516(11)?
I20160215-09:15:25.517(11)? Request Forbidden!
I20160215-09:15:25.517(11)?
I20160215-09:15:25.517(11)?
I20160215-09:15:25.517(11)? <!–
I20160215-09:15:25.517(11)? #wrapper {
I20160215-09:15:25.518(11)? position: absolute;
I20160215-09:15:25.518(11)? padding: 0;
I20160215-09:15:25.518(11)? border: 0;
I20160215-09:15:25.518(11)? width: 636;
I20160215-09:15:25.519(11)? text-align: left;
I20160215-09:15:25.519(11)? }
I20160215-09:15:25.519(11)? #footer {
I20160215-09:15:25.519(11)? font-family: Verdana, Arial, Helvetica, sans-serif;
I20160215-09:15:25.519(11)? font-size: x-small;
I20160215-09:15:25.520(11)? text-align: center;…] stack: [Getter] }