Glassfish Server 4 post too large error - configuration

I have a problem with GF4 while calling a web service I coded using http post. GF4 responds with a "Post too large" error. My post data is about 3MB.
Here is the GF4 debug log:
WARNING: Post too large
WARNING: StandardWrapperValve[obx2oex]: Servlet.service() for servlet obx2oex threw exception
java.lang.IllegalStateException: Post too large
at org.glassfish.grizzly.http.server.Request.parseRequestParameters(Request.java:2024)
at org.glassfish.grizzly.http.server.Request.getParameter(Request.java:1052)
at org.apache.catalina.connector.Request.getParameter(Request.java:1547)
at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:448)
...
I already googled for this issue and found some help that encourages to modify the server configuration. I edited the following part in the domain.xml:
<http-service>
<access-log></access-log>
<virtual-server id="server" network-listeners="http-listener-1,http-listener-2"></virtual-server>
<virtual-server id="__asadmin" network-listeners="admin-listener"></virtual-server>
<property name="maxPostSize" value="2097152"></property>
</http-service>
and restarted the server. But the error still occurs.
Does anybody know, how to solve this "post too large" issue?
Thanks for your help!
PS: I just saw the starting log of the GF4 and it told me:
WARNING: Unsupported http-service property maxPostSize is being ignored
So where should I tell GF4 to accept large post data?

Open Glass Fish administrative console, select
Configurations - server config - Network Config - Network Listeners
- http-listener-1
and
tab HTTP.
There is parameter Max Post Size. Increase it as you wish.
Look screenshot

My first attempt coding my webservice was a servlet that accepts data via POST parameter of HTTP. That lead to the "Post too large" error, when sending more than 2MB.
I got a suggestions to code it as REST service. It is very strange, but now it works with more than 2MB. Even while the data is sent via http post.
Maybe it should help someone.
But nevertheless I'd like to know, where you can set the maxPostSize value in GF4 server.

Related

MediaWiki, trying to investigate VisualEditor "Error contacting the Parsoid/RESTBase server (HTTP 500)"

A lot of people have the same error for many different reasons, so, after trying a composer update, I've tried to investigate it starting from the browser and reconstructing step by step what is happening. It's really hard for me and I would really appreciate help from a PHP Developer!
From Chrome Developer Tools I could find the Ajax request in the background and the called url on the server
By playing with the url I realized that changing the action name returned a different error code, which let me understand that the current call is just a generic API in the middle between the browser and whatever is "apierror-visualeditor-docserver-http"
The Ajax call
{mysite}
/ api.php
? action=visualeditor
& paction=parse
&page=Cosa_c%27%C3%A8_da_fare%3F
Example
https://www.tematichedigenere.com/api.php?action=visualeditor&paction=parse&page=Cosa_c%27%C3%A8_da_fare%3F
The response from the Ajax call
The serverside call to rest api
Then I can see from the Apache server's log that the api page contacts the following url (returning 500)
GET
//rest.php/
{mywebsiteurl}
/v3/page/html/
Cosa_c%27%C3%A8_da_fare%3F/27246
?redirect=false
&stash=true
example
"GET //rest.php/www.tematichedigenere.com/v3/page/html/Cosa_c%27%C3%A8_da_fare%3F/27246?redirect=false&stash=true HTTP/1.0" 500 5621 "-" "VisualEditor-MediaWiki/1.38.2"
Another example of log (returning 404)
{an IP} - -
[04/Dec/2022:14:16:12 +0000]
"POST
/rest.php/
{mywebsiteurl}/v3
/transform/html/to/wikitext
/Riflessioni_sulla_sessualizz._femm._collegate_-_bozza%2Fprova
HTTP/1.0"
404
467
"-"
"VisualEditor-MediaWiki/1.38.2 X-Middleton/1"
Maybe the initial double / is wrong?
Anyway if I call the uri directly from my browser https://tematichedigenere.com/rest.php/www.tematichedigenere.com/v3/page/html/Cosa_c%27%C3%A8_da_fare%3F/27246?redirect=false&stash=true
The server does a antirobot check but I'm not sure that was the problem.
I've realized that the 500 error code hides a more complex real error which is returned by accessing directly the url from the log.
As you say, the visualeditor API is mostly just a proxy to the Parsoid API. The double / is wrong (check your $wgVirtualRestConfig settings maybe), I don't think it actually matters though. The error sounds like you are using incompatible library versions - make sure MediaWiki core and the VisualEditor extension are for the same release, and that the parsoid Composer library is up to date.
Update from OP:
the issue was solved. I simply had to delete the folder /vendor/wikimedia/parsoid and copy it from the fresh install. I couldn't see there were disalignment because of a problem in the compare tool. I got a lot of help in the IRC channel (not in Phabricator and not in Mediawiki forums, it seems IRC is really helpful for MW products).

Autodesk-designautomation: Internal Server Error(Error Code 500): Missing parameter in WorkItem

I am using Autodesk Revit and have been trying to implement the Design Automation API. I have been successful in trying out the sample, modify-your-model tutorial where the dimensions of a window are altered. However the example code is not executing perfectly anymore and it displays an internal server error message(error code 500). The error console claims that some parameter in the workItem is missing. The code worked again on the morning of 14th March again, but by noon it started showing the same error. The error log on the web page and console are given below respectively.
My question is, has the Autodesk OSS server been down for some time now or is it some fault from my side? Please help me out.
P.S. The same code worked perfectly before. I have not edited anything. Yes, I did try changing the Client ID and Client Secret and also update the ngrok address every 2hours.
Sincerely
Error list
-Failed to load resource: the server responded with a status of 500 (Internal Server Error)
-No webpage was found for the web address: http://localhost:3000/api/forge/designautomation/workitems
error in debugger
-fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HM76OJJ532MV", Request id "0HM76OJJ532MV:00000002": An unhandled exception was thrown by the application.
System.Net.Http.HttpRequestException: The server returned the non-success status code 400 (Bad Request).
More error details:
{
"url": [
"Error converting value \"http://aa025317d1f2.ngrok.io /api/forge/callback/designautomation?id=76m1z2sw7uQi-jtAYzYvgA&outputFileName=20210314024133_output_revit_sample_file.rvt\" to type 'System.Uri'. Path 'url', line 1, position 2376."
],
"workItem": [
"A value for the 'workItem' parameter or property was not provided."
]
}
As suggested in the comments there is a space in the ngrok url posted to the workitem:
http://aa025317d1f2.ngrok.io /api/forge/callback/designautomation?id=76m1z2sw7uQi-jtAYzYvgA&outputFileName=20210314024133_output_revit_sample_file.rvt

Issues with MantisBT and PhpStorm

I happily used PhpStorm and MantisBT together for months, but now I'm facing a strange problem.
Trying to establish a connection to my mantis instance (self hosted), I get the error:
Request failed. Reason: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
While I understand, what this error message means, I can't tell why it happens and I can't control the response I get from Mantis.
I neither found answers at the PhpStorm docs nor at Google nor at the Mantis bug tracker itself.
So I want to try my luck here. Is anyone else experiencing this or could give some advice?
Thanks to #user10550971 comment, I found the issue. The link to check if SOAP is enabled or not mentioned, that the PHP Soap extension was missing.
Although I would have sworn, that I didn't make any changes at server side, I did.
I updated my PHP version and forgot to install SOAP.

APPFabric client communication error?

I have configured 2 AppFabric instances and try to connect from a test client to the cache.
At first, I had trouble establishing the cache using the DataCacheFactory, but after opening the 22233-22235 ports in the firewall I have managed to get the cache using the DataCacheFactory.
As soon as I try to use the cache for a very small object (using a simple get), I get the following with a null InnerException:
ErrorCode:SubStatus:The connection was terminated, possibly due to server or network problems or serialized Object size is greater than MaxBufferSize on server. Result of the request is unknown.
I don't believe it's the MaxBufferSize issue (I also modified the transportProperties in the config just to make sure), but on the other hand - I'm able to get the cache, which I believe should indicate that the client can communicate with the server. So what is it? -How can I get more details on this issue?
Thanks in advance,
Nir.
Got this to work!
All I needed to do was just to add the host names, as appear in ClusterConfig file to the hosts file of the client, and that's it!
Hope that helps anyone,
Nir.

HTML5 validator.w3.org

My site was valid until today, wondering wether it is my site's or the validator's fault.
I am getting this message:
The error encountered was: 500 Can't connect to localhost:8888 (connect: Connection refused)
HTTP Error 500 is an Internal Server Error, so that will be their fault. Try validator.nu whilst you are waiting.
W3C validator maintainer here. Tip: Next time you see that message, try validating your document directly at http://validator.w3.org/nu/ instead.
Because if you see that 500 error it means the validator is trying to reach the HTML5 backend, which runs as a separate service/process responding at localhost:8888 on the validator host.
But we actually run several validator hosts, round-robin, so if you see that 500 error it could mean that only one of the HTML5 backends on one of the hosts is temporarily down. And if you go to http://validator.w3.org/nu/ you might get lucky and hit a different host and it'll work.
On the other hand if you get a 404 from http://validator.w3.org/nu/
it most likely means you caught me in the middle of restarting/redeploying the W3C HTML5 validator backends to pull in changes I've made to the sources from https://github.com/validator/validator
But that never takes me more than a few minutes, so on your end you should never be seeing that 500 error for more than, say, 10 minutes at most. So if/when you do see it for any longer than that, please report it either by tweeting to #w3c or #sideshowbarker on twitter, or pinging me on IRC (MikeSmith on #whatwg or #w3c on irc.freenode.net).
I think it's pretty clear from the error that it's a problem at their end:
Checking the Document Type of this document requires the help of an external tool which was either not enabled in this validator, or is currently unavailable. Check in the validator's system configuration that HTML5 Validator is enabled and functional.
The error encountered was: 500 Can't connect to localhost:8888 (connect: Connection refused)
(My emphasis.) I expect they'll get it fixed Right Quick Like.
We were getting the following error while checking the domain in W3C validator and we managed to fix it by installing CA Bundle and Intermediate Root certificates for the same domain. Now, the domain is able to pass through the W3C validation check and reporting appropriate result.
===================================
Sorry! This document cannot be checked.
Error
I got the following unexpected response when trying to retrieve <https://our-xx-domain.in/>:
500 Can't connect to our-xx-domain.in:443
If you made recent changes to your domain name (DNS) configuration, you may also want to check that your domain records are correct, or ask your hosting company to do so.
===================================