Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? Yes
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? No
Please give a brief summary of your issue:
WebViewer Server requests all timeout after server has been online
Please describe your issue and provide steps to reproduce it:
I’ve deployed the WebViewer Server to Google Cloud Run, and upon initial boot up, the server works as expected. However, after an hour or so, all subsequent requests to load documents timeout (currently set to 5 minutes).
We also have uptime checks, which may be keeping the server alive during that time. Do you recommend purposely closing down instances to prevent this sort of error state from happening? What else would cause these sorts of timeouts?
Please provide a link to a minimal sample where the issue is reproducible:
Is using the load balancer required? I was under the impression that we can use pdftron/webviewer-server by itself.
Do you have any guides or samples you can provide of someone hosting webviewer server on a Cloud Run environment?
I’m not seeing any performance issues on the metrics/utilization side of things. In fact, the CPU and memory utilizations are often under 20%.
I found a more detailed description of the errors, in case it’s more illuminating:
2024-07-02 19:07:16.801 EDT
2024-07-02/23:07:16.802/UTC [pool-5-thread-1] INFO DocManagement - Kicking off potential fetch of http://0.0.0.0:8090/test/sample.pdf
2024-07-02 19:08:00.803 EDT
2024-07-02/23:08:00.803/UTC [pool-2-thread-2] INFO ServerConfig - lowQ - 0 - adding job
2024-07-02 19:08:00.803 EDT
2024-07-02/23:08:00.803/UTC [pool-6-thread-1] INFO CacheManager - Starting CacheManager with limit of 10000MB and max age of 30 minutes
2024-07-02 19:08:01.700 EDT
2024-07-02/23:08:01.701/UTC [pool-2-thread-1] INFO Monitor - STATUS - Free [3483MB] Total [4096MB] CPU [-100.000000%]
2024-07-02 19:08:01.700 EDT
2024-07-02/23:08:01.701/UTC [pool-2-thread-1] INFO Monitor - DISK - Free [9223372036GB] Total [9223372036GB]
2024-07-02 19:08:01.700 EDT
2024-07-02/23:08:01.701/UTC [pool-2-thread-1] INFO Monitor - JAVA MEMORY - Used [62MB] Max [42949MB]
2024-07-02 19:08:02.106 EDT
2024-07-02/23:08:02.107/UTC [pool-6-thread-1] INFO CacheManager - Skipping cleanup, cache size 14MB below limit of 10000MB
2024-07-02 19:08:02.106 EDT
2024-07-02/23:08:02.107/UTC [pool-6-thread-1] INFO CacheManager - Exited CacheManager
2024-07-02 19:08:32.704 EDT
2024-07-02/23:08:31.749/UTC [pool-5-thread-1] ERROR DocManagement - Fetch finished with errors:
2024-07-02 19:08:32.705 EDT
java.net.SocketTimeoutException: Read timed out at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2079) ~[?:?] at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2074) ~[?:?] at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?] at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:2073) ~[?:?] at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1631) ~[?:?] at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1611) ~[?:?] at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529) ~[?:?] at com.pdftron.server.DocManagement$DocFetchTask.getSingleFileImpl(DocManagement.java:368) ~[PDFTronSharedServer.jar:?] at com.pdftron.server.DocManagement$DocFetchTask.doFetch(DocManagement.java:484) [PDFTronSharedServer.jar:?] at com.pdftron.server.DocManagement$DocFetchTask.run(DocManagement.java:184) [PDFTronSharedServer.jar:?] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?] at java.base/java.lang.Thread.run(Thread.java:840) [?:?] Caused by: java.net.SocketTimeoutException: Read timed out at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:288) ~[?:?] at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:314) ~[?:?] at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:355) ~[?:?] at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:808) ~[?:?] at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966) ~[?:?] at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:244) ~[?:?] at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:284) ~[?:?] at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343) ~[?:?] at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:826) ~[?:?] at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:761) ~[?:?] at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1710) ~[?:?] at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1611) ~[?:?] at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529) ~[?:?] at com.pdftron.server.DocManagement$DocFetchTask.getSingleFileImpl(DocManagement.java:353) ~[PDFTronSharedServer.jar:?] ... 5 more
2024-07-02 19:08:32.705 EDT
2024-07-02/23:08:32.708/UTC [http-nio2-0.0.0.0-8090-exec-7] ERROR GetPDF - Failed to GetPDF:
2024-07-02 19:08:32.705 EDT
java.lang.Exception: unable to complete fetch of http://0.0.0.0:8090/test/sample.pdf
2024-07-02 19:08:32.705 EDT
Read timed out
2024-07-02 19:08:32.705 EDT
at com.pdftron.server.DocManagement$DocFetchTask.waitForConversion(DocManagement.java:159) ~[PDFTronSharedServer.jar:?]
2024-07-02 19:08:32.705 EDT
at com.pdftron.server.DocManagement.fetchAndConvert(DocManagement.java:521) ~[PDFTronSharedServer.jar:?]
2024-07-02 19:08:32.705 EDT
at com.pdftron.server.DocReference.fetchLocalBlocking(DocReference.java:497) ~[PDFTronSharedServer.jar:?]
Do you have any guides or samples you can provide of someone hosting webviewer server on a Cloud Run environment?
We have guides on AWS/Azure/DockerHub:
I’m not seeing any performance issues on the metrics/utilization side of things. In fact, the CPU and memory utilizations are often under 20%.
Looking at the server logs:
java.net.SocketTimeoutException: Read timed out
2024-07-02 19:08:32.705 EDT
2024-07-02/23:08:32.708/UTC [http-nio2-0.0.0.0-8090-exec-7] ERROR GetPDF - Failed to GetPDF:
2024-07-02 19:08:32.705 EDT
java.lang.Exception: unable to complete fetch of http://0.0.0.0:8090/test/sample.pdf
This can be caused by the server being unable to fetch a file. Wherever you were fetching from at the time may have been experiencing too much traffic or is slow for whatever reason, the default timeout is 20 seconds. This timeout is how long it takes the file server to respond with ‘yes we have this file’ before downloading it.