[MAGNOLIA-7890] Exporting content larger approx. 5mb causes the server to restart Created: 30/Sep/20  Updated: 08/Jan/21  Resolved: 20/Oct/20

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 6.2.3
Fix Version/s: 6.2.4

Type: Bug Priority: Critical
Reporter: Tom Wespi Assignee: Federico Grilli
Resolution: Workaround exists Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image (2).png    
Issue Links:
Problem/Incident
is caused by MAGNOLIA-7702 Export of large files fails on Java 1... Closed
Relates
relates to MAGNOLIA-7326 Improve import & export functions to ... Closed
documentation
to be documented by DOCU-2061 Document failure when exporting large... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Migrate apps to new UI framework
Sprint: Maintenance 29
Story Points: 5

 Description   

To reproduce:

Go to: https://demoauthor.magnolia-cms.com/.magnolia/admincentral#app:dam:jcrBrowser;/travel-demo::
and export travel-demo.

Export will not start and the connection to the server will be lost after some time.

Dev notes:

  • Same happens when exporting through JCR Tools / Exporter on our public demo
  • Export is not broken in general. Exporting small files is still possible. In the test env with 4gb ram, java 13, tomcat 9 exporting 2 png with each 3mb is not possible, 5 jpgs with each 200kb is possible
  • Tested H2 and MySQL database underlying, same result, no export but connection lost to server.
  • Same behaviour with Tomcat 8.5.58

The problem may be here:

info.magnolia.ui.contentapp.action.CommandAction#executeSynchronously

This takes a long time to execute.



 Comments   
Comment by Tom Wespi [ 01/Oct/20 ]

I can reproduce this behaviour on my local installation with Oracle Java 13 and 2GB RAM assigned. Also tested with H2 and MySQL database underlying, same result, no export but connection lost to server.

Comment by Federico Grilli [ 15/Oct/20 ]

I think I have a lead: with JDK8 I have no issues, whereas switching to JDK11 (Magnolia public demo runs on it) considerably slows down the export operation. It still succeeds locally but I guess it's just by sheer luck and could easily end in a lost connection to the server.
Still need to investigate why this is the case.

Comment by Christoph Damm [ 19/Oct/20 ]

Hi,
experienced the same and can confirm Fredericos direction (well somehow at least)
Locally tomcat9 with JDK11 I can not export (in my case tested the dam app). Connection gets lost after some time (dam directory of a few MB).
Locally tomcat9 with JDK8 is fine, export of same directory as above is done instantly.
However, on our vm with wildfly16 (official image) and JDK11 export works fast and fine too.
Maybe that helps.

Regards,
Christoph

Comment by Federico Grilli [ 19/Oct/20 ]

Hi Christoph, thanks for sharing your findings. I'm still looking into this direction, especially costly DTD validation or referencing to external entities which may have been become the default in later JDK versions.

Comment by Federico Grilli [ 20/Oct/20 ]

So, thanks to mduerig I found out that this is actually a known issue and a solution/problem mitigation exists, see MAGNOLIA-7702 for details.
Basically one needs to set prettyPrint = false property in the export command of the default catalog.

Note though, that this will cause the exported files to contain very long lines.

I'll make sure we document this properly.

Comment by Federico Grilli [ 10/Nov/20 ]

Release notes: In the scope of DEV-1543 we disabled pretty printing by default when Java version is 11+ due to the performance issues it gives https://git.magnolia-cms.com/projects/PLATFORM/repos/main/commits/1f78cd69a2f75c1edbf9fb98679adbd024e66883

Comment by Christopher Chard [ 08/Jan/21 ]

I have the feeling that the issue remains (MGNL 6.2.5). As soon as I go into config and set prettyPrint = false manually the export works again...

Could you please check how this behaves for you out-of-the-MGNL-6.2.5-box?

Generated at Mon Feb 12 04:27:45 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.