Skip to content

ERR! parse-server-push-adapter APNS cannot find vaild connection #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
funkenstrahlen opened this issue Jun 6, 2016 · 5 comments
Closed
3 tasks done

Comments

@funkenstrahlen
Copy link
Contributor

My parse server log is filled with ERR! parse-server-push-adapter APNS cannot find vaild connection errors. Push Notifications reach devices though. This seems to happen for devices that uninstalled the app and are now no longer reachable.

Some discussion can be found here as this issue got moved and reopened here: parse-community/parse-server#1665 (comment)

Environment Setup

    push: {
        android: { senderId: '...', apiKey: '...' }, // setting android keys empty to remove error
        ios: {
          pfx: __dirname + process.env.APN_PUSH_P12_PATH, // The filename of private key and certificate in PFX or PKCS12 format from disk  
          bundleId: process.env.APN_BUNDLE_ID, // The bundle identifier associate with your app
          production: false // Specifies which environment to connect to: Production
        }
    }

Steps to reproduce

  • Install app on device. Does register to parse server.
  • Uninstall app
  • send push notification

Expected Behaviour

Devices that are no longer reachable get removed from the database.

The make it clear: Push notification do get send out fine to valid devices. I just do not know why this error appears. I think the error is caused by devices which do not have the app installed any more?

Logs/Trace

Apr 19 20:36:36 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 19 20:36:36 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 19 20:36:37 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 19 21:42:54 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 19 21:42:55 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 19 21:42:55 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 20 19:29:50 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 20 19:29:51 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 20 19:29:52 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 20 23:56:00 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 20 23:56:01 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 20 23:56:02 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 21 20:30:10 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 21 20:30:11 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 21 20:30:12 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 21 22:30:59 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 21 22:31:00 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 21 22:31:01 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 22 16:17:58 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 22 16:17:58 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 22 16:17:59 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 22 16:33:06 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 22 16:33:07 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 22 16:33:07 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 22 16:34:49 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 22 16:34:50 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 22 16:34:51 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 22 17:10:04 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 22 17:10:04 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 22 17:10:05 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 24 10:47:19 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 24 10:47:19 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 24 10:47:20 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 24 11:02:55 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 24 11:02:56 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 24 11:02:57 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 24 11:25:33 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 24 11:25:34 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 24 11:25:34 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
Apr 24 11:38:18 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 03750761765ab097c58b1f90d30a078d892
Apr 24 11:38:18 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 37bc6500dd5e33ff43dc7a3f1e45ebc25a5
Apr 24 11:38:19 xsn-app parse-app-production[6721]: ERR! parse-server-push-adapter APNS cannot find vaild connection for 899efce347b266412d39da18379569bdaa7
@mbxt
Copy link

mbxt commented Jul 6, 2016

Does your server actually stay alive across these errors? I'm experiencing the same error (though because we switched APN certificates), but it results in a fatal crash and the server must be restarted. I'm wondering if I'm missing some sort of necessary recovery option or module.

@funkenstrahlen
Copy link
Contributor Author

Does your server actually stay alive across these errors?

Yes it does. It also sends out the push messages correctly.

@mbxt
Copy link

mbxt commented Jul 7, 2016

Thanks for the response, @funkenstrahlen . Looks like something was wrong with the certs I was using, but now that I have the correct key, the server stays alive. I too have a deviceToken that is invalid and causing the same error you report, but thankfully it's no longer a fatal error.

@jatinp-sufalamtech
Copy link

jatinp-sufalamtech commented Dec 21, 2016

I am getting the same error and my server is alive, actually I am able to send push notification from first application to second application but unable to send from second application to first application, by the way I have installed two application in same device.

Following is my index.js file of parse server,

// Example express application adding the parse-server module to expose Parse
// compatible API routes.

const resolve = require('path').resolve;

var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var path = require('path');
var SimpleMailgunAdapter = require('/var/WWW/Parse/node_modules/parse-server-simple-mailgun-adapter');
var FpPushAdapter = require('/var/WWW/Parse/node_modules/parse-server-fp-push-adapter');
var path = require('path');
var pushConfig = {
ios: [ //like official parse-server-push-plugin (already array compatible), e.g.:
{
pfx: '/var/WWW/Parse/files/nct_apns-dev-cert.p12', // Prod PFX or P12
// pfx: path.join(__dirname, "/files/Nector_apns-dev-cert.p12"),
// passphrase: '', // optional password to your p12
bundleId: 'com.otl.nct',
// cert: '/var/WWW/Parse/files/Nector_apns-dev.pem', // If not using the .p12 format, the path to the certificate PEM to load from disk
production: true // Prod
},
{
pfx: '/var/WWW/Parse/files/nectorpro-apns-dev-cert.p12', // Dev PFX or P12
// pfx: path.join(__dirname, "/files/nectorpro-apns-dev-cert.p12"),
// passphrase: '', // optional password to your p12
bundleId: 'com.otl.nctpro',
// cert: '/var/WWW/Parse/files/nctpro-apns-dev.pem', // If not using the .p12 format, the path to the certificate PEM to load from disk
production: true // Dev
}
]
};

var fpPushAdapter = new FpPushAdapter(pushConfig);

var databaseUri = "";

if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}

var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || '/var/WWW/Parse/cloud/main.js',
appId: process.env.APP_ID || '',
masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
},
//Push Notification
push: {
adapter: fpPushAdapter
}
});

// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey

var app = express();

// Serve static assets from the /public folder
app.use('/public', express.static(path.join(__dirname, '/public')));

// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);

// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a website. Please star the parse-server repo on GitHub!');
});

// There will be a test page available on the /test path of your server url
// Remove this before launching your app
app.get('/test', function(req, res) {
res.sendFile(path.join(__dirname, '/public/test.html'));
});

var port = process.env.PORT || 1337;
var httpServer = require('http').createServer(app);

httpServer.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});

// This will enable the Live Query real-time server
ParseServer.createLiveQueryServer(httpServer);

@mtrezza
Copy link
Member

mtrezza commented Mar 2, 2024

Closing as outdated

@mtrezza mtrezza closed this as completed Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants