Stream: troubleshooting

Topic: JSF1095 jakarta.faces.FACELETS_BUFFER_SIZE


view this post on Zulip luddaniel (Jun 27 2024 at 15:51):

Hi there :)
We have a lot of PROD logs "JSF1095: The response was already committed by the time we tried to set the outgoing cookie for the flash. Any values stored to the flash will not be available on the next request."
We started by incrementing the related parameter
glassfish/domains/datainra/applications/dataverse-5.14/WEB-INF/classes/META-INF/microprofile-config.properties:69:dataverse.jsf.buffer-size=350000
which reduce the number of logs but do not fix it completely.
I looked a bit deeper and the documentation says : By default the value is 1024 A reasonable default such as "1024" should be specified
And dataverse default is way higher with 102400

<context-param>
        <param-name>jakarta.faces.FACELETS_BUFFER_SIZE</param-name>
        <!-- Uses Microprofile Config to replace at runtime. Not standardized, Payara App Server specific. -->
        <param-value>${MPCONFIG=dataverse.jsf.buffer-size:102400}</param-value>
    </context-param>

I start to think that increasing it to more than 350000 is not the way to go. I would like your view on this :)
@Oliver Bertuch

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:52):

Can you give a little more log output for those? There should be a line indicating where this happens

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:53):

Also the way you set these numbers is very weird with editing the deployed file. I suggest you use a system property or other, easier MPCONFIG methods to get that number in

view this post on Zulip luddaniel (Jun 27 2024 at 15:54):

[2024-06-27T17:12:25.789+0200] [Payara 5.2022.4] [WARNING] [jsf.externalcontext.flash.response.already.committed] [javax.enterprise.resource.webcontainer.jsf.flash] [tid: _ThreadID=15325 _ThreadName=http-thread-pool::jk-connector(227)] [timeMillis: 1719501145789] [levelValue: 900] [[
  JSF1095: The response was already committed by the time we tried to set the outgoing cookie for the flash.  Any values stored to the flash will not be available on the next request.]]

view this post on Zulip luddaniel (Jun 27 2024 at 15:55):

I don't really see a relation with a page or action in logs

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:56):

Oh you're still on an older release of Dataverse... May I suggest you upgrade to v6.x first? We changed to Jakarta EE 10 and Jakarta Faces / Mojarra received a major overhaul. Also, any upstream issues will ask for recent tech anyway.

view this post on Zulip luddaniel (Jun 27 2024 at 15:57):

This is what I do, I have a microprofile-config.properties with dataverse.jsf.buffer-size=350000
Or I misunderstood

view this post on Zulip luddaniel (Jun 27 2024 at 15:57):

I have this issue on v6.0 also (currenly in upgrade process)

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:57):

You should not edit that file. It is solely used to ship defaults with the application.

view this post on Zulip luddaniel (Jun 27 2024 at 15:58):

Are you saying that we can specify a path for our microprofile-config.properties ?

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:58):

No

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:58):

None of that

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:58):

Also, web.xml is too early in the deployment lifecycle

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 15:59):

I very much doubt adding this option to the microprofile-config.properties file changes the value. It will probably still be on the default setting

view this post on Zulip luddaniel (Jun 27 2024 at 16:00):

That is what documentation suggest no ? https://guides.dataverse.org/en/5.14/developers/debugging.html

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:01):

It does not suggest you edit that file :wink:

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:01):

Some JSF options can be easily changed via MicroProfile Config (using environment variables, system properties, etc.)

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:02):

If you are on a classic installation, I highly recommend using a system property

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:02):

If you're using containers, an env var is usually simpler

view this post on Zulip Notification Bot (Jun 27 2024 at 16:03):

This topic was moved here from #dev > JSF1095 jakarta.faces.FACELETS_BUFFER_SIZE by Oliver Bertuch.

view this post on Zulip luddaniel (Jun 27 2024 at 16:03):

Hum, we understood that it was recommended to start using MP so we did by modifying glassfish/domains/datainra/applications/dataverse-5.14/WEB-INF/classes/META-INF/microprofile-config.properties and as it is a MP Key we thought it would work ^^

view this post on Zulip Notification Bot (Jun 27 2024 at 16:03):

A message was moved here from #dev > JSF1095 jakarta.faces.FACELETS_BUFFER_SIZE by Oliver Bertuch.

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:04):

This has never been officially recommended or been mentioned in the guides. IIRC this goes back to a misunderstanding of a few dataverse-docker users.

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:05):

What you are doing there is editing the deployment files. A new deployment of a new WAR would potentially overwrite it. It's not meant to be an admin editable file.

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:05):

We should probably include a big fat warning that this file is not meant to abused in this way

view this post on Zulip luddaniel (Jun 27 2024 at 16:05):

Hum, I think we needed something that is was only on MP Key while upgrading to v5.14...

view this post on Zulip luddaniel (Jun 27 2024 at 16:05):

Oliver Bertuch said:

What you are doing there is editing the deployment files. A new deployment of a new WAR would potentially overwrite it. It's not meant to be an admin editable file.

you are right!

view this post on Zulip luddaniel (Jun 27 2024 at 16:07):

this can be an issue while deploying, you are right

view this post on Zulip luddaniel (Jun 27 2024 at 16:07):

We will work on this.

view this post on Zulip luddaniel (Jun 27 2024 at 16:07):

Anyhow, what do you think about this buffer size ?:)

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:08):

Well so far you didn't actually enlarge it beyond the default of 102400 bytes...

view this post on Zulip luddaniel (Jun 27 2024 at 16:08):

ah!

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:08):

From what I find about this error on SO etc, increasing the buffer helped

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:08):

So I suggest you try increasing it again, but with a system property or other valid MPCONFIG source

view this post on Zulip luddaniel (Jun 27 2024 at 16:09):

Okay :)

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:09):

I wouldn't jump to the 350000 in one go, maybe double it first and then go smaller until it resurfaces

view this post on Zulip luddaniel (Jun 27 2024 at 16:09):

I'll update the topic when tested.

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:10):

This one here is particularly interesting: https://stackoverflow.com/a/45284797

view this post on Zulip luddaniel (Jun 27 2024 at 16:10):

Don't you think 102400 is so far from the default 1024 ?

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:10):

The size is given in bytes and should be larger than your biggest page

I'm not sure we ever had another look at that... :see_no_evil:

view this post on Zulip luddaniel (Jun 27 2024 at 16:11):

our biggest html page fastly found was around that 350000

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:12):

Interesting!

view this post on Zulip luddaniel (Jun 27 2024 at 16:12):

I crawled the same SO as you :D

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:12):

I see that the default we provide has been around for quite some time. https://github.com/IQSS/dataverse/commit/5f99037e5df918cf5f653c61971b5a701d690e58

view this post on Zulip luddaniel (Jun 27 2024 at 16:13):

v4.17 damn I was not working with Dataverse at this time XD

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:13):

I'd be cautious with that number though - is fastly only counting the HTML or also JS and images?

view this post on Zulip luddaniel (Jun 27 2024 at 16:14):

html response which contains some JS/CSS (settings of Dataverse like footer/GA/custom CSS..)

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:15):

And that HTML is 341 KiB? Fat chance! Did fastly say which page that is?

view this post on Zulip luddaniel (Jun 27 2024 at 16:16):

I'll check fastly XD

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:17):

I mean that probably is like 175k characters (assuming all chars are UTF-8 2byte encoding). That's ~88 DIN A4 pages of text.

view this post on Zulip luddaniel (Jun 27 2024 at 16:18):

wget https://entrepot.recherche.data.gouv.fr/dataset.xhtml?persistentId=doi:10.57745/1G5UQP -O dataset.html
--2024-06-27 18:17:34--  https://entrepot.recherche.data.gouv.fr/dataset.xhtml?persistentId=doi:10.57745/1G5UQP
Resolving entrepot.recherche.data.gouv.fr (entrepot.recherche.data.gouv.fr)... 147.100.174.24
Connecting to entrepot.recherche.data.gouv.fr (entrepot.recherche.data.gouv.fr)|147.100.174.24|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘dataset.html’

dataset.html                                           [ <=>                                                                                                            ] 176,58K  --.-KB/s    in 0,1s

2024-06-27 18:17:35 (1,42 MB/s) - ‘dataset.html’ saved [180817]

view this post on Zulip luddaniel (Jun 27 2024 at 16:18):

180k with a random dataset

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:19):

OK the pure HTML is ~180 KiB

view this post on Zulip luddaniel (Jun 27 2024 at 16:20):

wget https://entrepot.recherche.data.gouv.fr/dataset.xhtml?persistentId=doi:10.57745/SSA1VM -O dataset.html
‘dataset.html’ saved [249153]

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:21):

image.png

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:22):

I see that there are tons of Javascript etc embedded

view this post on Zulip luddaniel (Jun 27 2024 at 16:22):

Yes but this is default Dataverse settings

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:22):

This will obviously all go away with the new SPA

view this post on Zulip luddaniel (Jun 27 2024 at 16:22):

yes

view this post on Zulip luddaniel (Jun 27 2024 at 16:22):

Maybe I should sniff our reposity ^^

view this post on Zulip luddaniel (Jun 27 2024 at 16:23):

SPA is far away from our production XD

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:23):

Really just the defaults? No viewers / vocab stuff going on?

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:24):

The Matomo tracking is already huge

view this post on Zulip luddaniel (Jun 27 2024 at 16:24):

I'm thinking about :

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:25):

It probably would be a good idea to make the CSS and Javascript embedding stuff go away

view this post on Zulip luddaniel (Jun 27 2024 at 16:25):

:CVocConf is not enabled yet...

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:26):

All of this does a huge number on the performance, as it needs to be sent everytime, while it can be cached as separate files

view this post on Zulip luddaniel (Jun 27 2024 at 16:26):

100% agree

view this post on Zulip luddaniel (Jun 27 2024 at 16:26):

it should be as CDN ressources

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:27):

That wouldn't even be necessary

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:27):

Just make it separated things

view this post on Zulip luddaniel (Jun 27 2024 at 16:27):

"as"

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:27):

That way the JSF buffer wouldn't need to be so huge

view this post on Zulip luddaniel (Jun 27 2024 at 16:27):

yes, just static apache is enough

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:27):

All of that processing is crazy

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:28):

You could even just let Payara hand it out

view this post on Zulip luddaniel (Jun 27 2024 at 16:28):

yeah

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:28):

If you want, feel free to create an issue. A PR would probably be welcome. As you say - the SPA is still a long way to go.

view this post on Zulip luddaniel (Jun 27 2024 at 16:29):

I don't know if it's easy to move, but it would also increase the page speed

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:29):

It shouldn't be too hard to implement

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:29):

But someone has to sit down and do it :see_no_evil:

view this post on Zulip luddaniel (Jun 27 2024 at 16:30):

maybe just using :FooterCustomizationFile to call the required linked ressources could be an idea

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:30):

BTW all of this script and style stuff is also very bad for SEO

view this post on Zulip luddaniel (Jun 27 2024 at 16:30):

I know :)

view this post on Zulip luddaniel (Jun 27 2024 at 16:31):

this is why I mentionned CDN

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:32):

Yeah. Still not necessary / easy to achieve once all of this stuff goes into separate files and you include those. Where those files are isn't that important...

view this post on Zulip luddaniel (Jun 27 2024 at 16:33):

footer is better for page speed

view this post on Zulip luddaniel (Jun 27 2024 at 16:33):

still need to be tested

view this post on Zulip luddaniel (Jun 27 2024 at 16:34):

G2G, I'll update after tests ;) thanks @Oliver Bertuch for your time

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:34):

The whole customization stuff should be refactored to enable inclusion of <link> and <script> elements

view this post on Zulip luddaniel (Jun 27 2024 at 16:35):

Yes.

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:35):

And then enable serving content as files (so the existing properties are still usable in a backward compatible way)

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:35):

That way you can actually start to serve the static content from some place else, or, if you don't want/need that kind of advanced setup, go for the all in one

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:36):

Again, feel free to help with creating descriptive issues and solving PRs :smiley:

view this post on Zulip Oliver Bertuch (Jun 27 2024 at 16:36):

C U :wave:

view this post on Zulip luddaniel (Jun 27 2024 at 16:36):

See you

view this post on Zulip luddaniel (Jun 27 2024 at 16:37):

Oliver Bertuch said:

Again, feel free to help with creating descriptive issues and solving PRs :smiley:

ofc


Last updated: Oct 30 2025 at 06:21 UTC