Meteor.call sometimes not called on the server


Hello,
In my app I’ve just deployed to servers with mup the sub in in 2 steps : first one subscribes through the form provided by AccountsTemplate (materialize) then he goes to a second page to finish his sign-up. Everything works on the client but on the server in a very unpredictable and unreliable way sometimes my method finishSignUp isn’t called AT ALL. Neither on the server or on the client . No error is thrown (I even wrapped in a try/catch), when this weird state is triggered actually NO METEOR.CALL works even if I meteor call a method I know doesn’t exist it doesn’t throw any sort of error unlike when the website is in its normal state…
I can’t provide a reproduction as it’s only in the remote server that it happens (I tried --production but I cannot reproduce the bug). I’ve been struggling this issue since yesterday, my clients are mad about me we’ve losed all our reputation and a lot of money on this, so I hope you’ll care about my issue even though I cannot provide a repository.
The very ugly hack for now is reloading the entire page, it unlocks again the Meteor.call. Meteor status returns that I’m connected.
Server doesn’t log inhabitual things. I’m affected by the bug #6247. Unfortunately as I haven’t received any support there (…) I did require(‘events’).EventEmitter.defaultMaxListeners = Infinity; . I don’t know if it’s related. I’m still on 1.6 because of #9976 that breaks 1.7. I know there’s a workaround but this is rather slow to apply and do I need to update ro receive support ? I have also the bug " Error: The Mongo server and the Meteor query disagree on how many documents match your query. Maybe it is hitting a Mongo edge case? The query is: {}" (#9619). I didn’t track down the core of the issue as I’m not sure how to reproduce it nor I have the time to care about it.
To reproduce go to https://mesfichescrfpa.fr -> connectez-vous -> s’enregistrer (bottom of the card) -> you check stuff put your email password -> BUTTON “S’ENREGISTRER” -> you go to another page you select two random stuff in the top 2 select elements (procédure/specialité) -> then either it works and you’re redirect to the home page. Or the button stay greyed out for an infinity of time…
Packages

meteor-base@1.3.0 # Packages every Meteor app needs to have
mobile-experience@1.0.5 # Packages for a great mobile UX
mongo@1.4.2 # The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views
reactive-var@1.0.11 # Reactive variable for tracker
tracker@1.1.3 # Meteor’s client-side reactive programming library

standard-minifier-js@2.3.1 # JS minifier run for production mode
es5-shim@4.7.0 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.10.6 # Enable ECMAScript2015+ syntax in app code
jquery@1.11.10 # For easy DOM manipulation

accounts-password@1.5.0
kadira:flow-router
kadira:blaze-layout
arillo:flow-router-helpers
useraccounts:flow-routing
softwarerero:accounts-t9n
ground:db
session@1.1.7
seba:minifiers-autoprefixer
archive:jquery-dotdotdot
random@1.1.0
momentjs:moment
rzymek:moment-locale-fr
underscore@1.0.10
froatsnook:valid-email
shell-server@0.3.1
fourseven:scss
manuel:reactivearray
meteorhacks:picker
promise@0.10.1
check@1.3.0
ddp-rate-limiter@1.0.7
raix:eventddp
npm-bcrypt@0.9.3
kadira:dochead
gadicohen:sitemaps
blaze
dynamic-import@0.3.0
useraccounts:materialize
materialize:materialize
tinymce
tinymce-lineheight
email

