Skip to content
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

Error pinging server #134

Closed
danikula opened this issue Apr 22, 2017 · 73 comments
Closed

Error pinging server #134

danikula opened this issue Apr 22, 2017 · 73 comments
Assignees
Labels
Milestone

Comments

@danikula
Copy link
Owner

danikula commented Apr 22, 2017

In some cases local server cache proxy is not pinged. One known problem is system proxy in connection's settings (wi-fi or apn).
May be some another reasons exist.
Typical stacktrace is


E/Pinger: Error reading ping response
          com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:52645/ping with offset 0
              at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
              at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
              at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
              at java.util.concurrent.FutureTask.run(FutureTask.java:237)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
              at java.lang.Thread.run(Thread.java:818)
           Caused by: java.io.FileNotFoundException: http://127.0.0.1:52645/ping
              at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238)
              at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
              at com.danikula.videocache.Pinger.pingServer(Pinger.java:86) 
              at com.danikula.videocache.Pinger.access$100(Pinger.java:28) 
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108) 
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104) 
              at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
              at java.lang.Thread.run(Thread.java:818) 
E/Pinger: Error reading ping response
          com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:52645/ping with offset 0
              at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
              at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
              at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
              at java.util.concurrent.FutureTask.run(FutureTask.java:237)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
              at java.lang.Thread.run(Thread.java:818)
           Caused by: java.io.FileNotFoundException: http://127.0.0.1:52645/ping
              at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238)
              at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
              at com.danikula.videocache.Pinger.pingServer(Pinger.java:86) 
              at com.danikula.videocache.Pinger.access$100(Pinger.java:28) 
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108) 
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104) 
              at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
              at java.lang.Thread.run(Thread.java:818) 
E/Pinger: Error reading ping response
          com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:52645/ping with offset 0
              at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
              at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
              at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
              at java.util.concurrent.FutureTask.run(FutureTask.java:237)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
              at java.lang.Thread.run(Thread.java:818)
           Caused by: java.io.FileNotFoundException: http://127.0.0.1:52645/ping
              at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238)
              at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
              at com.danikula.videocache.Pinger.pingServer(Pinger.java:86) 
              at com.danikula.videocache.Pinger.access$100(Pinger.java:28) 
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108) 
              at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104) 
              at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
              at java.lang.Thread.run(Thread.java:818) 
E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, email me danikula@gmail.com or create issue here https://github.com/danikula/AndroidVideoCache/issues
          com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, email me danikula@gmail.com or create issue here https://github.com/danikula/AndroidVideoCache/issues
              at com.danikula.videocache.Pinger.ping(Pinger.java:67)
              at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:182)
              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:119)
              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:100)
              at com.danikula.videocache.sample.VideoFragment.startVideo(VideoFragment.java:59)
              at com.danikula.videocache.sample.VideoFragment.afterViewInjected(VideoFragment.java:44)
              at com.danikula.videocache.sample.VideoFragment_.onViewChanged(VideoFragment_.java:107)
              at org.androidannotations.api.view.OnViewChangedNotifier.notifyViewChanged(OnViewChangedNotifier.java:41)
              at com.danikula.videocache.sample.VideoFragment_.onViewCreated(VideoFragment_.java:72)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1097)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)
              at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
              at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)
              at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:330)
              at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:547)
              at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
              at android.app.Activity.performStart(Activity.java:6268)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
              at android.app.ActivityThread.-wrap11(ActivityThread.java)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:148)
              at android.app.ActivityThread.main(ActivityThread.java:5417)
              at java.lang.reflect.Method.invoke(Native Method)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
@danikula
Copy link
Owner Author

Since #28 fixed by this commit it should be fixed too.

@danikula danikula added this to the 2.7.0 milestone Apr 23, 2017
@ricardorover
Copy link

Hi. Using AndroidVideoCache version 2.7.0 I saw the log below, so here I am, reporting as asked :) Hope it helps somehow.

I was testing using AndroidVideoCache inside recyclerview rows to pre-load audio and video. Scrolling between a lot of items very fast, around list position 650 the log stack traces appeared:

