Limit size of the REST request (GET) - actframework

I use Act.Framework for long requests, but I've noticed that the (JSON) response is truncated.
Is there any limit in the response size?
Ahmed

ActFramework does not limit response size. If you keep getting the error, please fire a bug to https://github.com/actframework/actframework with the following information:
version of actframework
java version
operations sytem
hardware info, CPU, RAM
is your app running in DEV mode or PROD mode
Better come up with a sample project that can reproduce the issue

Related

How to stop http request from dash_renderer

I am trying a build a realtime monitoring system for high frequency data. To increase the performance, I used the extendData property of dcc.Graph() and websocket. So that, the brouser does not need to send request to get data.
I found that it still not increasing the performance as expected. The reason I found is, from the browser, I see (by inspecting network from browser) after some miliseconds browser is still sendng request and the initiator is the dash_renderer.
This picture is for a vanilla example just to show even for a textbox example the http request goes on and on. And for my real time websocket dashboard the frequency of requests get very high.
My question is:
What dash_renderer do?
why it is sending http request?
And how to stop that?
If you run Dash in Debug mode, it has a feature called Hot Reloading which regularly (every 3 seconds by default) checks for changes to your codebase and updates your running app if it finds any. That check for updated code is what you're seeing in the network inspection.
To turn it off, either don't run in debug mode or explicitly set dev_tools_hot_reload to False like so:
app.run_server(debug=True, dev_tools_hot_reload=False)
Although it is late, After some experience, my realization is dash is not designed to work with websocket. It uses call-backs which actually sends requests to server and in server, the callback function (which is python) send back some result.
These call-backs are designed to send HTTP request to server.
For high speed data, the websocket should be used with extendTrace method of plotly.js in client side.

Couchbase Java SDK times out with BUCKET_NOT_AVAILABLE

I am doing a lookup operation Couchbase Java SDK 3.0.9 which looks like this:
// Set up
bucket = cluster.bucket("my_bucket")
collection = bucket.defaultCollection()
// Look up operation
val specs = listOf(LookupInSpecStandard.get("hash"))
collection.lookupIn(id, specs)
The error I get is BUCKET_NOT_AVAILABLE. Here are is the full message:
com.couchbase.client.core.error.UnambiguousTimeoutException: SubdocGetRequest, Reason: TIMEOUT {"cancelled":true,"completed":true,"coreId":"0xdb7f8e4800000003","idempotent":true,"reason":"TIMEOUT","requestId":608806,"requestType":"SubdocGetRequest","retried":39,"retryReasons":["BUCKET_NOT_AVAILABLE"],"service":{"bucket":"export","collection":"_default","documentId":"export:main","opaque":"0xcfefb","scope":"_default","type":"kv"},"timeoutMs":15000,"timings":{"totalMicros":15008977}}
The strange part is that this code hasn't been touched for months and the lookup broke out of a sudden. The CB cluster is working fine. Its version is
Enterprise Edition 6.5.1 build 6299.
Do you have any ideas what might have gone wrong?
Note that in Couchbase Java SDK 3.x, the Cluster::bucket method returns instantly, and continues opening a bucket in the background. So the first operation you perform - a lookupIn here - needs to wait for that resource opening to complete before it can proceed. It looks like it took a little longer to access the Couchbase bucket than usual and you got a timeout.
I recommend using the Bucket::waitUntilReady method after opening a bucket, to block until the resource opening is complete:
bucket = cluster.bucket("my_bucket")
bucket.waitUntilReady(Duration.ofMinutes(1));
This problem can occur because of firewall. You need to allow these ports.
Client-to-node
Unencrypted: 8091-8097, 9140 [3], 11210
Encrypted: 11207, 18091-18095, 18096, 18097
You can check more from below
https://docs.couchbase.com/server/current/install/install-ports.html#_footnotedef_2

Spring RestTemplate with JDK11 errors Posting data above certain limit

I am using OAuth2RestTemplate with JDK11 to make a POST request with Json data (860 lines and 26 KB). Strangely the code works fine with < 700 Json lines (or 20 KB) on production server and with < 500 lines (15 KB) on local machine. But as soon I increase few more data blocks in the JSON it start giving exception.
Exception is based on the HttpRequestFactory implementation used with RestTemplate.
In case I use HttpComponentsClientHttpRequestFactory then it is NoHttpResponseException XXX.XXX:443 failed to respond and if I use SimpleClientHttpRequestFactory then java.net.SocketException Unexpected end of file from server
restTemplate.postForEntity(Url, dataBytes, byte[].class);
Strangely this works with lower versions of JDK 8, 9 and 10. Also I have tried other Http client like Spring Webclient with JDK11 and same data works with it. Apart from that same data also works with Curl/Postman.
But not able to identify why it is creating issue with RestTemplate beyond certain data limit.
Below are some of the main dependencies I am using (Dependency wise can't change much in existing project).
Spring-core 5.1.6.RELEASE
org.apache.httpcomponents.httpclient 4.5.6
spring-security-core 5.1.4.RELEASE
spring-security-oauth2-client 5.1.4.RELEASE
JDK11
Any help or idea will be much appreciated. TIA
I have had the same issue with the following JDK11 versions:
IMPLEMENTOR="AdoptOpenJDK"
IMPLEMENTOR_VERSION="AdoptOpenJDK"
JAVA_VERSION="11.0.2"
IMPLEMENTOR="AdoptOpenJDK"
IMPLEMENTOR_VERSION="AdoptOpenJDK"
JAVA_VERSION="11.0.4"
but the issue no longer appears in 11.0.9.11. I have not yet found what the fix was

JS error on Chrome (with Device Toolbar enable)

When I turn on the tablet mode or the phone mode in Chrome, I get a javascript error :
Uncaught TypeError: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite.
at HTMLHtmlElement.avp.disableTouchSafari (viewer3D.min.js:18)
I've just update Chrome to the last version.
Any idea?
This might an issue of Forge Viewer. Apologizing for any inconvenience caused.
I have logged a request LMV-3401 [Autodesk.Viewing.Private.disableTouchSafari() reports error while viewing model with Chrome DevTools' Device Mode in macOS] to our development team to allocate time to investigate. As it requires further exploration and possibly a modification to our Viewer, please make a note of this number for future reference.
You are welcome to request an update on the status of this request or to provide additional information on it at any time quoting this request number via forge.help#autodesk.com.
However, I think this error didn't affect main features of Viewer. At the meanwhile, I think a real mobile device will help you in this case since this error didn't show up while testing on my Ipad.
Cheers,

Is Windows.Media.Ocr API available on Windows IoT Core with RaspberryPi 2?

I checked out many places for the answer but couldn't get one. According to this page the API should be available. But, when I run the codes on RaspberryPi 2, I get Unhandled Exception Error. To ensure that my codes are correct I ran the codes on my local machine, it runs perfectly fine.
Windows.Media.Ocr is universal API, so it is available.
With RaspberryPy there are no any language resources installed on device.
On such device, if you try code like following, ocrEngine will be null.
var ocrEngine = OcrEngine.TryCreateFromLanguage(new Language("en"));
You can check for available language recognizers with OcrEngine.AvailableRecognizerLanguages property.