Vuze Test Failed: Nat Test Failed: Error: Unexpected End Of File From Server

Posted : admin On 21.08.2019

Im not even sure running Vuze 3.0.had him update to 4.0 and the problem was solved. My NAT signal is not showing green, subnet in order to setup the port forwarding properly? Another application may already be using this. I found No, create Any help the type of. Running Vuze NAT/Firewall Test (on 43584, the port installed by the VPN plugin): Testing port TCP 43584. Unable to test: Invalid port given, or test service failed. Another application may already be using this port. (Error: Unexpected end of file from server) Testing port UDP 43584.

When loading my page in Google Chrome, I get a vague error in the console:

Uncaught SyntaxError: Unexpected end of input

I have no idea what is causing it. How would I go about debugging this error?

Qix
7,68212 gold badges61 silver badges118 bronze badges
dlaurent86dlaurent86
9303 gold badges8 silver badges11 bronze badges

16 Answers

This particular error is one annoying fact about v8. In most cases your JavaScript is broken in some way. For example missing a } or something like that.

Example given, this will yield 'Unexpected end of input' too:

But the root cause of the problems seems to be that the requested JSON url has a Content-Type of text/html which Chrome apparently tries to parse as HTML, which then results in the unexpected end of input due to the fact that the included image tags are being parsed.

Try setting the Content-Type to text/plain I think it should fix the issues.

Nonetheless, V8 could do a better Job about telling one exactly where the input ended unexpectedly.

Nae
6,4653 gold badges16 silver badges42 bronze badges
Ivo WetzelIvo Wetzel
41.7k11 gold badges85 silver badges104 bronze badges

Try Firebug for Mozilla - it will show the position of the missing }.

user669677

See my case on another similar question:

In my case, I was trying to parse an empty JSON:

In other words, what happened was the following:

Community
falsarellafalsarella
10.1k5 gold badges55 silver badges96 bronze badges

Unable To Test: Invalid Port Given, Or Test Service Failed.

Vuze Test Failed: Nat Test Failed: Error: Unexpected End Of File From Server

I get this error when I have ommitted a closing brace character (})in JavaScript code. Check that your braces are properly balanced.

Hubro
27.1k45 gold badges173 silver badges314 bronze badges
HBPHBP
12.5k3 gold badges24 silver badges28 bronze badges

For the record, for anyone trying to find the various causes for this error. An empty HTML5 data attribute

causes the error too. You should check when the data value is a null string and not include the attribute at all. It goes without saying this is largely relevant to script generated HTML.

DroidOSDroidOS
3,2918 gold badges49 silver badges107 bronze badges

The issue for me was that I was doing $.ajax with dataType: 'json' for a POST request that was returning an HTTP 201 (created) and no request body. The fix was to simply remove that key/value.

BlaskoviczBlaskovicz
3,6975 gold badges31 silver badges43 bronze badges

JSHint is good at finding the location of missing brackets or bad syntax.

HarfatumHarfatum

Another cause of this error: if your API intentionally responds with no response body, but responds with a 200 OK status code instead of a 204 No Content status code. Some JavaScript libraries may not respond well to unexpected content types when there is no content, so use the correct status code!

AndrewAndrew
104k164 gold badges465 silver badges647 bronze badges

There will definitely be an open bracket which caused the error.

I'd suggest that you open the page in Firefox, then open Firebug and check the console – it'll show the missing symbol.

Example screenshot:

Manoj KumarManoj Kumar
3,3904 gold badges19 silver badges43 bronze badges

My problem was with Google Chrome cache. I tested this by running my web application on Firefox and I didn't got that error there. So then I decided trying emptying cache of Google Chrome and it worked.

Amir AlAmir Al
6421 gold badge14 silver badges34 bronze badges

Vuze Firewalled Mac

Since it's an async operation the onreadystatechange may happen before the value has loaded in the responseText, try using a window.setTimeout(function () { JSON.parse(xhr.responseText); }, 1000);to see if the error persists? BOL

safhacsafhac

I faced similar problem using ui bootstrap directive for angularjs - uib-datepicker, when pressing am/pm toggle.

Error in event handler for (unknown): SyntaxError: Unexpected end of JSON input angular timepicker

Turned out it was because of plugin 'Trans-over' (which translates a word when it is clicked). Maybe my answer will help someone, because I didn't found anything on the internet.

OlehZiniakOlehZiniak

I had this error and fixed it by adding the guard on readyState and status shown here:

BrickBrick
2,4527 gold badges17 silver badges36 bronze badges

In cases where your JavaScript code is minified to a single line, another cause for this error is using // instead of /**/ for your comments.

Bad (comments out everything after // including the closing } for your function)

Good (confines your comment)

Johan DoeJohan Doe

if you got error at Anchor tag,just replace 'Onclick' with 'href' or 'href' with 'Onclick'

Harsha AnnareddyHarsha Annareddy

Setting the Accept header to application/json in the request worked for me when I faced the same problem.

Stefano PopulinStefano Populin

Not the answer you're looking for? Browse other questions tagged debugginggoogle-chromesyntax-error or ask your own question.

Christoph Vollmer - 2013-03-07

Hi,

i've got a problem extracting an archive generated with 7z. The archive was created with 7-Zip 4.65. The command used to create the archive was : '7z.exe a archiv.7z textfile.log'
There is only 1 file in the archive and the content of the file is only ascii text.

Size of the 7z file looks good (i've got several other files with almost the same contents, the same filename inside the archive, only the contents of the file differ).
I'm assuming that only some part of the archiv's header got damaged.

Is there any way to recover the file from the archive?
I could provide a working example and the not working archive.
Would be awesome if someone could give me a hint on howto recover the data.

I saw Roblad has / had a similar problem over here: https://sourceforge.net/p/sevenzip/discussion/45797/thread/c6a35f22/
But i don't know how to provide this information and what to do with the information.

Cheers
Chris