java.lang.IllegalStateException: Channel closed before HTTP/2

112 views
Skip to first unread message

Priti Kelvekar

unread,
May 7, 2020, 2:33:40 AM5/7/20
to pushy
Hi,

I have written a java program to send push notification using pushy. On trying to send push notification by connecting to broadband connection getting following error. Switching to mobile hotspot isn't giving the error. I don't have any proxy configured on my machine. Need help understanding the issue and what needs to be done to take care of it.

java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Channel closed before HTTP/2 preface completed.
at io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:41)
at apnsprj.SendNotification.dispatch(SendNotification.java:142)
at apnsprj.SendNotification.main(SendNotification.java:53)
Caused by: java.lang.IllegalStateException: Channel closed before HTTP/2 preface completed.
at com.turo.pushy.apns.ApnsChannelFactory$3$2.operationComplete(ApnsChannelFactory.java:218)
at com.turo.pushy.apns.ApnsChannelFactory$3$2.operationComplete(ApnsChannelFactory.java:212)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103)
at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1148)
at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:764)
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:740)
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:611)
at io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1376)
at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
at io.netty.handler.ssl.SslHandler.closeOutboundAndChannel(SslHandler.java:1586)
at io.netty.handler.ssl.SslHandler.close(SslHandler.java:710)
at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:465)
at io.netty.channel.DefaultChannelPipeline.close(DefaultChannelPipeline.java:1003)
at io.netty.channel.AbstractChannel.close(AbstractChannel.java:238)
at io.netty.bootstrap.Bootstrap$2.operationComplete(Bootstrap.java:229)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:112)
at io.netty.resolver.InetSocketAddressResolver$1.operationComplete(InetSocketAddressResolver.java:64)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:112)
at io.netty.resolver.RoundRobinInetAddressResolver$1.operationComplete(RoundRobinInetAddressResolver.java:71)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:504)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:483)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121)
at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:176)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121)
at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:726)
at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:679)
at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:335)
at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:324)
at io.netty.resolver.dns.DnsResolveContext.access$700(DnsResolveContext.java:62)
at io.netty.resolver.dns.DnsResolveContext$3.operationComplete(DnsResolveContext.java:375)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121)
at io.netty.resolver.dns.DnsQueryContext.setFailure(DnsQueryContext.java:223)
at io.netty.resolver.dns.DnsQueryContext.access$300(DnsQueryContext.java:42)
at io.netty.resolver.dns.DnsQueryContext$4.run(DnsQueryContext.java:162)
at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:125)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:465)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
[main] INFO com.turo.pushy.apns.ApnsClient - Shutting down.

Jon Chambers

unread,
May 9, 2020, 5:12:01 PM5/9/20
to pushy
Hello!

I believe you also reported this as https://github.com/jchambers/pushy/issues/777, which suggests there may be some DNS issues at play. Unfortunately, I don't know what's going wrong, but it certainly sounds like it's some kind of network configuration issue beyond Pushy's control.

-Jon

Priti Kelvekar

unread,
May 12, 2020, 6:29:13 AM5/12/20
to Jon Chambers, pushy
Hello Jon,

What I don't understand is that the behavior is intermittent and it suddenly starts working after some time. At the same time on checking with curl the server seems to be running.

--
Pushy is an open-source Java library for sending APNs (iOS and OS X) push notifications. Pushy is brought to you by the engineers at RelayRides.
---
You received this message because you are subscribed to the Google Groups "pushy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pushy-apns/7ddcfa2e-3acd-4562-884f-86272ed12352%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages