Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save a Diagram once you've inserted a large image "400: Unable to parse form content" in a diagram #9

Closed
ane-gabriela opened this issue Aug 23, 2018 · 4 comments

Comments

@ane-gabriela
Copy link

commented Aug 23, 2018

Steps to reproduce:

  1. Log in as admin and create a new diagram
  2. In Edit mode click on the Plus sign > Insert Image...
  3. Drag and drop a large image from the device (eg. flower images attached)
  4. Click on Resize
  5. Click on Save & View

Expected results: The image is resized and the diagram saved.

Actual results: The image is resized but an error appears when the Diagram is saved.

In XWiki I got
adminview

and also
adminview2

HTTP ERROR 400
Problem accessing /xwiki/bin/preview/Diagram/NewDiagram/WebHome. Reason: 
    Unable to parse form content

Caused by:
org.eclipse.jetty.http.BadMessageException: 400: Unable to parse form content
	at org.eclipse.jetty.server.Request.getParameters(Request.java:380)
	at org.eclipse.jetty.server.Request.getParameterValues(Request.java:1051)
	at javax.servlet.ServletRequestWrapper.getParameterValues(ServletRequestWrapper.java:221)
	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter$SavedRequestWrapper.getParameterValues(SavedRequestRestorerFilter.java:146)
	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:90)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Form too large: 1464614 > 1000000
	at org.eclipse.jetty.server.Request.extractFormParameters(Request.java:523)
	at org.eclipse.jetty.server.Request.extractContentParameters(Request.java:461)
	at org.eclipse.jetty.server.Request.getParameters(Request.java:376)
	... 43 more
Caused by:
java.lang.IllegalStateException: Form too large: 1464614 > 1000000
	at org.eclipse.jetty.server.Request.extractFormParameters(Request.java:523)
	at org.eclipse.jetty.server.Request.extractContentParameters(Request.java:461)
	at org.eclipse.jetty.server.Request.getParameters(Request.java:376)
	at org.eclipse.jetty.server.Request.getParameterValues(Request.java:1051)
	at javax.servlet.ServletRequestWrapper.getParameterValues(ServletRequestWrapper.java:221)
	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter$SavedRequestWrapper.getParameterValues(SavedRequestRestorerFilter.java:146)
	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:90)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
	at java.lang.Thread.run(Unknown Source)

In the Console
2018-08-23 14:30:36.168:WARN:oejs.HttpChannel:qtp17081105-13: /xwiki/bin/preview/Diagram/NewDiagram/WebHome org.eclipse.jetty.http.BadMessageException: 400: Unable to parse form content

This was tested with XWiki 10.7 RC 1, MySQL 5.7 , Edge 17 and Diagram Pro 1.5-rc-1

@ane-gabriela

This comment has been minimized.

Copy link
Author

commented Aug 23, 2018

Images used:
pink_cosmos_flowers-wide
1full-image

@mflorea

This comment has been minimized.

Copy link
Collaborator

commented Aug 24, 2018

Form too large: 3091655 > 1000000

In order to fix this we need to catch the image drop, upload the image as an attachment and replace the data URI with the attachment URL.

@mflorea mflorea removed this from the 1.5 milestone Aug 24, 2018

@ane-gabriela

This comment has been minimized.

Copy link
Author

commented Jul 23, 2019

On XWiki 11.5 the images above can't be used while adding them as images (as stated above) but also, they aren't working as diagram Background - the user is now allowed to save the diagram

Steps to reproduce:

  1. Create a new diagram
  2. In the right Diagram panel click on Image (Background)
  3. Drag and drop the blue flower image > Apply
  4. Click Save & View

SavingImageBackground

When adding the images to the diagram and saving (also tried with URL https://upload.wikimedia.org/wikipedia/commons/e/e0/Large_Scaled_Forest_Lizard.jpg)

AddingImage

@arcilli arcilli self-assigned this Jul 26, 2019

@arcilli

This comment has been minimized.

Copy link

commented Aug 13, 2019

Closed by #46.

@arcilli arcilli closed this Aug 13, 2019

@mflorea mflorea added this to the 1.7 milestone Aug 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.