422 unprocessable entity error
Added by Willy . almost 4 years ago
Hi,
Does anyone know about 422 unprocessable entity error?
When I update comment using rest api(https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Updating-an-issue), 422 unprocessable entity error occurs intermittently.
I don't know exactly why this error occurs, but it occures when large amount of requests are sent to redmine server in a short time.
Please let me know if you know something about this issue and how to solve it.
This is information of my redmine server.
Environment:
Redmine version 4.1.1.stable
Ruby version 2.6.6-p146 (2020-03-31) [x86_64-linux]
Rails version 5.2.4.2
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Subversion 1.10.4
Mercurial 4.8.2
Bazaar 2.8.0
Git 2.20.1
Filesystem
Redmine plugins:
redmine_agile 1.5.3
redmine_banner 0.3.3
redmine_ckeditor 1.2.3
redmine_datetime_custom_field 1.0.1
redmine_issue_templates 1.0.3
redmine_mentions 0.1.1
redmine_webhook 0.0.5
Thanks in advance
Replies (2)
RE: 422 unprocessable entity error - Added by Anton Shepelev almost 4 years ago
I had this errow when the `JSON` or `XML` sent to the server started with an empty line. Check yours.
P.S.: What—no markdown here?
RE: 422 unprocessable entity error - Added by Anton Shepelev almost 4 years ago
Take into account that you can obtain more detailed information about this error from WebException.Response.GetResponseStream()
, for example:
try
{ resp = (HttpWebResponse)req.GetResponse(); }
catch( Exception e )
{ WebException we;
ok = false;
errmsg = e.Message;
if( !( e is WebException ) ) goto ExRep;
we = ( WebException )e;
if( we.Response == null ) goto ExRep;
rstream = we.Response.GetResponseStream();
if( rstream == null ) goto ExRep;
stream_err = ReadStream( rstream );
if( stream_err == "" ) goto ExRep;
errmsg = errmsg + ":\r\n" + stream_err;
ExRep:
errmsg = "GetRespose():\r\n" + errmsg;
goto Error;
}
resp.Dispose();