CometD jQuery client not working IE9 - cometd

I am working on CometD jQuery client, which works with different channels. I am trying to to listen messages from cometd server on the channels after publishing a message but not able to receive any message on a subscribed channel (The callback of the subscribe does not execute).
Note : Its working fine with GC, FF and IE10 onwards.
Any help will be appreciated!
Thanks in advance:)
Log :
LOG: 20:53:53.064Transportlong-pollingreset
LOG: 20:53:53.064Transportcallback-pollingreset
LOG: 20:53:53.064New advice[object Object]
LOG: 20:53:53.064Initial transport islong-polling
LOG: 20:53:53.064Statusdisconnected->handshaking
LOG: 20:53:53.064Handshake sent[object Object]
LOG: 20:53:53.064Send[object Object]
LOG: 20:53:53.064Transportlong-pollingsending request1envelope[object Object]
LOG: 20:53:53.064Transportlong-pollingreceived errorerrorNo Transport
LOG: 20:53:53.065Transportlong-pollingwaiting at most10000ms for the response, maxNetworkDelay10000
LOG: 20:53:53.071Addingsubscriptionon/channel-1 with scopeundefinedand callbackfunction _handlerUserSession(message) {
}
LOG: 20:53:53.071Addedsubscription[object Object]
LOG: 20:53:53.122Invoking timed functionfunction()
{
self.transportFailure(envelope, request, failure);
}
LOG: 20:53:53.123handleFailure[object Object][object Object][object Object]
LOG: 20:53:53.123Transportlong-polling->callback-polling
LOG: 20:53:53.123Function scheduled in1000ms, interval =0backoff =1000function()
{
_handshake(_handshakeProps, _handshakeCallback);
}
LOG: 20:53:54.126Invoking timed functionfunction()
{
_handshake(_handshakeProps, _handshakeCallback);
}
LOG: 20:53:54.126Removedsubscription[object Object]
LOG: 20:53:54.126New advice[object Object]
LOG: 20:53:54.126Initial transport iscallback-polling
LOG: 20:53:54.126Handshake sent[object Object]
LOG: 20:53:54.126Send[object Object]
LOG: 20:53:54.126Transportcallback-pollingsending request1envelope[object Object]
LOG: 20:53:54.128Transportcallback-pollingwaiting at most10000ms for the response, maxNetworkDelay10000
LOG: 20:53:54.349Received[object Object]
LOG: 20:53:54.349New advice[object Object]
LOG: 20:53:54.349Send[object Object]
LOG: 20:53:54.349Transportcallback-pollingsending request2envelope[object Object]
LOG: 20:53:54.350Transportcallback-pollingwaiting at most10000ms for the response, maxNetworkDelay10000
LOG: 20:53:54.350Statushandshaking->connecting
LOG: 20:53:54.350Function scheduled in200ms, interval =200backoff =0function()
{
_connect();
}
LOG: 20:53:54.564Received[object Object],[object Object]
LOG: 20:53:54.573Invoking timed functionfunction()
{
_connect();
}
LOG: 20:53:54.573Connect sent[object Object]
LOG: 20:53:54.573Send[object Object]
LOG: 20:53:54.573Transportcallback-pollingmetaConnect send, request3envelope[object Object]
LOG: 20:53:54.573Transportcallback-pollingsending request3envelope[object Object]
LOG: 20:53:54.575Transportcallback-pollingwaiting at most40000ms for the response, maxNetworkDelay10000
LOG: 20:53:54.575Statusconnecting->connected
LOG: 20:53:54.788Transportcallback-pollingmetaConnect complete, request3
LOG: 20:53:54.788Received[object Object],[object Object],[object Object]
LOG: 20:53:54.788New advice[object Object]
LOG: 20:53:54.788Statusconnected->connecting
LOG: 20:53:54.788Function scheduled in200ms, interval =200backoff =0function()
{
_connect();
}
LOG: 20:53:54.788Handling remote call response for[object Object]with contextundefined
LOG: 20:53:54.788Handling remote call response for[object Object]with contextundefined
LOG: 20:53:54.999Invoking timed functionfunction()
{
_connect();
}
LOG: 20:53:54.999Connect sent[object Object]
LOG: 20:53:54.999Send[object Object]
LOG: 20:53:54.999Transportcallback-pollingmetaConnect send, request4envelope[object Object]
LOG: 20:53:55.000Transportcallback-pollingsending request4envelope[object Object]
LOG: 20:53:55.002Transportcallback-pollingwaiting at most40000ms for the response, maxNetworkDelay10000
LOG: 20:53:55.002Statusconnecting->connected
LOG: 20:54:05.509Transportcallback-pollingmetaConnect complete, request4
LOG: 20:54:05.509handleFailureundefined[object Object][object Object]
LOG: 20:54:05.509Statusconnected->connecting
LOG: 20:54:05.509Function scheduled in200ms, interval =200backoff =0function()
{
_connect();
}
LOG: 20:54:05.714Invoking timed functionfunction()
{
_connect();
}
LOG: 20:54:05.714Connect sent[object Object]
LOG: 20:54:05.714Send[object Object]
LOG: 20:54:05.714Transportcallback-pollingmetaConnect send, request5envelope[object Object]
LOG: 20:54:05.714Transportcallback-pollingsending request5envelope[object Object]
LOG: 20:54:05.717Transportcallback-pollingwaiting at most40000ms for the response, maxNetworkDelay10000
LOG: 20:54:05.717Statusconnecting->connected
LOG: 20:54:06.136Transportcallback-pollingmetaConnect complete, request5
LOG: 20:54:06.136Received[object Object]
LOG: 20:54:06.136Statusconnected->connecting
LOG: 20:54:06.136Function scheduled in200ms, interval =200backoff =0function()
{
_connect();
}

