Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
515 stars 197 forks source link

RangeError: Maximum call stack size exceeded on first connection of cordova client #51

Closed bastiRe closed 9 years ago

bastiRe commented 9 years ago

I have a hybrid meteor app with Android and iOS clients. The first time after the installation of the app one of these clients connects my server it throws an error and restarts. This is the log that I get:

W20150323-14:03:25.841(10)? (STDERR)
W20150323-14:03:25.842(10)? (STDERR) /Users/BastiR/.meteor/packages/meteor-tool/.1.0.43.1v54ord++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150323-14:03:25.842(10)? (STDERR)                        throw(ex);
W20150323-14:03:25.842(10)? (STDERR)                              ^
W20150323-14:03:25.843(10)? (STDERR) RangeError: Maximum call stack size exceeded

I only have this error with the push package installed and it only happens with Cordova clients not a web client. After the server has restarted the responsible Cordova client connects fine. It's just the first connection that provokes the restart. It seems to me that it has something to do with the push setup for new clients. Push itself works fine afterwards for Android and iPhone. I only have development certificates for push and push is in development mode. Any ideas what causes this behaviour?

raix commented 9 years ago

@bastiRe what version of raix:push are you using? So this only happens when the client connects the first time / doesn't have a token?

Would be nice to figure this one out

bastiRe commented 9 years ago

I’m using 2.6.4. It only happens when the client connects the first time. The interesting difference is that it happens on Android again after uninstalling the app and installing it again whereas it only happens the first time the app is installed on an iOS device. Reinstalling the app on iOS doesnt’t trigger the behaviour.

On 23 Mar 2015, at 17:17, Morten N.O. Nørgaard Henriksen notifications@github.com wrote:

@bastiRe https://github.com/bastiRe what version of raix:push are you using? So this only happens when the client connects the first time / doesn't have a token?

Would be nice to figure this one out

— Reply to this email directly or view it on GitHub https://github.com/raix/push/issues/51#issuecomment-84853739.

dennisharrison commented 9 years ago

I haven't seen this on iOS or Android yet. Will try uninstalling and reinstalling on Android in an hour or so.

raix commented 9 years ago

@bastiRe what setup are you on/os etc.?

Weijtmans commented 9 years ago

I'm having the same issue when a user connects to the server for the server for the first time and inserts its push token. The crash only seems to only occur on iOS. I'm using the latest meteor and raix:push.

dennisharrison commented 9 years ago

@bastiRe & @Weijtmans Can you give details about the environment that your server is running in?

dennisharrison commented 9 years ago

Can't reproduce on my versions.

I'm on OS X 10.10.2 using Meteor 1.0.4.2 and Push 2.6.3

I'll try upgrading Push and see if that does anything - but I don't see how that one change will cause this.

raix commented 9 years ago

I'm marking this as a bug - I've seen this behaviour before I think, but unable to replicate.

STATS:

OS

Platform related

When

what throws errors

Versions

Weijtmans commented 9 years ago

@dennisharrison No problem. I'm running a Digital Ocean droplet (1GB/1CPU) with the Ubuntu 14.04 X64 image. Running Meteor (1.0.4.2) deployed with Meteor Up (with Node 0.10.36). I'm using Raix:Push (2.6.4) in production in combination with the following packages:

aldeed:collection2: 2.3.2 cordova:org.apache.cordova.dialogs: 0.3.0 cordova:org.apache.cordova.network-information: 0.2.15 d0minikk:materialize-meteor: 1.95.1 dburles:google-maps: 1.0.8 fastclick: 1.0.3 ground:db: 0.3.6 harrison:papa-parse: 1.0.10 iron:router: 1.0.7 matteodem:easy-search: 1.4.13 meteor-platform: 1.2.2 meteorhacks:cluster: 1.6.1 meteorhacks:kadira: 2.20.1 meteorhacks:subs-manager: 1.3.0 mobile-status-bar: 1.0.3 natestrauser:connection-banner: 0.4.3 okgrow:iron-router-autoscroll: 0.0.7 reywood:iron-router-ga: 0.5.3 standard-app-packages: 1.0.5 steeve:jquery-qrcode: 0.2.2 underscore: 1.0.3 zimme:iron-router-active: 1.0.1

If you need any more info, feel free to ask. I can provide you with the logs and access to our server if needed.

bastiRe commented 9 years ago

My server is hosted via Modulus with 512mb/1 cpu. However, I can see the same error in the logs on my local development Macbook with OSX 10.10, but the restart of the local server is so fast that it's not noticeable in the app. I'm currently using Meteor 1.0.4 and this is a list of my packages:

accounts-password 1.1.0 aldeed:autoform 4.2.2 aldeed:collection2 2.3.2 aldeed:simple-schema 1.3.1 anti:fake 0.4.1 cordova:com.cowbell.cordova.geofence cordova:com.phonegap.plugins.facebookconnect cordova:de.appplant.cordova.plugin.local-notification fourseven:scss 2.0.1_4 iron:router 1.0.7 mdg:geolocation 1.0.2 meteor-platform 1.2.2 meteoric:autoform-ionic 0.1.5 meteoric:ionic 0.1.17+ meteoric:ionic-sass 0.1.9 meteoric:ionicons-sass 0.1.6 momentjs:moment 2.9.0 particle4dev:cordova-fb 1.1.3 raix:push 2.6.4 sacha:spin 2.0.4 service-configuration 1.0.4 useraccounts:ionic 1.8.1

Weijtmans commented 9 years ago

I pulled the following from the logs and Kadira (on or right before the server crash). From logs: Push: updated { token: { apn: 'APN OF CLIENT' }, appName: 'main', userId: null, createdAt: Wed Mar 25 2015 11:14:06 GMT-0400 (EDT), updatedAt: Wed Mar 25 2015 11:14:06 GMT-0400 (EDT), _id: [ [Circular] ] } undefined

From Kadira: Maximum call stack size exceeded Cannot read property 'canonical_ids' of null TypeError: Cannot read property 'canonical_ids' of null at packages/raix:push/lib/server/push.api.js:243:1 at lambda (/opt/erasmus-master/app/programs/server/npm/raix_push/node_modules/node-gcm/lib/sender.js:116:20) at IncomingMessage. (/opt/erasmus-master/app/programs/server/npm/raix_push/node_modules/node-gcm/lib/sender.js:66:21) at IncomingMessage.emit (events.js:117:20) at _stream_readable.js:944:16 at process._tickCallback (node.js:442:13)

raix commented 9 years ago

@Weijtmans I'll have a look at it

dennisharrison commented 9 years ago

@Weijtmans I'm also running this on a digital ocean 1gb droplet w/ 14.04 lts and don't see it - shoot.

Weijtmans commented 9 years ago

@dennisharrison I can give you temporary access to the droplet if that helps. Please feel free to contact me at elgar@brightbind.com.

raix commented 9 years ago

Could you guys test out Published raix:push@2.6.5

It's minor changes made - I'm wondering why android send returns no error but result == null on some systems - We'll have to investigate

bastiRe commented 9 years ago

As far as I can tell the error is gone. Good job.

Weijtmans commented 9 years ago

I tested locally (on OSX and on Ubunutu 14.04 with both iOS and Android clients). The problem seems to be fixed. Great work. Thank you!

raix commented 9 years ago

Cool, Thanks guys!

I'm keeping this open just a bit more - I'm still thinking it's odd that the result is null on some platforms. So we should prop. want to investigate further.

adeelraza commented 9 years ago

I'm having the same issue. Upgrading to 2.6.5 starts giving a different error in Modulus logs:

Exception in setInterval callback: Error: Push: Error while parsing query string

raix commented 9 years ago

@adeelraza It's another issue tracked in #52