Znuny and ((OTRS)) Community Edition
OTRS 5 TicketUpdate via WebServices JSON : Error while decoding request content..
Moderator: crythias
OTRS 5 TicketUpdate via WebServices JSON : Error while decoding request content..
Post by LXsysadmin » 25 Mar 2019, 14:51
We are trying to update multiple tickets via OTRS 5 web services using JSON. All is working fine except for one ticket. JSON looks the same as for other tickets.
We get error like:
Message: Decoding the JSON string failed:
RemoteAddress:
RequestURI: /nph-genericinterface.pl/Webservice/Robot/TicketUpdate/106589?SessionID=H3uAMCCcPNIj1Dem7o30PeIk4zBxnK3K
Traceback (32704):
Module: Kernel::System::JSON::Decode Line: 139
Module: Kernel::GenericInterface::Transport::HTTP::REST::ProviderProcessRequest Line: 290
Module: Kernel::GenericInterface::Transport::ProviderProcessRequest Line: 108
Module: Kernel::GenericInterface::Provider::Run Line: 180
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_nph_2dgenericinterface_2epl::handler Line: 38
Module: (eval) (v1.99) Line: 204
Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
Module: ModPerl::Registry::handler (v1.99) Line: 31
ERROR: GenericInterfaceProvider-10 Perl: 5.10.1 OS: linux Time: Mon Mar 25 14:32:26 2019
Message: DebugLog error: Summary: Error while decoding request content. Data : No data provided.
Message: DebugLog error: Summary: Request could not be processed Data : Error while decoding request content..
Message: DebugLog error: Summary: Returning provider data to remote system (HTTP Code: 500) Data : Error while decoding request content..
Can we somehow get more information about what is wrong? JSON validators say, that JSON is correct. How to get output what and where something goes wrong? Is there some value incorrect or symbol or.
Re: OTRS 5 TicketUpdate via WebServices JSON : Error while decoding request content..
Post by root » 25 Mar 2019, 15:18
Show your JSON and HTTP method.
Any details in the web service log (switch to debug first)
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO
Use a test system — always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
error while decoding bytestream #1223
Comments
Adi-18 commented Jun 6, 2019 •
I geht errors like this while access to stream:
.
[h264 @ 0000000033a298c0] left block unavailable for requested intra4x4 mode -1
[h264 @ 0000000033a298c0] error while decoding MB 0 13, bytestream 234391
[h264 @ 0000000033a2e0c0] left block unavailable for requested intra4x4 mode -1
[h264 @ 0000000033a2e0c0] error while decoding MB 0 32, bytestream 12860
[h264 @ 0000000033a29480] left block unavailable for requested intra4x4 mode -1
[h264 @ 0000000033a29480] error while decoding MB 0 13, bytestream 352876
[h264 @ 0000000033a2e0c0] cabac decode of qscale diff failed at 67 54
[h264 @ 0000000033a2e0c0] error while decoding MB 67 54, bytestream 36823
[h264 @ 0000000033a29480] error while decoding MB 53 32, bytestream -5
[h264 @ 0000000029b3d740] error while decoding MB 57 35, bytestream -5
[h264 @ 0000000033a2e540] error while decoding MB 42 37, bytestream -15
[h264 @ 0000000033c400c0] error while decoding MB 59 34, bytestream -5
.
The image looks not clear. I work with JavaFx8 an Javacv 1.5.0.
Capturing with FrameRate: 25.0, Width: 1920, Height: 1080, Codec; H.264
When I move the ptz-head, the image get worse.
When I open the stream in VLC player or web interface, the image looks perfect.
Desired image:
BTW: Those this library use GPU for rendering?
The text was updated successfully, but these errors were encountered:
Error while decoding the request
perlCrazy has asked for the wisdom of the Perl Monks concerning the following question:
|
---|
Replies are listed ‘Best First’. | |
---|---|
Re: Getting error while decoding JSON object via POST method by tobyink (Canon) on Feb 06, 2013 at 06:39 UTC | |
The error is on these two lines. If you’d used strict Perl would have told you about the undeclared variable $inputData. | [reply] [d/l] [select] |
by perlCrazy (Monk) on Feb 06, 2013 at 07:20 UTC | |
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before «(end of string)» | [reply] |
by Corion (Patriarch) on Feb 06, 2013 at 07:25 UTC | |
Have you printed out your JSON data string at the receiving end to see what you get there? An empty string gives the same error message: I think you are trying to pass the data around in a very bad manner: If you send POST data, please read HTTP::Request on how to send POST data. If you want to send the data in an URI, please encode it properly using URI::Encode. | [reply] [d/l] |
by perlCrazy (Monk) on Feb 06, 2013 at 08:40 UTC | |
by Corion (Patriarch) on Feb 06, 2013 at 09:01 UTC | |
by tobyink (Canon) on Feb 06, 2013 at 09:59 UTC | |
This error message occurs when you pass the empty string or an undefined variable to be decoded by JSON, JSON::PP or JSON::XS. So I’d suggest that even with the updated code, the problem is related to the initialization of $jsonText — it appears to be undef. | [reply] [d/l] |
Re: Getting error while decoding JSON object via POST method by tobyink (Canon) on Feb 06, 2013 at 09:48 UTC | |
Here is an example of a CGI script that accepts JSON via HTTP POST, reads two numbers «a» and «b» from the input, and adds them together returning «c», plus an example client that uses the script. | [reply] [d/l] [select] |
by perlCrazy (Monk) on Feb 06, 2013 at 10:26 UTC | |
| [reply] [d/l] [select] |
by Anonymous Monk on Feb 06, 2013 at 10:35 UTC | |
| [reply] |
by perlCrazy (Monk) on Feb 06, 2013 at 14:19 UTC | |
by perlCrazy (Monk) on Feb 06, 2013 at 10:53 UTC | |
by Anonymous Monk on May 19, 2014 at 16:21 UTC | |
| [reply] |
by Corion (Patriarch) on May 19, 2014 at 17:43 UTC | |
Implementing a transfer encoding on the server side is not easy. I would try to prevent sending data using the «chunked» transfer encoding. Depending on your client library, there are different ways to prevent that. | [reply] |
by boftx (Deacon) on May 19, 2014 at 18:56 UTC | |
by Corion (Patriarch) on May 19, 2014 at 19:27 UTC | |
Re: Getting error while decoding JSON object via POST method by Mr. Muskrat (Canon) on Feb 07, 2013 at 20:00 UTC | |
my $perlData = $json->decode($response->content()); You don’t want the raw content returned by $response->content(). You want the decoded content as returned by $response->decoded_content(). tobyink had it correct in his reply but he didn’t explicitly call it out and you didn’t pick up on it. | [reply] [d/l] [select] |
by johndeighan (Novice) on Apr 05, 2017 at 12:33 UTC | |
| [reply] |
by Corion (Patriarch) on Apr 05, 2017 at 12:37 UTC | |
So, can you show us the code you are using, together with «good» and «bad» input data? Ideally, the code would be about 20 lines. | [reply] |
by huck (Prior) on Apr 05, 2017 at 13:27 UTC | |
This routine replaces HTML entities found in the $string with the corresponding Unicode character. Unrecognized entities are left alone. Im not sure this would work on «chunks», $orig has to be the entire string to decode at once for with chunks an entity could be split across them. Accept-Encoding, Content-Encoding, and ERR CONTENT DECODING FAILED
I was testing an application deployed in a new environment recently and was noticing a difference in behavior between the new environment and the old one. HTTP requests from the browser to our API endpoints were showing a status code of 200 (successful) but failed with an error: It’s not an error I had seen before but I assumed it was due to something with . content decoding. Content encoding is a way to send less data over the network, typically resulting in overall faster page loads. This type of performance improvement is fairly cheap in that it’s typically just a switch or two on your server. Making this change can do everything from improve SEO and increase conversions to making your application more usable over slow connections. How it works, in the simplest case is: This conversation is called, generally, content negotiation and it can be quite difficult to troubleshoot. The server receives a number of headers, both standard and custom, and then decides what content to send back. I might send a language of es-ES and that I accept a application/json content type and I would expect a JSON response in Spanish (if the server was capable of both of those things). There are a number of layers to look at when figuring out what is going wrong: Even if things are properly configured (which they might not be), there are many variables to take into account.
It’s a good idea during troubleshooting to reduce as many of these variables as possible and, in this case, the tool for that job is cURL. Postman, Insomnia, and similar are great tools but the definitive answer is the library that is likely doing the work under the hood anyways. It’s also much easier to share your results with someone else or document it in the form of a copy/paste command. The error I was dealing with was happening in a browser and most browsers have a little feature you can use to get a cURL command from a network request. In Chrome or Safari (and probably others), navigate to the Network tab, find the request, right or CTRL click, and select Copy as cURL. If you do that in Safari for a request to my homepage, you’ll get something like this: I added the -I flag which tells cURL just to show you the headers of the response. Note: If you’re getting a «certificate has expired» message it means that your local cert bundle is not up to date. You can update your local certs by following the link in your terminal or add —insecure to the request for testing. You should get an output similar to the below: You can see that we told the server «I can speak br » and the server gave us back br . Great! Now lets try another experiment: You should get a response like this: See the content-encoding header? It’s now gzip . If you run that same command with a -v flag (for verbose output), you’ll see that we’re sending the following: The —compressed flag adds the header above and then attempts to decompress the request based on the response header. The br encoding is missing in my case because I am not on the latest cURL version (added in 7.57.0). So we have a way to easily modify the request we’re making and see the response that comes back. That should help us figure out a number of content encoding and negotiation issues we might come across. But there’s one problem, the one I was troubleshooting, that we need to test. What if the server tells us that it’s sending content compressed one way but it’s actually compressing it a different way or not at all? Using the —compressed flag above, we can see if cURL will decompress the response we get. If I remove the -I flag from our last request above and run it, I get the HTML of my homepage, as expected. If we point that request at a URL that responds with content-encoding: gzip but does not actually return gzipped content, we’ll get an error: This endpoint was built using a few lines of Node.js code: You can see that the home page just outputs text but the sets a Content-Encoding header before outputting a similar bit of text. If you visit the homepage, you’ll see the text just fine and your headers will tell you that you asked for the 3 compression types but the server responded with no content encoding, meaning no compression was used. All is well. If you visit the test page, however, you’ll see an error in Safari and no text will be displayed. Adblockdetector |