Versions
accounts-base@1.4.2
accounts-password@1.5.1
allow-deny@1.1.0
archive:jquery-dotdotdot@1.6.15
arillo:flow-router-helpers@0.5.2
autoupdate@1.4.0
babel-compiler@7.0.9
babel-runtime@1.2.2
base64@1.0.11
binary-heap@1.0.10
blaze@2.3.2
blaze-html-templates@1.1.2
blaze-tools@1.0.10
boilerplate-generator@1.4.0
caching-compiler@1.1.12
caching-html-compiler@1.1.2
callback-hook@1.1.0
check@1.3.1
coffeescript@1.0.17
ddp@1.4.0
ddp-client@2.3.2
ddp-common@1.4.0
ddp-rate-limiter@1.0.7
ddp-server@2.1.2
deps@1.0.12
diff-sequence@1.1.0
dynamic-import@0.3.0
ecmascript@0.10.9
ecmascript-runtime@0.5.0
ecmascript-runtime-client@0.6.2
ecmascript-runtime-server@0.5.0
ejson@1.1.0
email@1.2.3
es5-shim@4.7.3
fourseven:scss@4.9.0
froatsnook:valid-email@1.0.0
gadicohen:robots-txt@0.0.10
gadicohen:sitemaps@0.0.26
geojson-utils@1.0.10
ground:db@2.0.0-rc.6
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
http@1.4.1
id-map@1.1.0
jquery@1.11.10
kadira:blaze-layout@2.3.0
kadira:dochead@1.5.0
kadira:flow-router@2.12.1
launch-screen@1.1.1
livedata@1.0.18
localstorage@1.2.0
logging@1.1.20
manuel:reactivearray@1.0.8
materialize:materialize@0.100.2-1
meteor@1.8.6
meteor-base@1.3.0
meteorhacks:picker@1.0.3
minifier-css@1.3.1
minifier-js@2.3.5
minimongo@1.4.4
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modules@0.11.8
modules-runtime@0.9.2
momentjs:moment@2.22.1
mongo@1.4.7
mongo-dev-server@1.1.0
mongo-id@1.0.7
npm-bcrypt@0.9.3
npm-mongo@2.2.34
observe-sequence@1.0.16
ordered-dict@1.1.0
promise@0.10.2
raix:eventddp@0.0.2
raix:eventemitter@0.1.3
raix:eventstate@0.0.4
random@1.1.0
rate-limit@1.0.9
reactive-dict@1.2.0
reactive-var@1.0.11
reload@1.2.0
retry@1.1.0
routepolicy@1.0.13
rzymek:moment-locale-fr@2.14.1
seba:minifiers-autoprefixer@1.0.1
server-render@0.3.1
service-configuration@1.0.11
session@1.1.7
sha@1.0.9
shell-server@0.3.1
shim-common@0.1.0
socket-stream-client@0.1.0
softwarerero:accounts-t9n@1.3.11
spacebars@1.0.15
spacebars-compiler@1.1.3
srp@1.0.10
standard-minifier-js@2.3.4
templating@1.3.2
templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
tinymce@4.7.13-2
tinymce-lineheight@1.0.2
tracker@1.1.3
ui@1.0.13
underscore@1.0.10
url@1.2.0
useraccounts:core@1.14.2
useraccounts:flow-routing@1.14.2
useraccounts:materialize@1.14.2
webapp@1.5.0
webapp-hashing@1.0.9
zimme:active-route@2.3.2

Method :

async ‘User.finishSignUp’({ specialty, method, token, billingOption, couponName }) {
check(specialty, Number);
check(method, Number);
check(token, Match.Maybe(String));
check(billingOption, Match.Maybe(String));
console.log(this.userId);

const userId = this.userId;
const dataToInsert = {};
dataToInsert.specialty = specialty;
dataToInsert.method = method;
if (billingOption && couponName || (token && billingOption !== 'free')) {
  _.extend(dataToInsert, await billing({ token, billingOption, couponName, method, specialty }));
}
Meteor.users.update(userId, { $set: dataToInsert });

},
I very desperately need your help, this is the worst scenario that happened for this deployment and the worst kind of bug (not sure how to reproduce, only happen on the remote server not on my development server).
Thanks,
My call on client
console.log(‘Call user.finishSignUp’);
try {
Meteor.call(‘User.finishSignUp’, {
specialty, method, token, billingOption, couponName,
}, (error, value) => {
console.log(error, value);
loading.set(false);
if (error) {
const retrievedErr = errorHandler(error);
if (retrievedErr) {
errorMessage.push(retrievedErr);
} else {
toast(‘Un problème est survenue. Vos informations n’ont pas été mise à jour.’);
}
console.log(error);
} else {
FlowRouter.go(‘landing’);
}
});
} catch(e) {
console.log(e);
}
}.
It always console.log ‘call user.finishSignUp’ but never calls on the server (USER ID is not even logged or anything), throw an error or call the callback.
Thanks for ANY support you may provide, any hints ideas you may have.

The code you’ve shown looks OK (although you don’t need the try/catch around your client call). Have you tried a try/catch in your method? You don’t explicitly do a throw new Meteor.Error() in your method. It may be worth putting that in the catch.

That sounds more like an issue with your deployment.

If you can share your mup deployment file (sanitise any secrets) perhaps someone here with mup experience (not me) will be able to help.

Okay thanks very much for trying to help me :slight_smile:
module.exports = {
servers: {
one: {
host: ‘CENSORED’,
username: ‘CENSORED’,
password: ‘CENSORED’,
},
},

proxy: {
domains: ‘prepacrfpa.fr,www.prepacrfpa.fr,mesfichescrfpa.fr,www.mesfichescrfpa.fr’,
ssl: {
// Enable let’s encrypt to create free certificates.
// The email is used by Let’s Encrypt to notify you when the
// certificates are close to expiring.
letsEncryptEmail: ‘CENSORED’,
forceSSL: true,
},
},

app: {
name: ‘worksheets’,
path: ‘…/’,
servers: {one: {}},
env: {
ROOT_URL: ‘https://mesfichescrfpa.fr’,
MONGO_URL: ‘CENSORED’,
MONGO_OPLOG_URL: ‘CENSORED’,
},
docker: {
image: ‘abernix/meteord:node-8.9.4-binbuild’,
},
deployCheckWaitTime: 800,
},
};
I only put try/catch to recently debug this issue it is indeed of no help, I will put method’s code in a try/catch but I don’t think it would fail silently anyway.

My problem is solved,
thanks

Please add the resolution to this topic to help others.

Thanks :slight_smile:

1 Like

I have the same issue! Can you provide us the resolution.

Thanks :slight_smile: