Play 2.6 EntityStreamSizeException exception - scala

In my application I need to upload quite large files (up to 4GB). I do it using file form field and save the file to temporary location for further processing. However when it comes to files that exceed the content-size limit I get an EntityStreamException:
play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[EntityStreamSizeException: EntityStreamSizeException: actual entity size (Some(781434380)) exceeded content length limit (8388608 bytes)! You can configure this by setting `akka.http.[server|client].parsing.max-content-length` or calling `HttpEntity.withSizeLimit` before materializing the dataBytes stream.]]
I've tried to set both akka.*.[client|server] limits in my application.conf as follows:
akka.http.server.parsing.max-content-length = 4096MB
akka.http.client.parsing.max-content-length = 4096MB
but it still crashes with the same message.
I've also tried to follow the documentation and set play's settings:
play.http.parser.maxMemoryBuffer=512k
play.http.parser.maxDiskBuffer=4096MB
as it is proposed here:
https://www.playframework.com/documentation/2.6.x/ScalaBodyParsers
The last thing I've tried was to explicitly override the setting in my post handler:
def doCreate = checkToken {
Action(parse.maxLength(400000000, parse.multipartFormData)) { implicit request =>
...
}
Nothing seems to work. Can anybody tell me what I'm doing wrong?
Upd: After lurking in play/akka code and some debugging I can see that any akka related settings just being completely ignored. I see that play.http.parser setting is propagated to context and is used, however any akka setting is not applied and maxContentLength remains set to default value of 8MB. But according to this document: https://www.playframework.com/documentation/2.6.x/SettingsAkkaHttp
they should be applied. Not sure what to do next. Any help will be really appreciated.

I've found a related pull request: https://github.com/playframework/playframework/pull/7548
So, as I understand, this setting should not work. The message in the exception is misleading.
UPD: https://blog.playframework.com/play-2-6-1-released/ here in change notes this merge request is present. After updating to Play 2.6.1 I can see that akka max-content-limit is set to infinite so only play settings counts.

Related

I’m getting below error while I try to execute a workflow on Powercenter

Transformation Parse Warning [<<P M Parse Warning>> <<Invalid constant sun-expression>> <<Expression Error>> [TO_DATE]:invalid string for converting to Date
… t:TO_DATE(s:s:”,s:s:’YYYYMMDD’)
……….
AND SATIS_TARIHI = >>>> TO_DATE($$RUN_DATE,’YYYYMMDD’)<<<<];
How can I solve this?
This is the first time I encounter this error. Normally, this is a daily routine for our job. The parameter is successfully added to the mapping and all the other things seem okay. I’d appreciate your help.
I tried to start the workflow and got this error.
You need to define a $$RUN_DATE in mapping. Currently its not defined in mapping or its null in parameter file.
You need to set a default value in mapping like 20221221 for today.
Or else you can set it up in a parameter file like this
[folder.workflow_name]
[folder.session_name]
$$RUN_DATE=20221221
Considering this is your daily routine and up till now it has been working fine, I assume this is not a new development and no recent changes have been made. Apparantly PowerCenter got an invalid value for the parameter.
Check you parameter file and how it gets generated.
Was the process of generating paramfile executed without issues?
Was there enough storage space?
Can you verify the paramfile contents?
Can you regenerate it?
Can you modify it and provide some value manually?
Feel free to get back with some updates for more help if your problem won't get resolved by checking the items on the list above.

Is "health.config.enabled" still being processed, and where?

Is the property "health.config.enabled" still valid and being processed in current Spring Cloud?
If yes, where in the code it is being done?
The property is in the current official documentation and has worked well for me so far (in cloud clients).
But as a whole string, it cannot be found anywhere in the current source code (besides the doc source).
For me as a beginner, it was easy to find in the old version of ConfigClientAutoConfiguration.java
Recent version of ConfigClientAutoConfiguration.java does not contain that whole property name, although I guess it's still being processed but in a more abstract way that I don't understand yet. Thus I'd appreciate even a hint in the form of "what used to be done on line "#ConditionalOnProperty(value = "health.config.enabled", matchIfMissing = true)" before is now roughly done on line XY".
Thanks.
It is replaced by #ConditionalOnEnabledHealthIndicator("config") (see here).
From the javadoc for that annotation
Blockquote
#Conditional that checks whether a default health indicator is enabled. Matches if the value of the management.health.<name>.enabled
So the new property is management.health.config.enabled

Gatling session variable gets overwritten for multiple users. How to fix this?

So i am an absolute newbie to gatling and the documentation on their site is pretty meh. My scenario is that i have different users which execute one scenario each and during these scenarios they make requests and save the answer in a session variable which they need as a parameter for a following request during the same scenario. My problem is that i have multiple users running at the same time and these overwrite the session variable so that a user which started earlier refers to the wrong value in the session variable. my idea was to set up a global counter which increments as soon as a new user is initialized and starts with his scenario and to append this counter to the session variable. is this possible and if so how do i do it? i bet there is a way better way to fix this behaviour but as i said i have zero experience with gatling and how its working.
my users look like this
user("singleUpload")
.behavior {
feed(applicationCredentials)
.exec(USingleUpload.singleUpload)
the scenarios like this
val singleUpload = exec(RUpload.post)
.exec(RShare.get)
.exec(RDownload.get)
.doIfEquals("${attachmentSingleUpload}", "attachment.jpg") {
exec(RThumbnailDownload.get)
}
.doIfEquals("${attachmentSingleUpload}", "attachment.png") {
exec(RThumbnailDownload.get)
}
.exec(RDelete.delete)
and the request like this:
val attachment = ("attachment", "${attachmentSingleUpload}")
val post = http("RUpload")
.post("/attachment/upload/")
.queryParam("share", "true")
.formUpload("attachment", s"attachments/${attachment._2}")
.header("x-api-key", "${apiKey}")
.header("x-app-id", "${appId}")
.check(status.is(200))
.check(jsonPath("$..pkey").exists.saveAs("pkey"))
val get = http("RShare")
.get("/attachment/share")
.queryParam("pkey", "${pkey}")
.header("x-api-key", "${apiKey}")
.header("x-app-id", "${appId}")
.check(status.is(200))
.check(jsonPath("$..skey").exists.saveAs("skey"))
for example: i make an upload and save the pkey which i then use in the request to get an skey. if user #2 is fast enough with his upload to overwritter the pkey variable in the session then user #1 uses a wrong pkey in his request.
user("singleUpload")
.behavior {
There's neither user nor behavior methods in Gatling's API. If you really have this in your code, these are private customizations. Can't say what they do or if they're correct.
My problem is that i have multiple users running at the same time and these overwrite the session variable so that a user which started earlier refers to the wrong value in the session variable.
if user #2 is fast enough with his upload to overwritter the pkey variable in the session then user #1 uses a wrong pkey in his request.
This is absolutely impossible. Each virtual user has its own Session, isolated from the others'. You cannot store something in a given virtual user's Session and have another virtual user overwrite it. And there's absolutely zero chance of a bug in there.
I recommend that you reconsider how you came to this erroneous conclusion and investigate other possible explanations. This small piece you provided looks correct. Maybe you've simply uncovered a bug in your application and Gatling is just the messenger.
"the documentation on their site is pretty meh"
That's neither nice nor constructive. Maybe explaining what you think is lacking in the documentation? Have you gone through all of it? Have you checked the online courses?
Gatling sessions are isolated so overwritting is not really possible.
I am using saveAs in many simulations without any problems. The issue is somewhere else.

TTeeGrid is not displaying the data at runtime using data from REST

I created a simple RME for TTeeGrid, a descendant perhaps of TGrid in Firemonkey. As shown below, the data are displayed at design time but not at runtime except the headers.
I've been breaking my head over this for weeks already but not luck.
Let me know if you need more details but what you see in the image are all you get.
I just need help to have the data displayed at runtime as shown in the design time.
UPDATE 1
This issue is not the case with TPrototypeBindSource. The data shown in the design time are displayed at runtime. Something is wrong somewhere.
I've never used the TeeGrid before, but the following worked fine
first time for me in Delphi Tokyo:
Download the TeeGrid trial from Steema.Com & install.
Create new multi-device app and place a TeeGrid and a FDMemTable on the form.
Load FDMemTable1 with the file Parts.Fds from the Delphi samples Data directory. Note, I did not then create any FieldDefs as I mentioned in my comment earlier as what I'm describing works without them.
Set the DataSource property of TeeGrid1 to FDMemTable1. TeeGrid1 immediately
creates columns for each of the Parts fields and populates them with data - see
screenshot below. I don't ordinarily include screenshots but in this case thought
I would as what I got was so clearly at odds with what you've reported.
Your TeeGrid etc are obviously more complicated than mine. so the best I can
suggest is that you backtrack to step 2 and see if you can replicate my result
with your data (either at design time or run time). It might be worth loading
your FDMemTable with some data at design time, as my impression is that live bindings
is less grief-prone when the datasource has some data.
Incidentally, fwiw the results of my own attempts to set up live bindings even with a regular TGrid have been rather patchy, until I discovered that instead of messing with the LB components myself, simply starting with a fresh TGrid, right-clicking on it and leaving the Live Bindings Wizard
to do its stuff consistently works fine.

Xpath starting retuning None on Scrapy

I'm trying to crawl a site and to do so, I'm using Scrapy. So, when doing requests to nested pages, the procedure usually gets the the information correctly on the first trials, but, on later requests the nodes starts to return None. I'm using xpath's functionality. Below I'm pasting some lines of the parse function:
(I tried this one with the approach of explicitly comparing the class value)
title = response.xpath('//span[#class="inlineFree"]/text()').extract_first()
(With this one I used the contains function)
view = response.xpath('//span[contains(#class,"count")]/text()').extract_first()
(I've also used this one when I found more suitable)
comments = response.css('div.commentMessage > span::text').extract()
Am I doing something wrong on paths?
Is there any reason for the crawler to stop reading the nodes correctly?
Cannot say what the problem is without the log messages or the spider code but..
What happens most of the time is that websites fo not follow a strict html structure .For some properties the 'title' may be inside the span
but for the next iteration it may be
span[#class="inlineFree"]/h1/text() or or any other tag
so you should check the html for those returning None