AlexaAndroid icon indicating copy to clipboard operation
AlexaAndroid copied to clipboard

okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL

Open rohith-krish opened this issue 7 years ago • 9 comments

On trying to send audio request to Alexa, this error is occurring many times

okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL at okhttp3.internal.http2.Http2Stream.checkOutNotClosed(Http2Stream.java:567) at okhttp3.internal.http2.Http2Stream$FramingSink.emitFrame(Http2Stream.java:501) at okhttp3.internal.http2.Http2Stream$FramingSink.write(Http2Stream.java:481) at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171) at okio.RealBufferedSink.write(RealBufferedSink.java:85) at com.mea.meaa.vox.framework.AlexaSpeechEngine$1.writeTo(AlexaSpeechEngine.java:89) at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.java:171) at okhttp3.MultipartBody.writeTo(MultipartBody.java:113) at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:59) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179) at okhttp3.RealCall.execute(RealCall.java:63) at com.willblaschko.android.alexa.AlexaManager$AsyncEventHandler.success(AlexaManager.java:614) at com.willblaschko.android.alexa.AlexaManager$AsyncEventHandler.success(AlexaManager.java:594) at com.willblaschko.android.alexa.interfaces.speechrecognizer.SpeechSendAudio.sendAudio(SpeechSendAudio.java:54) at com.willblaschko.android.alexa.AlexaManager$5$1$1.doInBackground(AlexaManager.java:349) at com.willblaschko.android.alexa.AlexaManager$5$1$1.doInBackground(AlexaManager.java:345) at android.os.AsyncTask$2.call(AsyncTask.java:304) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761)

rohith-krish avatar Jul 20 '17 05:07 rohith-krish

Did you resolve this issue?

PrincessMelime avatar Aug 02 '17 13:08 PrincessMelime

No the issue still exists

rohith-krish avatar Aug 03 '17 09:08 rohith-krish

I meeting with this problem too。In the meantime,it report "E/DownChannelService: Bad line",and ahead of "stream was reset: CANCEL",it report "D/EventBus: No subscribers registered for event class com.willblaschko.android.alexa.interface.speechrecognizer.AvsStopCaptureItem"。Have a solution?Thanks.

AlleyneLin avatar Aug 22 '17 08:08 AlleyneLin

I fixed the StreamReset issue by restarting the down channel service every time I launch the application. AvsStopCaptureItem is not registered in EventBus that why the message is displaying but it is not the reason for the StreamReset Exception.

rohith-krish avatar Aug 22 '17 13:08 rohith-krish

please add readTimeOut and then try again

mingmingcao avatar Oct 24 '17 10:10 mingmingcao

Hi All, Still issue is present, most of the cases we are getting error while checking condition for if(!mBufferedSource.exhausted()) in downchannel service.

@rohith-krish, When StreamResetException occurred I've tried reconnecting to server again for every 1min. But still StreamResetException keep getting 4/5 times. Not sure How to solve this problem

01-02 11:42:32.941 21826-22366/com.borqs.alexa W/System.err: okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL 01-02 11:42:32.941 21826-22366/com.borqs.alexa W/System.err: at okhttp3.internal.http2.Http2Stream$FramingSource.checkNotClosed(Http2Stream.java:436) 01-02 11:42:32.942 21826-22366/com.borqs.alexa W/System.err: at okhttp3.internal.http2.Http2Stream$FramingSource.read(Http2Stream.java:338) 01-02 11:42:32.942 21826-22366/com.borqs.alexa W/System.err: at okhttp3.internal.http2.Http2Codec$StreamFinishingSource.read(Http2Codec.java:210) 01-02 11:42:32.942 21826-22366/com.borqs.alexa W/System.err: at okio.RealBufferedSource.exhausted(RealBufferedSource.java:56) 01-02 11:42:32.942 21826-22366/com.borqs.alexa W/System.err: at com.willblaschko.android.alexa.service.DownChannelService$1$1.onResponse(DownChannelService.java:153) 01-02 11:42:32.942 21826-22366/com.borqs.alexa W/System.err: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153) 01-02 11:42:32.942 21826-22366/com.borqs.alexa W/System.err: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 01-02 11:42:32.942 21826-22366/com.borqs.alexa W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 01-02 11:42:32.943 21826-22366/com.borqs.alexa W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 01-02 11:42:32.943 21826-22366/com.borqs.alexa W/System.err: at java.lang.Thread.run(Thread.java:761)

Please let me know If you need any logs or other information.

prasannakumark avatar Jan 02 '18 11:01 prasannakumark

@prasannakumark Try to restart the down channel service after every session.

rohith-krish avatar Jan 03 '18 06:01 rohith-krish

Hi @rohith-krish, thanks for your information.

How about when app is in background like set Timer/Alarms/notifications setting by using other device. This are the uses case its keep getting fails

prasannakumark avatar Feb 19 '18 14:02 prasannakumark

also encounter the same problem.Now I will try to restart the downchannel at every session...

wantitmore avatar May 08 '18 08:05 wantitmore