08-01 23:37:33.905 16591-16591 W/Pinger: Error pinging server (attempt: 0, timeout: 70). 
08-01 23:37:34.046 16591-16591 W/Pinger: Error pinging server (attempt: 1, timeout: 140). 
08-01 23:37:34.326 16591-16591 W/Pinger: Error pinging server (attempt: 2, timeout: 280). 
08-01 23:37:34.335 16591-16591 E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]
                                                          com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]. Version: 2.7.0
                                                              at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                              at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                              at com.myapp.app.controller.AssetController.streamAsset(AssetController.java:117)
                                                              at com.myapp.app.ui.main.feed.cell.AppVideoCell.bind(AppVideoCell.java:38)
                                                              at com.myapp.app.ui.main.feed.AppListAdapter.onBindViewHolder(AppListAdapter.java:97)
                                                              at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356)
                                                              at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598)
                                                              at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:282)
                                                              at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:336)
                                                              at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:349)
                                                              at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:356)
                                                              at android.support.v7.widget.GapWorker.run(GapWorker.java:387)
                                                              at android.os.Handler.handleCallback(Handler.java:751)
                                                              at android.os.Handler.dispatchMessage(Handler.java:95)
                                                              at android.os.Looper.loop(Looper.java:154)
                                                              at android.app.ActivityThread.main(ActivityThread.java:6126)
                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

(...)

08-01 23:37:34.543 16591-16591 W/Pinger: Error pinging server (attempt: 0, timeout: 70). 
08-01 23:37:34.685 16591-16591 W/Pinger: Error pinging server (attempt: 1, timeout: 140). 
08-01 23:37:34.966 16591-16591 W/Pinger: Error pinging server (attempt: 2, timeout: 280). 
08-01 23:37:34.969 16591-16591 E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]
                                                          com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]. Version: 2.7.0
                                                              at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                              at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                              at com.myapp.app.controller.AssetController.streamAsset(AssetController.java:117)
                                                              at com.myapp.app.ui.main.feed.cell.AppVideoCell.bind(AppVideoCell.java:38)
                                                              at com.myapp.app.ui.main.feed.AppListAdapter.onBindViewHolder(AppListAdapter.java:97)
                                                              at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356)
                                                              at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598)
                                                              at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440)
                                                              at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436)
                                                              at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224)
                                                              at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551)
                                                              at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511)
                                                              at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1325)
                                                              at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1061)
                                                              at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4726)
                                                              at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
                                                              at android.view.Choreographer.doCallbacks(Choreographer.java:686)
                                                              at android.view.Choreographer.doFrame(Choreographer.java:618)
                                                              at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
                                                              at android.os.Handler.handleCallback(Handler.java:751)
                                                              at android.os.Handler.dispatchMessage(Handler.java:95)
                                                              at android.os.Looper.loop(Looper.java:154)
                                                              at android.app.ActivityThread.main(ActivityThread.java:6126)
                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

(...)

08-01 23:37:37.535 16591-20734 E/ProxyCache: ProxyCache error
                                                              com.danikula.videocache.ProxyCacheException: Error opening connection for http://api.myapp.com/asset/123 with offset 72932. Version: 2.7.0
                                                                  at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
                                                                  at com.danikula.videocache.ProxyCache.readSource(ProxyCache.java:123)
                                                                  at com.danikula.videocache.ProxyCache.access$100(ProxyCache.java:19)
                                                                  at com.danikula.videocache.ProxyCache$SourceReaderRunnable.run(ProxyCache.java:187)
                                                                  at java.lang.Thread.run(Thread.java:761)
                                                               Caused by: java.io.FileNotFoundException: http://api.myapp.com/asset/123
                                                                  at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)
                                                                  at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
                                                                  at com.danikula.videocache.ProxyCache.readSource(ProxyCache.java:123) 
                                                                  at com.danikula.videocache.ProxyCache.access$100(ProxyCache.java:19) 
                                                                  at com.danikula.videocache.ProxyCache$SourceReaderRunnable.run(ProxyCache.java:187) 
                                                                  at java.lang.Thread.run(Thread.java:761) 