Related

an error only occur when observing in lib/pq

I tried to debug a go server with gorm & pgsql, an it exitted with panic when gorm try to connect to the pgsql with code:
d, err := gorm.Open("postgres", param)
and as I followed the stack, I found it is the problem with lib/pq proccess the server version:
case "server_version":
var major1 int
var major2 int
var minor int
//r.string is the string of pgsql version.
//mine is: 12.4 (Debian 12.4-1.pgdg100+1)
_, err = fmt.Sscanf(r.string(), "%d.%d.%d", &major1, &major2, &minor)
if err == nil {
cn.parameterStatus.serverVersion = major1*10000 + major2*100 + minor
}
obivisouly, the string 12.4 (Debian 12.4-1.pgdg100+1) dosen't match format %d.%d.%d, so it exitted with error.
but the strange thing is, it will only exit when debugging in GoLand (don't know about vscode). It will not happen when simplely build & run, the output is:
[INFO] 2022-11-04 15:30:52 +0800 [start_postgres.go:103] detecting database connecting... pgdir=%v/yak/tmp_build/database
[INFO] 2022-11-04 15:30:52 +0800 [start_postgres.go:106] detected exsited database.
[INFO] 2022-11-04 15:30:52 +0800 [core.go:107] health info manager is loading
[INFO] 2022-11-04 15:30:52 +0800 [manager.go:70] health info: cache 60 infos
[INFO] 2022-11-04 15:30:52 +0800 [core.go:112] start to connection postgres
[INFO] 2022-11-04 15:30:52 +0800 [core.go:117] build basic database manager instance
which is absloutly normal. then I did some modify on the source code in lib/pq/conn.go
rString := r.string()
fmt.Printf("\n%s\n\n", rString)
_, err = fmt.Sscanf(r.string(), "%d.%d.%d", &major1, &major2, &minor)
if err == nil {
cn.parameterStatus.serverVersion = major1*10000 + major2*100 + minor
}
and here is the strangest thing, the server crashed with infinite loop of error logging:
[INFO] 2022-11-04 16:37:00 +0800 [start_postgres.go:103] detecting database connecting... pgdir=%v/yak/tmp_build/database
12.4 (Debian 12.4-1.pgdg100+1)
[WARN] 2022-11-04 16:37:00 +0800 [start_postgres.go:110] open database failed: pq: invalid message format; expected string terminator
[INFO] 2022-11-04 16:37:00 +0800 [start_postgres.go:113] try to start a database...
12.4 (Debian 12.4-1.pgdg100+1)
[WARN] 2022-11-04 16:37:02 +0800 [start_postgres.go:206] try pq: invalid message format; expected string terminator times... waiting for the postgres starting up...
12.4 (Debian 12.4-1.pgdg100+1)
[WARN] 2022-11-04 16:37:03 +0800 [start_postgres.go:206] try pq: invalid message format; expected string terminator times... waiting for the postgres starting up...
12.4 (Debian 12.4-1.pgdg100+1)
[WARN] 2022-11-04 16:37:04 +0800 [start_postgres.go:206] try pq: invalid message format; expected string terminator times... waiting for the postgres starting up...
...
I can't figure it out why would this happen, I don't think it's in a goroutine because the main routine is blocked, so is there anyone can offer some helps?
versions of dependencies and IDE:
GoLand v2022.2.4
go version go1.19.2 linux/amd64
gorm v1.9.2
github.com/lib/pq v1.1.0
postgresql v12.4 (Debian 12.4-1.pgdg100+1)
I figured it out about the infinity loop of error, there's a select struct after the init connection, the code is:
select {
case <-ticker:
count++
conn, err := gorm.Open("postgres", param)
//conn, err := net.Dial("tcp", "127.0.0.1:5432")
if err != nil {
log.Warningf("try %v times... waiting for the postgres starting up...", err)
continue
}
_ = conn.Close()
return nil
}
so the problem is, when I print r.string(), it will return an error.
also it will exitted with panic in debug (GoLand) but work normally when build and run.

can't connect to swift-socket-client

I'm trying to make a chat, but I can't connect.
server use node.js and socket.io version 3.1.1
I'm using the most recent version of Swift socket client, is it two versions of the error?
It's been weeks now without knowing the cause.
help me plz,,TT
When the connection is connected, when the connection is disconnected, when there is an error, it is on and shown in the log window.
emit ("test") is a test event that returns "test" from the server if the test event succeeds.
class SocketIOManager: NSObject {
static let shared = SocketIOManager()
var manager = SocketManager(socketURL: URL(string: "http://myUrl.com")!, config: [.log(true), .compress])
var socket: SocketIOClient!
override init() {
super.init()
socket = manager.defaultSocket
socket = manager.socket(forNamespace: "/")
}
func establishConnection() {
socket.connect()
test()
}
func closeConnection() {
socket.disconnect()
}
func test() {
socket.on(clientEvent: .error) { (data, eck) in
print(data)
print(eck)
print(self.socket.status)
print("socket error")
}
socket.on("test") { (data, eck) in
print("hihihihi")
print(data)
print("socket test")
}
socket.on(clientEvent: .connect) { (data, eck) in
print(data)
print("socket connect!!")
self.socket.emit("test")
}
socket.on(clientEvent: .disconnect) { (data, eck) in
print(data)
print("socket disconnect")
}
}
}
2021-02-09 18:41:26.292366+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Handling event: statusChange with data: [connecting, 2]
2021-02-09 18:41:26.292608+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Joining namespace /
2021-02-09 18:41:26.292800+0900 TikiTaka[17730:854101] LOG SocketManager: Tried connecting socket when engine isn't open. Connecting
2021-02-09 18:41:26.292927+0900 TikiTaka[17730:854101] LOG SocketManager: Adding engine
2021-02-09 18:41:26.293654+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Adding handler for event: error
2021-02-09 18:41:26.293666+0900 TikiTaka[17730:854295] LOG SocketEngine: Starting engine. Server: http://54.180.2.226:3000
2021-02-09 18:41:26.293785+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Adding handler for event: test
2021-02-09 18:41:26.293796+0900 TikiTaka[17730:854295] LOG SocketEngine: Handshaking
2021-02-09 18:41:26.293892+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Adding handler for event: connect
2021-02-09 18:41:26.294001+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Adding handler for event: disconnect
2021-02-09 18:41:26.294320+0900 TikiTaka[17730:854295] LOG SocketEnginePolling: Doing polling GET http://54.180.2.226:3000/socket.io/?transport=polling&b64=1
af
2021-02-09 18:41:26.364252+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Got polling response
2021-02-09 18:41:26.364448+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Got poll message: 0{"sid":"8K5NIimNyRJ-oQ33AAFh","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000}
2021-02-09 18:41:26.364897+0900 TikiTaka[17730:854298] LOG SocketEngine: Got message: 0{"sid":"8K5NIimNyRJ-oQ33AAFh","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000}
2021-02-09 18:41:26.369022+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Handling event: ping with data: []
2021-02-09 18:41:26.369032+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Doing polling GET http://54.180.2.226:3000/socket.io/?transport=polling&b64=1&sid=8K5NIimNyRJ-oQ33AAFh
2021-02-09 18:41:26.369268+0900 TikiTaka[17730:854101] LOG SocketManager: Engine opened Connect
2021-02-09 18:41:26.369646+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Socket connected
2021-02-09 18:41:26.369886+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Handling event: statusChange with data: [connected, 3]
2021-02-09 18:41:26.370293+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Handling event: connect with data: ["/"]
["/"]
socket connect!!
2021-02-09 18:41:26.371367+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Emitting: 2["test"], Ack: false
2021-02-09 18:41:26.371442+0900 TikiTaka[17730:854298] LOG SocketEngine: Writing poll: has data: false
2021-02-09 18:41:26.371803+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Sending poll: as type: 2
2021-02-09 18:41:26.372298+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Created POST string: 1:2
2021-02-09 18:41:26.372767+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: POSTing
2021-02-09 18:41:26.372966+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Doing polling POST http://54.180.2.226:3000/socket.io/?transport=polling&b64=1&sid=8K5NIimNyRJ-oQ33AAFh
2021-02-09 18:41:26.373433+0900 TikiTaka[17730:854298] LOG SocketEngine: Writing poll: 2["test"] has data: false
2021-02-09 18:41:26.373660+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Sending poll: 2["test"] as type: 4
2021-02-09 18:41:26.409725+0900 TikiTaka[17730:854301] LOG SocketEnginePolling: Created POST string: 10:42["test"]
2021-02-09 18:41:26.410041+0900 TikiTaka[17730:854301] LOG SocketEnginePolling: POSTing
2021-02-09 18:41:26.410198+0900 TikiTaka[17730:854301] LOG SocketEnginePolling: Doing polling POST http://54.180.2.226:3000/socket.io/?transport=polling&b64=1&sid=8K5NIimNyRJ-oQ33AAFh
2021-02-09 18:41:26.411327+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Got polling response
2021-02-09 18:41:26.411533+0900 TikiTaka[17730:854298] LOG SocketEnginePolling: Doing polling GET http://54.180.2.226:3000/socket.io/?transport=polling&b64=1&sid=8K5NIimNyRJ-oQ33AAFh
2021-02-09 18:41:26.412691+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Handling event: websocketUpgrade with data: [["content-length": "18", "content-type": "text/html", "connection": "close"]]
2021-02-09 18:41:26.412823+0900 TikiTaka[17730:854296] LOG SocketEngine: Flushing probe wait
2021-02-09 18:41:26.422164+0900 TikiTaka[17730:854301] ERROR SocketEnginePolling: Error during long poll request
2021-02-09 18:41:26.422278+0900 TikiTaka[17730:854301] ERROR SocketEngine: Error
2021-02-09 18:41:26.422413+0900 TikiTaka[17730:854101] ERROR SocketManager: Error
2021-02-09 18:41:26.422436+0900 TikiTaka[17730:854301] LOG SocketEngine: Engine is being closed.
2021-02-09 18:41:26.422533+0900 TikiTaka[17730:854101] LOG SocketIOClient{/}: Handling event: error with data: ["Error"]
2021-02-09 18:41:26.422547+0900 TikiTaka[17730:854301] LOG SocketEnginePolling: Created POST string: 1:1
["Error"]
<SocketIO.SocketAckEmitter: 0x60000148cb40>
connected
socket error

failed to connect mongodb

A few days ago I tried to run my server with mongoDB(with - npm run dev), and I didn't have any problems. Now I always get this network error.
{ MongoNetworkError: connection 5 to cluster0-shard-00-02-fq3bp.mongodb.net:27017 closed
[1] at TLSSocket.<anonymous> (C:\Users\itaya\Desktop\Itay\Dog_App\node_modules\mongodb-core\lib\connection\connection.js:352:9)
[1] at Object.onceWrapper (events.js:277:13)
[1] at TLSSocket.emit (events.js:189:13)
[1] at _handle.close (net.js:597:12)
[1] at TCP.done (_tls_wrap.js:388:7)
[1] name: 'MongoNetworkError',
[1] errorLabels: [ 'TransientTransactionError' ],
[1] [Symbol(mongoErrorContextSymbol)]: {} }

Curator Leader election give connection refused error

I implemented curator leader election example which is given in this site
Instead of having number of curator clients I added only one curator client as follows
public void selectLeader() {
CuratorFramework client = null;
try {
client = CuratorFrameworkFactory.newClient("localhost:2181", new ExponentialBackoffRetry(1000, 3));
LeaderSelectorService service = new LeaderSelectorService(client, "/leaderSelections", "LeaderElector");
client.start();
Thread.sleep(10000);
service.start();
} catch (Exception e) {
System.out.println("error"+e);
}finally
{
System.out.println("Shutting down...");
// CloseableUtils.closeQuietly(client);
}
}
public class LeaderSelectorService extends LeaderSelectorListenerAdapter implements Closeable {
private final String name;
private final LeaderSelector leaderSelector;
public LeaderSelectorService(CuratorFramework client, String path, String name) {
this.name = name;
// create a leader selector using the given path for management
// all participants in a given leader selection must use the same path
// ExampleClient here is also a LeaderSelectorListener but this isn't required
leaderSelector = new LeaderSelector(client, path, this);
// for most cases you will want your instance to requeue when it relinquishes leadership
leaderSelector.autoRequeue();
}
public void start() throws IOException
{
// the selection for this instance doesn't start until the leader selector is started
// leader selection is done in the background so this call to leaderSelector.start() returns immediately
leaderSelector.start();
}
#Override
public void takeLeadership(CuratorFramework arg0) throws Exception {
// we are now the leader. This method should not return until we want to relinquish leadership
final int waitSeconds = (int)(5 * Math.random()) + 1;
System.out.println(name + " is now the leader. Waiting " + waitSeconds + " seconds...");
//System.out.println(name + " has been leader " + leaderCount.getAndIncrement() + " time(s) before.");
try
{
Thread.sleep(TimeUnit.SECONDS.toMillis(waitSeconds));
}
catch ( InterruptedException e )
{
System.err.println(name + " was interrupted.");
Thread.currentThread().interrupt();
}
finally
{
System.out.println(name + " relinquishing leadership.\n");
}
}
#Override
public void close() throws IOException {
leaderSelector.close();
}
}
I have only one zookeeper instance and I am using Zookeeper 3.4.6, curator-framework 4.0.0 and curator-recipes 4.0.0.
when I start the client, it connects to zookeeper and in the log I can see "State change : connected" message.
Then I wait 10s and start leader election which gives me below error repeatedly.
2017-09-06 09:34:22.727 INFO 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Unable to read additional data from server sessionid 0x15e555a719d0000, likely server has closed socket, closing socket connection and attempting reconnect
2017-09-06 09:34:22.830 INFO 1228 --- [c-1-EventThread] o.a.c.f.state.ConnectionStateManager : State change: SUSPENDED
2017-09-06 09:34:23.302 INFO 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2017-09-06 09:34:23.303 INFO 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Socket connection established, initiating session, client: /127.0.0.1:49594, server: localhost/127.0.0.1:2181
2017-09-06 09:34:23.305 INFO 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x15e555a719d0000, negotiated timeout = 120000
2017-09-06 09:34:23.305 INFO 1228 --- [c-1-EventThread] o.a.c.f.state.ConnectionStateManager : State change: RECONNECTED
2017-09-06 09:34:23.310 WARN 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session 0x15e555a719d0000 for server localhost/127.0.0.1:2181, unexpected error, closing socket connection and attempting reconnect
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_131]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.8.0_131]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_131]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.8.0_131]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_131]
at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:75) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:363) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
after some time it started to give me below error message.
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
at org.apache.curator.framework.imps.CuratorFrameworkImpl.checkBackgroundRetry(CuratorFrameworkImpl.java:831) [curator-framework-4.0.0.jar:4.0.0]
at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:623) [curator-framework-4.0.0.jar:4.0.0]
at org.apache.curator.framework.imps.WatcherRemovalFacade.processBackgroundOperation(WatcherRemovalFacade.java:152) [curator-framework-4.0.0.jar:4.0.0]
at org.apache.curator.framework.imps.GetConfigBuilderImpl$2.processResult(GetConfigBuilderImpl.java:222) [curator-framework-4.0.0.jar:4.0.0]
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:590) [zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:499) [zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
2017-09-06 09:34:31.897 INFO 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2017-09-06 09:34:31.898 INFO 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Socket connection established, initiating session, client: /127.0.0.1:49611, server: localhost/127.0.0.1:2181
2017-09-06 09:34:31.899 INFO 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x15e555a719d0000, negotiated timeout = 120000
2017-09-06 09:34:31.899 INFO 1228 --- [c-1-EventThread] o.a.c.f.state.ConnectionStateManager : State change: RECONNECTED
2017-09-06 09:34:31.907 WARN 1228 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session 0x15e555a719d0000 for server localhost/127.0.0.1:2181, unexpected error, closing socket connection and attempting reconnect
java.io.IOException: Xid out of order. Got Xid 41 with err -6 expected Xid 40 for a packet with details: clientPath:/leaderSelections serverPath:/leaderSelections finished:false header:: 40,12 replyHeader:: 0,0,-4 request:: '/leaderSelections,F response:: v{}
at org.apache.zookeeper.ClientCnxn$SendThread.readResponse(ClientCnxn.java:892) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:101) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:363) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
I tried several solution in the internet but non got succeeded. Does anybody know the root cause of this issue.
I have fixed this issue. There was version number mismatch between zookeeper version and curator version. I used curator version 4.0.0 with zookeeper 3.4.6. According to apache curator site
Curator 4.0.0 - compatible with ZooKeeper 3.5.x. I changed my curator version to 2.8.0

Receive Parse.push.send using cloud function succeed but device not receiving push notification

I tried to use Parse.push.send with cloud function I define to send out a push notification to a device. I follow the guide on CodePath Guide and I receive a success call back in my iOS App. However, none of the remote notification was delivered. I also have the _p_installationKey in my _User collection, and I can verify that the _Installation collection also have an entry matching the address stored in the _User collection. For each cloud function I call, one _PushStatus entry will be inserted, but numSent is 0. Below are the collections stored in my MLab and my environment.
_PushStatus
{
"_id": "3mxSHXoZa0",
"pushTime": "2017-05-19T17:38:46.346Z",
"query": "{\"deviceType\":\"ios\"}",
"payload": "{\"alert\":\"Message: Testing\"}",
"source": "rest",
"status": "running",
"numSent": 0,
"pushHash": "424b520d52c5e20b4eb95be535cb2d54",
"_wperm": [],
"_rperm": [],
"_acl": {},
"_created_at": {
"$date": "2017-05-19T17:38:46.346Z"
},
"_updated_at": {
"$date": "2017-05-19T17:38:46.408Z"
},
"count": 1
}
_Installation
{
"_id": "EMZ8EUmrC6",
"timeZone": "America/Los_Angeles",
"deviceToken": "55097f4ceca541cc5b02b5852d96d10c8238f147c3ec53c3e8a44bfc66520e41",
"deviceType": "ios",
"appVersion": "1",
"appName": "myAppName",
"channels": [
"global"
],
"installationId": "ae540abe-21d4-446f-b90f-f5b6bec04109",
"appIdentifier": "myAppIdentifier",
"parseVersion": "1.14.2",
"localeIdentifier": "en-US",
"badge": 0,
"_created_at": {
"$date": "2017-05-19T06:03:14.614Z"
},
"_updated_at": {
"$date": "2017-05-19T06:03:14.614Z"
}
}
_User
{
"_id": "ZEMtqdJMaw",
"_p_installationKey": "_Installation$EMZ8EUmrC6",
"username": "121259958664",
"_hashed_password": "$2a$10$HR6TtUFB5G3tkeA9LlHbvuKOE2rpG.gvyHqAjsOQBps.X9jQvu9DO",
"_wperm": [
"ZEMtqdJMaw"
],
"_rperm": [
"*",
"ZEMtqdJMaw"
],
"_acl": {
"ZEMtqdJMaw": {
"w": true,
"r": true
},
"*": {
"r": true
}
},
"_created_at": {
"$date": "2017-05-19T06:03:27.637Z"
},
"_updated_at": {
"$date": "2017-05-19T06:03:27.637Z"
}
}
Config Vars in Heroku
main.js
// iOS push testing
Parse.Cloud.define("iosPushTest", function(request, response) {
// request has 2 parameters: params passed by the client and the authorized user
var params = request.params;
var user = request.user;
// Our "Message" class has a "text" key with the body of the message itself
var messageText = params.text;
var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.equalTo('deviceType', 'ios'); // targeting iOS devices only
Parse.Push.send({
where: pushQuery, // Set our Installation query
data: {
alert: "Message: " + messageText
}
}, { success: function() {
console.log("#### PUSH OK");
response.success('success');
}, error: function(error) {
console.log("#### PUSH ERROR" + error.message);
response.error('failed');
}, useMasterKey: true});
});
index.js
var devCertPath = path.resolve(__dirname, 'ParsePushDevelopmentCertificate.p12');
var pushConfig = {'ios': [
{
pfx: devCertPath, // P12 file only
bundleId: 'myBundleId', // change to match bundleId
production: false // dev certificate
}
]
};
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'myAppId',
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: pushConfig
});
Logs
at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:04.498577+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:04.498577+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:04.498578+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:04.498579+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-05-19T18:06:04.498579+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:04.501023+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Socket Error
2017-05-19T18:06:04.501397+00:00 app[web.1]: Fri, 19 May 2017 18:06:04 GMT apn Socket closed undefined
2017-05-19T18:06:04.501480+00:00 app[web.1]: Fri, 19 May 2017 18:06:04 GMT apn Removing socket from pool undefined
2017-05-19T18:06:04.501686+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
2017-05-19T18:06:04.501787+00:00 app[web.1]: Fri, 19 May 2017 18:06:04 GMT apn 1 left to send
2017-05-19T18:06:20.502222+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Initialising connection
2017-05-19T18:06:20.502541+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn 1 left to send
2017-05-19T18:06:20.611635+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Socket error occurred undefined { Error: socket hang up
2017-05-19T18:06:20.611637+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:06:20.611638+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:20.611639+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:20.611652+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:20.611653+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:20.611654+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:20.611655+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9) code: 'ECONNRESET' }
2017-05-19T18:06:20.611802+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Destroying connection undefined
2017-05-19T18:06:20.611886+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Removing socket from pool undefined
2017-05-19T18:06:20.612721+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Raising error: { Error: socket hang up
2017-05-19T18:06:20.612723+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:06:20.612724+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:20.612724+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:20.612725+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:20.612725+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:20.612726+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:20.612727+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9) code: 'ECONNRESET' } undefined undefined
2017-05-19T18:06:20.612870+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Error occurred with trace: Error: socket hang up
2017-05-19T18:06:20.612871+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:06:20.612872+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:20.612872+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:20.612873+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:20.612873+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:20.612874+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:20.612875+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-05-19T18:06:20.613192+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Socket Error
2017-05-19T18:06:20.613647+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Socket closed undefined
2017-05-19T18:06:20.613741+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn Removing socket from pool undefined
2017-05-19T18:06:20.624646+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
2017-05-19T18:06:20.624800+00:00 app[web.1]: Fri, 19 May 2017 18:06:20 GMT apn 1 left to send
2017-05-19T18:06:52.614568+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Initialising connection
2017-05-19T18:06:52.614810+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn 1 left to send
2017-05-19T18:06:52.758861+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Socket error occurred undefined { Error: socket hang up
2017-05-19T18:06:52.758864+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:06:52.758865+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:52.758866+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:52.758866+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:52.758867+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:52.758868+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:52.758869+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9) code: 'ECONNRESET' }
2017-05-19T18:06:52.759154+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Destroying connection undefined
2017-05-19T18:06:52.759277+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Removing socket from pool undefined
2017-05-19T18:06:52.759717+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Raising error: { Error: socket hang up
2017-05-19T18:06:52.759719+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:06:52.759720+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:52.759720+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:52.759721+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:52.759722+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:52.759722+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:52.759723+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9) code: 'ECONNRESET' } undefined undefined
2017-05-19T18:06:52.759875+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Error occurred with trace: Error: socket hang up
2017-05-19T18:06:52.759876+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:06:52.759877+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:52.759878+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:52.759878+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:52.759879+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:52.759880+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:52.759880+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-05-19T18:06:52.760240+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Socket Error
2017-05-19T18:06:52.760741+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Socket closed undefined
2017-05-19T18:06:52.760851+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Removing socket from pool undefined
2017-05-19T18:06:52.761152+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
2017-05-19T18:06:52.761244+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn 1 left to send
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2017-05-19T18:06:52.759877+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:06:52.759878+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:06:52.759878+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:06:52.759879+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:06:52.759880+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:06:52.759880+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-05-19T18:06:52.760240+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Socket Error
2017-05-19T18:06:52.760741+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Socket closed undefined
2017-05-19T18:06:52.760851+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn Removing socket from pool undefined
2017-05-19T18:06:52.761152+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
2017-05-19T18:06:52.761244+00:00 app[web.1]: Fri, 19 May 2017 18:06:52 GMT apn 1 left to send
2017-05-19T18:07:42.422486+00:00 heroku[router]: at=info method=POST path="/parse/push" host=spottune.herokuapp.com request_id=4ebb4912-b4d5-42bd-8057-21cb23763300 fwd="54.204.64.16" dyno=web.1 connect=0ms service=18ms status=200 bytes=533 protocol=https
2017-05-19T18:07:42.368169+00:00 app[web.1]: [36mverbose[39m: REQUEST for [POST] /parse/functions/iosPushTest: {
2017-05-19T18:07:42.368182+00:00 app[web.1]: "text": "Testing"
2017-05-19T18:07:42.368186+00:00 app[web.1]: } method=POST, url=/parse/functions/iosPushTest, host=myapp.herokuapp.com, connection=close, x-parse-app-display-version=1.0, x-parse-application-id=applicationID, accept=*/*, accept-language=en-us, x-parse-os-version=10.3.2 (14F5080a), user-agent=Spottunes/1 CFNetwork/811.5.3 Darwin/16.6.0, x-parse-app-build-version=1, content-type=application/json; charset=utf-8, x-parse-session-token=r:d574da7c3405de7c7cad42c147bcec85, x-parse-client-version=i1.14.2, x-parse-installation-id=ae540abe-21d4-446f-b90f-f5b6bec04109, accept-encoding=gzip, deflate, x-request-id=1d2c625e-2d55-4270-b9b0-9b3c74ea457d, x-forwarded-for=128.54.116.32, x-forwarded-proto=https, x-forwarded-port=443, via=1.1 vegur, connect-time=0, x-request-start=1495217262279, total-route-time=0, content-length=18, text=Testing
2017-05-19T18:07:42.409208+00:00 app[web.1]: [36mverbose[39m: REQUEST for [POST] /parse/push: {
2017-05-19T18:07:42.409211+00:00 app[web.1]: "where": {
2017-05-19T18:07:42.409212+00:00 app[web.1]: "deviceType": "ios"
2017-05-19T18:07:42.409213+00:00 app[web.1]: },
2017-05-19T18:07:42.409214+00:00 app[web.1]: "data": {
2017-05-19T18:07:42.409214+00:00 app[web.1]: "alert": "Message: Testing"
2017-05-19T18:07:42.409215+00:00 app[web.1]: }
2017-05-19T18:07:42.409218+00:00 app[web.1]: } method=POST, url=/parse/push, host=myapp.herokuapp.com, connection=close, user-agent=node-XMLHttpRequest, Parse/js1.9.2 (NodeJS 7.10.0), accept=*/*, content-type=text/plain, x-request-id=4ebb4912-b4d5-42bd-8057-21cb23763300, x-forwarded-for=54.204.64.16, x-forwarded-proto=https, x-forwarded-port=443, via=1.1 vegur, connect-time=0, x-request-start=1495217262403, total-route-time=0, content-length=237, deviceType=ios, alert=Message: Testing
2017-05-19T18:07:42.410004+00:00 app[web.1]: [33mwarn[39m: Trying to schedule a push while server is not configured.
2017-05-19T18:07:42.410267+00:00 app[web.1]: [33mwarn[39m: Push will be sent immediately
2017-05-19T18:07:42.420038+00:00 app[web.1]: [36mverbose[39m: RESPONSE from [POST] /parse/push: {
2017-05-19T18:07:42.420040+00:00 app[web.1]: "headers": {
2017-05-19T18:07:42.420041+00:00 app[web.1]: "X-Parse-Push-Status-Id": "OBtnkjGpL8"
2017-05-19T18:07:42.420042+00:00 app[web.1]: },
2017-05-19T18:07:42.420043+00:00 app[web.1]: "response": {
2017-05-19T18:07:42.420043+00:00 app[web.1]: "result": true
2017-05-19T18:07:42.420044+00:00 app[web.1]: }
2017-05-19T18:07:42.420044+00:00 app[web.1]: } X-Parse-Push-Status-Id=OBtnkjGpL8, result=true
2017-05-19T18:07:42.428718+00:00 app[web.1]: #### PUSH OK
2017-05-19T18:07:42.429322+00:00 app[web.1]: [32minfo[39m: Ran cloud function iosPushTest for user ZEMtqdJMaw with:
2017-05-19T18:07:42.429324+00:00 app[web.1]: Input: {"text":"Testing"}
2017-05-19T18:07:42.429325+00:00 app[web.1]: Result: "success" functionName=iosPushTest, text=Testing, user=ZEMtqdJMaw
2017-05-19T18:07:42.430053+00:00 app[web.1]: [36mverbose[39m: RESPONSE from [POST] /parse/functions/iosPushTest: {
2017-05-19T18:07:42.430054+00:00 app[web.1]: "response": {
2017-05-19T18:07:42.430055+00:00 app[web.1]: "result": "success"
2017-05-19T18:07:42.430056+00:00 app[web.1]: }
2017-05-19T18:07:42.430056+00:00 app[web.1]: } result=success
2017-05-19T18:07:42.433082+00:00 app[web.1]: [36mverbose[39m: _PushStatus OBtnkjGpL8: sending push to 1 installations
2017-05-19T18:07:42.458687+00:00 app[web.1]: Fri, 19 May 2017 18:07:42 GMT apn 2 left to send
2017-05-19T18:07:42.432839+00:00 heroku[router]: at=info method=POST path="/parse/functions/iosPushTest" host=spottune.herokuapp.com request_id=1d2c625e-2d55-4270-b9b0-9b3c74ea457d fwd="128.54.116.32" dyno=web.1 connect=0ms service=151ms status=200 bytes=502 protocol=https
2017-05-19T18:07:56.765036+00:00 app[web.1]: Fri, 19 May 2017 18:07:56 GMT apn Initialising connection
2017-05-19T18:07:56.767442+00:00 app[web.1]: Fri, 19 May 2017 18:07:56 GMT apn 2 left to send
2017-05-19T18:07:57.045303+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Socket error occurred undefined { Error: socket hang up
2017-05-19T18:07:57.045317+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:07:57.045318+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:07:57.045318+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:07:57.045319+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:07:57.045319+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:07:57.045320+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:07:57.045320+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9) code: 'ECONNRESET' }
2017-05-19T18:07:57.045416+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Destroying connection undefined
2017-05-19T18:07:57.045473+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Removing socket from pool undefined
2017-05-19T18:07:57.045796+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Raising error: { Error: socket hang up
2017-05-19T18:07:57.045797+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:07:57.045797+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:07:57.045798+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:07:57.045798+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:07:57.045799+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:07:57.045799+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:07:57.045800+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9) code: 'ECONNRESET' } undefined undefined
2017-05-19T18:07:57.045910+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Error occurred with trace: Error: socket hang up
2017-05-19T18:07:57.045912+00:00 app[web.1]: at TLSSocket.onHangUp (_tls_wrap.js:1120:19)
2017-05-19T18:07:57.045912+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:07:57.045913+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:07:57.045914+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:07:57.045914+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:07:57.045915+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:07:57.045916+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-05-19T18:07:57.046198+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Socket Error
2017-05-19T18:07:57.046589+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Socket closed undefined
2017-05-19T18:07:57.046677+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Removing socket from pool undefined
2017-05-19T18:07:57.046816+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
2017-05-19T18:07:57.046889+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn 2 left to send
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2017-05-19T18:07:57.045912+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:07:57.045913+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:07:57.045914+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:07:57.045914+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:07:57.045915+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:07:57.045916+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-05-19T18:07:57.046198+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Socket Error
2017-05-19T18:07:57.046589+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Socket closed undefined
2017-05-19T18:07:57.046677+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Removing socket from pool undefined
2017-05-19T18:07:57.046816+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
2017-05-19T18:07:57.046889+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn 2 left to send
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2017-05-19T18:07:57.045912+00:00 app[web.1]: at Object.onceWrapper (events.js:293:19)
2017-05-19T18:07:57.045913+00:00 app[web.1]: at emitNone (events.js:91:20)
2017-05-19T18:07:57.045914+00:00 app[web.1]: at TLSSocket.emit (events.js:188:7)
2017-05-19T18:07:57.045914+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2017-05-19T18:07:57.045915+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-19T18:07:57.045916+00:00 app[web.1]: at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-05-19T18:07:57.046198+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Socket Error
2017-05-19T18:07:57.046589+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Socket closed undefined
2017-05-19T18:07:57.046677+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn Removing socket from pool undefined
2017-05-19T18:07:57.046816+00:00 app[web.1]: verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
2017-05-19T18:07:57.046889+00:00 app[web.1]: Fri, 19 May 2017 18:07:57 GMT apn 2 left to send
Call using Swift
print("sending push notification...")
let param: [String: Any] = [
"text" : "Testing"
]
PFCloud.callFunction(inBackground: "iosPushTest", withParameters: param) { (response, error) in
print("push \(response)")
}
Xcode console
sending push notification...
push Optional(success)
Not sure what else should I add in order to make this work. Any help is appreciated
I don't see a file path to your APNS cert in your configs. That needs to be included, and there is a little bit of extra configuration to do in your index.js to enable Push. Not sure how it's hadnled when you call Push.send() without the extra configuration enabled, but that looks to be going through. So, my bet is invalid APNS. If you debug this locally, you'd likely get some more useful server output.