08-01 23:37:37.537 16591-17446 E/HttpProxyCacheServer: HttpProxyCacheServer error
                                                                        com.danikula.videocache.ProxyCacheException: Error processing request. Version: 2.7.0
                                                                            at com.danikula.videocache.HttpProxyCacheServer.processSocket(HttpProxyCacheServer.java:241)
                                                                            at com.danikula.videocache.HttpProxyCacheServer.access$200(HttpProxyCacheServer.java:52)
                                                                            at com.danikula.videocache.HttpProxyCacheServer$SocketProcessorRunnable.run(HttpProxyCacheServer.java:338)
                                                                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
                                                                            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)
                                                                         Caused by: com.danikula.videocache.ProxyCacheException: Error reading source 1 times. Version: 2.7.0
                                                                            at com.danikula.videocache.ProxyCache.checkReadSourceErrorsCount(ProxyCache.java:59)
                                                                            at com.danikula.videocache.ProxyCache.read(ProxyCache.java:45)
                                                                            at com.danikula.videocache.HttpProxyCache.responseWithCache(HttpProxyCache.java:79)
                                                                            at com.danikula.videocache.HttpProxyCache.processRequest(HttpProxyCache.java:45)
                                                                            at com.danikula.videocache.HttpProxyCacheServerClients.processRequest(HttpProxyCacheServerClients.java:42)
                                                                            at com.danikula.videocache.HttpProxyCacheServer.processSocket(HttpProxyCacheServer.java:234)
                                                                            at com.danikula.videocache.HttpProxyCacheServer.access$200(HttpProxyCacheServer.java:52) 
                                                                            at com.danikula.videocache.HttpProxyCacheServer$SocketProcessorRunnable.run(HttpProxyCacheServer.java:338) 
                                                                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428) 
                                                                            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) 

@Inxo
Copy link

Inxo commented Aug 8, 2017

Have a some problem as @ricardorover

@ziyuo
Copy link

ziyuo commented Aug 15, 2017

E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT@]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT@]. Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.haier.cellarette.activity.VideoModuleActivity.startVideo(VideoModuleActivity.java:445)
at com.haier.cellarette.activity.VideoModuleActivity.showContent(VideoModuleActivity.java:353)
at com.haier.wine_consult.presenter.ConsultPresenter$5.onNext(ConsultPresenter.java:136)
at com.haier.wine_consult.presenter.ConsultPresenter$5.onNext(ConsultPresenter.java:121)
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:215)
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5280)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)

@josinaldobarbosa
Copy link

E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT@]
                                                             com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT@]. Version: 2.7.0
                                                                 at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                                 ...

after many days of frustration I managed to find something: NanoHttpd/nanohttpd#270 (comment),
as MrStanaland said, Mint is causing this, at least in my case, now it works for me 👍

Mint.disableNetworkMonitoring();
Mint.initAndStartSession(context, BuildConfig.MINT);

@SanfenR
Copy link

SanfenR commented Oct 30, 2017

com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [HTTP @ Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.goodchef.liking.module.paly.VideoPlayActivity.onCreate(VideoPlayActivity.java:146)
at android.app.Activity.performCreate(Activity.java:6910)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at cn.jiguang.a.a.d.a.a.d.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6577)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

When I loaded the local video, there was' Error pinging server (attempt: 2, timeout: 280) 'and this Error

@firebaseempower
Copy link

firebaseempower commented Dec 13, 2017

Default proxies are: [DIRECT]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.danikula.videocache.sample.VideoFragment.setupPlayer(VideoFragment.java:80)
at com.danikula.videocache.sample.VideoFragment.afterViewInjected(VideoFragment.java:63)
at com.danikula.videocache.sample.VideoFragment_.onViewChanged(VideoFragment_.java:107)
at org.androidannotations.api.view.OnViewChangedNotifier.notifyViewChanged(OnViewChangedNotifier.java:41)
at com.danikula.videocache.sample.VideoFragment_.onViewCreated(VideoFragment_.java:72)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1097)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:330)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:547)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1270)
at android.app.Activity.performStart(Activity.java:6689)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2622)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

getting this issue

@dechaow
Copy link

dechaow commented Jan 12, 2018

Hello,I using this library,this but I rest on video list pager a long time, again scroll list,they throw the error:

`E/Pinger: Error reading ping response
com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:58762/ping with offset 0. Version: 2.7.0
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
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:776)
Caused by: java.io.FileNotFoundException: http://127.0.0.1:58762/ping
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
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:776)

//When I look this lines,I don't think Default proxy is [HTTP @ 10.8.8.103:81] but proxy in Library is //[127.0.0.1] ,my should modify Default proxy in library?

E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [HTTP @ 10.8.8.103:81]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [HTTP @ 10.8.8.103:81]. Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.shuyu.gsyvideoplayer.video.base.GSYVideoView.setUp(GSYVideoView.java:381)
at com.shuyu.gsyvideoplayer.video.base.GSYVideoControlView.setUp(GSYVideoControlView.java:524)
`
I hope you can answer my question,thanks.

@gongtingshisi
Copy link

thanks author's masterpiece . response error still occurs on my phone,even though it has "IgnoreHostProxySelector.install(PROXY_HOST, port);" in HttpProxyCacheServer constructor function.Anyone knows how to resolve it?thank you.

@Hackforid
Copy link

I saw this log when I connected to Wifi which has no Connection to Internet

AND
If I close both wifi and cell data, your proxy can not provider cached res.

@ycdm
Copy link

ycdm commented May 7, 2018

This problem still occurs even if wifi is connected

@mazzonem
Copy link

Reporting here, Still seeing this problem on 2.7.0.

@krishnapatel086
Copy link

i also

@carozhu
Copy link

carozhu commented Jul 23, 2018

me too

@eqenkhjin
Copy link

too too :)

@arashsammak
Copy link

me too

@github2013j
Copy link

+1

@rdonik
Copy link

rdonik commented Nov 21, 2019

In my case the issue is the target version you have chosen for your android application. if it's android 9.0 or higher it will not work with legacy applications.

I simply resolved it by adding
<uses-library android:name="org.apache.http.legacy" android:required="false" />
under my <application> in AndroidManifest.xml

Because server try to make an http request instead of an https request.

this helps for me too, thanks)

@asvgithub01
Copy link

asvgithub01 commented Feb 7, 2020

hey! i had this issue in Api 29 lib version 2.7.1. The problemis the http protocol in proxy settings, this will be https for new versions of android.
I fix it add new xml file for networkconfig:
<network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">127.0.0.1</domain> </domain-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config >

and add this configuration to application node
<application android:networkSecurityConfig="@xml/network_config" ...

sorry by my poor english, enjoy! and thanks so much for library ;)

@runchen0518
Copy link

runchen0518 commented Apr 8, 2020

i have tried three solutions, but no one worked.
1.add android:usesCleartextTraffic="true" into AndroidManifest.xml application;
2.add android:networkSecurityConfig="@xml/network_security_config" into AndroidManifest.xml application;
3.add <uses-library android:name="org.apache.http.legacy" android:required="false" /> into AndroidManifest.xml application;

@runchen0518
Copy link

One case, when you start proxy server thread and never interrupt it, and then, if the proxy server count more than a uncertain threshold, it may cause occur ping server failed.
The correct way to do this is, when you get out of this proxy server, you need shutdown it.

@SnehaDZ
Copy link

SnehaDZ commented Sep 17, 2020

:_Error reading ping response: [ (Pinger.java:104)#PingServer ] com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:37213/ping with offset 0. Version: 2.7.1

@SnehaDZ
Copy link

SnehaDZ commented Sep 17, 2020

please help me getting above error

@anshajsharma
Copy link

2020-11-16 11:31:48.744 5837-5837/com.invid.user E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 2.7.1
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:185)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:122)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:103)
at com.invid.user.Fragments.PlayerFragment.getMediaSource(PlayerFragment.java:228)
at com.invid.user.Fragments.PlayerFragment.playNextVideo(PlayerFragment.java:188)
at com.invid.user.Fragments.PlayerFragment$3.onPlayerStateChanged(PlayerFragment.java:298)
at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.lambda$run$4$ExoPlayerImpl$PlaybackInfoUpdate(ExoPlayerImpl.java:843)
at com.google.android.exoplayer2.-$$Lambda$ExoPlayerImpl$PlaybackInfoUpdate$sJrY7lA_vUJy5MdfV-ndTSxVTXI.invokeListener(Unknown Source:2)
at com.google.android.exoplayer2.BasePlayer$ListenerHolder.invoke(BasePlayer.java:172)
at com.google.android.exoplayer2.ExoPlayerImpl.invokeAll(ExoPlayerImpl.java:860)
at com.google.android.exoplayer2.ExoPlayerImpl.access$000(ExoPlayerImpl.java:43)
at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.run(ExoPlayerImpl.java:841)
at com.google.android.exoplayer2.ExoPlayerImpl.notifyListeners(ExoPlayerImpl.java:754)
at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:728)
at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:673)
at com.google.android.exoplayer2.ExoPlayerImpl.handleEvent(ExoPlayerImpl.java:623)
at com.google.android.exoplayer2.ExoPlayerImpl$1.handleMessage(ExoPlayerImpl.java:127)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

@MarotiKathoke
Copy link

i have tried all solutions, but no one worked.

kula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:34413/ping with offset 0. Version: 2.7.1
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:85)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:480)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:429)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:560)
at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:171)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:78)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) 
at com.danikula.videocache.Pinger.access$100(Pinger.java:33) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 

@echojiangyq
Copy link

i have tried three solutions, but no one worked.
1.add android:usesCleartextTraffic="true" into AndroidManifest.xml application;
2.add android:networkSecurityConfig="@xml/network_security_config" into AndroidManifest.xml application;
3.add <uses-library android:name="org.apache.http.legacy" android:required="false" /> into AndroidManifest.xml application;

it worked for me, thank you.

@Dullyoung
Copy link

我同样遇到了这个问题,使用viewpager2+fragment ,在fragment中展示Jzvd player。

E/MediaMetadataRetrieverJNI: getFrameAtTime: videoFrame is a NULL pointer E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT] pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]. Version: 2.7.1

@docwei2050
Copy link

E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT@]
                                                             com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT@]. Version: 2.7.0
                                                                 at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                                 ...

after many days of frustration I managed to find something: NanoHttpd/nanohttpd#270 (comment),
as MrStanaland said, Mint is causing this, at least in my case, now it works for me 👍

Mint.disableNetworkMonitoring();
Mint.initAndStartSession(context, BuildConfig.MINT);

who is MrStanaland?

@seazon
Copy link

seazon commented Mar 2, 2021

Same with @nuborisar, and the solution works for the following case:

Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted

Check your android:networkSecurityConfig file, and add

<domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>

@byron-xie
Copy link

runOnUiThread(Runnable {
this.netPath = netPath
// var videoUrl = Const.PicBaseUrlConst.VID_BASE_URL.plus(netPath)
var videoUrl = "http://122.51.230.43:8081/e98d5c1b754b2fcb7941232135504a46/wx_camera_1584678750453.mp4"
Log.e("JavascriptInterface", "videoUrl:" + videoUrl)

videoplayer.setUp(videoUrl,"dsa", Jzvd.SCREEN_NORMAL)//videoplayer
Glide.with(videoplayer).load(videoUrl).into(videoplayer.posterImageView)

Log.e("JavascriptInterface", "videoUrl:" + videoUrl)

// viewModel.uploadCover()
// viewModel.postVideoArticle(netPath,)
video_capture.visibility = View.GONE
})

}

@byron-xie
Copy link

Use runOnUiThread can fixed it

@ShenYu0812
Copy link

ShenYu0812 commented Apr 25, 2021

i have see this: when i use it:

  1. Android Studio & Platform:
Android Studio 4.1.1
Build #AI-201.8743.12.41.6953283, built on November 5, 2020
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.16
  1. Android build.gradle config:
  minSdkVersion 21
  targetSdkVersion 30

  kotlinOptions { jvmTarget = '1.8' }
  1. Phone: XIAOMI K30 (Android11, MIUI12)

  2. The way i use it:

// i had use "ktor" to make requests to local  proxy server.
CoroutineScope(Dispatchers.IO).launch {
  ...
  var client: HttpClient? = null
  try {
      ...
     client = HttpClient(OkHttp) ...
     val statement = client.get<HttpStatement>(httpProxyCacheServer.getProxyUrl(rawUrl)) // this is (PreloadStatement.kt:53)
     ...
  }
}
  1. other info:
    i had not implementation this library derectly but use third-party library:
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.1.3-jitpack'
  1. i've clone this project newest and compare with that:
    just some thing different:

截屏2021-04-25 下午6 18 06

  1. i try to exclude third-party lib and use this:
    implementation("com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:$GSY_PLAYER_VERSION") {
        exclude group: 'com.github.CarGuo.GSYVideoPlayer', module: 'gsyVideoPlayer-proxy_cache'
    }
    implementation "com.danikula:videocache:2.7.1"

but not working, and crash as if because not support https.

  1. error log:
2021-04-25 17:40:37.311 32413-32579/com.mycompany.demo W/HttpProxyCacheDebuger: Error pinging server (attempt: 2, timeout: 280). 
2021-04-25 17:40:37.311 32413-32574/com.mycompany.demo W/HttpProxyCacheDebuger: Error pinging server (attempt: 2, timeout: 280). 
2021-04-25 17:40:37.312 32413-32579/com.mycompany.demo E/HttpProxyCacheDebuger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]
2021-04-25 17:40:37.312 32413-32574/com.mycompany.demo E/HttpProxyCacheDebuger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]
2021-04-25 17:40:37.312 32413-32574/com.mycompany.demo W/System.err: com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]. Version: 8.1.2
2021-04-25 17:40:37.312 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.Pinger.ping(Pinger.java:71)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:184)
    
    [          1619343637.313 32413:32510 W/Failed to close socket on proxy side: {}. It seems client have already closed connectioshutdown failed: ENOTCONN (Transport endpoint is not connected)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:121)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:102)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.mycompany.demo.ui.video.manager.PreloadStatement$start$1.invokeSuspend(PreloadStatement.kt:53)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2021-04-25 17:40:37.313 32413-32579/com.mycompany.demo W/System.err: com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]. Version: 8.1.2
2021-04-25 17:40:37.313 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.Pinger.ping(Pinger.java:71)
2021-04-25 17:40:37.313 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:184)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:121)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:102)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at com.mycompany.demo.ui.video.manager.PreloadStatement$start$1.invokeSuspend(PreloadStatement.kt:53)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2021-04-25 17:40:37.316 32413-32510/com.mycompany.demo I/HttpProxyCacheDebuger: Opened connections: 7
2021-04-25 17:40:37.339 32413-32510/com.mycompany.demo E/HttpProxyCacheDebuger: ****** injectCustomHeaders ****** :0

@sushilLynhill
Copy link

E/HttpProxyCacheServer: HttpProxyCacheServer error
com.danikula.videocache.ProxyCacheException: Error during waiting connection. Version: 2.7.1
at com.danikula.videocache.HttpProxyCacheServer.waitForRequest(HttpProxyCacheServer.java:223)
at com.danikula.videocache.HttpProxyCacheServer.access$100(HttpProxyCacheServer.java:54)
at com.danikula.videocache.HttpProxyCacheServer$WaitRequestsRunnable.run(HttpProxyCacheServer.java:326)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.net.SocketException: Socket closed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:389)
at java.net.ServerSocket.implAccept(ServerSocket.java:531)
at java.net.ServerSocket.accept(ServerSocket.java:499)
at com.danikula.videocache.HttpProxyCacheServer.waitForRequest(HttpProxyCacheServer.java:218)
at com.danikula.videocache.HttpProxyCacheServer.access$100(HttpProxyCacheServer.java:54) 
at com.danikula.videocache.HttpProxyCacheServer$WaitRequestsRunnable.run(HttpProxyCacheServer.java:326) 
at java.lang.Thread.run(Thread.java:761) 

@wirteEable
Copy link

2022-03-09 09:16:55.536 10193-10193/com.yihua.hugou W/System.err: com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 7.1.5
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.Pinger.ping(Pinger.java:71)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:181)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:118)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:99)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.cache.ProxyCacheManager.doCacheLogic(ProxyCacheManager.java:75)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at tv.danmaku.ijk.media.exo2.Exo2PlayerManager.initVideoPlayer(Exo2PlayerManager.java:62)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.GSYVideoBaseManager.initVideo(GSYVideoBaseManager.java:612)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.GSYVideoBaseManager.access$000(GSYVideoBaseManager.java:38)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.GSYVideoBaseManager$MediaHandler.handleMessage(GSYVideoBaseManager.java:572)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at android.os.Handler.dispatchMessage(Handler.java:110)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at android.os.Looper.loop(Looper.java:219)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at android.app.ActivityThread.main(ActivityThread.java:8668)
2022-03-09 09:16:55.539 10193-10193/com.yihua.hugou W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2022-03-09 09:16:55.539 10193-10193/com.yihua.hugou W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
2022-03-09 09:16:55.539 10193-10193/com.yihua.hugou W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)

@aungbophyoe
Copy link

2022-06-30 12:42:34.686 27076-27767/myapp.debug E/Pinger: Error reading ping response
com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:37983/ping with offset 0. Version: 2.7.1
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:85)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:171)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:78)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) 
at com.danikula.videocache.Pinger.access$100(Pinger.java:33) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 
2022-06-30 12:42:34.688 27076-27398/myapp.debug E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 2.7.1
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:185)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:122)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:103)

@Mishgan
Copy link

Mishgan commented Feb 17, 2023

E Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 2.7.1
at com.danikula.videocache.Pinger.ping(Unknown Source:135)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(Unknown Source:5)
at com.danikula.videocache.HttpProxyCacheServer.(Unknown Source:101)
at com.danikula.videocache.HttpProxyCacheServer.(Unknown Source:0)
at com.danikula.videocache.HttpProxyCacheServer$Builder.build(Unknown Source:7)

@sansan-cc
Copy link

我同样遇到了这个问题,使用viewpager2+fragment ,在fragment中展示Jzvd player。

E/MediaMetadataRetrieverJNI: getFrameAtTime: videoFrame is a NULL pointer E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT] pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]. Version: 2.7.1

有找到解决办法么,我和你使用场景一样

@sansan-cc
Copy link

Is there a solution?

@tahakorkem
Copy link

2022-06-30 12:42:34.686 27076-27767/myapp.debug E/Pinger: Error reading ping response com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:37983/ping with offset 0. Version: 2.7.1 at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:85) at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) at com.danikula.videocache.Pinger.access$100(Pinger.java:33) at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542) at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:171) at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:78) at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)  at com.danikula.videocache.Pinger.access$100(Pinger.java:33)  at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)  at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:919)  2022-06-30 12:42:34.688 27076-27398/myapp.debug E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT] com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 2.7.1 at com.danikula.videocache.Pinger.ping(Pinger.java:73) at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:185) at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:122) at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:103)

Adding networkSecurityConfig to manifest has solved this problem for me. See here: https://stackoverflow.com/a/54268640/4191562

@chands
Copy link

chands commented Mar 3, 2024

Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 2.7.1
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:185)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:122)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:103)

@chands
Copy link

chands commented Mar 3, 2024

Finally following solution worked for me :)
add following in a xml file network_security_config inside res/xml dir
<network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">127.0.0.1</domain> </domain-config> <base-config cleartextTrafficPermitted="false"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config>

add following lines in Manifest.xml file inside application tag and outside activity
android:networkSecurityConfig="@xml/network_security_config"

moulie415 added a commit to moulie415/react-native-video-cache that referenced this issue Apr 30, 2024
The default android manifest for react native does not include android:usesCleartextTraffic="true" so its worth mentioning that it needs to be added for the module to actually work properly in production other wise you will get this error danikula/AndroidVideoCache#134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests