JSON Parse Error

Good afternoon.

I am getting the following message when the web app crashes. It happens in our production environment but not our test or my development environments.

Trouble evaluating response: JSON Parse error: Unterminated string
– more stuff here

Does any one have any clue as to what is going on or where to look? It happens as soon as I (I can reproduce it, at least) click a specific button, which reveals a container control.

-Bob

“Unterminated String” sounds like one of the string elements contains an unescaped quote, or something like that.

["this is \"right\""]
["this is "wrong""]

Edit: Fixed the brackets in my example.

It could also be something like this:

{"item":"this is wrong}

Darn, I couldn’t recreate that error in either of those scenarios with the new framework. Let me try JSONItem…

Nor with a JSONItem. I think we’d need to see the original JSON that’s causing the error.

This is the entire message:

Trouble evaluating response: JSON Parse error: Unterminated string
Source: {“jsSource”:“RS.controls[‘HTr2RfZ9’].setValue(“Employees”);
RS.controls[‘PoAIWq84’].setValue(“Approve Employees from Intake Form”);
RS.controls[‘Yd292a4G’].setStyle(‘stlButton’);
RS.controls[‘Yd292a4G’].refresh();
RS.controls[‘L6qYU1rs’].setEnabled(false);
RS.controls[‘L6qYU1rs’].refresh();
RS.controls[‘L6qYU1rs’].setStyle(‘stlButtonOff’);
RS.controls[‘L6qYU1rs’].refresh();
RS.controls[‘DmpLrUvd’].setVisible(false);
RS.controls[‘DmpLrUvd’].refresh();
RS.controls[‘Uk8v0pIL’].setStyle(‘stlHelp’);
RS.controls[‘Uk8v0pIL’].refresh();
RS.controls[‘Uk8v0pIL’].setValue(“Employees to approve: 1”);
RS.controls[‘Uk8v0pIL’].setVisible(true);
RS.controls[‘Uk8v0pIL’].refresh();
RS.controls[‘ByBxqq0c’].setVisible(true);
RS.controls[‘ByBxqq0c’].refresh();
RS.controls[‘KGAO9jcQ’].deleteAllRows();
RS.controls[‘KGAO9jcQ’].appendRow(”-Select-");
RS.controls[‘KGAO9jcQ’].appendRow(“Respirator Questionnaire”);
RS.controls[‘KGAO9jcQ’].setValue(0);
RS.controls[‘IADq4VD6’].setValue("???_??");
RS.controls[‘MduJXbQH’].setValue("??me???");
RS.controls[‘KWfqmbKm’].setValue("?0???k\
??W???+");
RS.controls[‘IjuVofRI’].setValue("?20l???Z????");
RS.controls[‘Lz9LkQK0’].setValue("??me?????");
RS.controls[‘K0fTTDN5’].setValue(“5910”);
RS.controls[‘N9TdPsAM’].setValue(“UHS”);
RS.controls[‘HSTop5eS’].setValue(“Wn?e?^?~”);
RS.controls[‘ZRMmwOWj’].setValue(“21”);
RS.controls[‘Jg7nSAIb’].setValue(“0”);
RS.controls.SzjgxdlQ.setItemEnabled(“btnFind”,false);
RS.controls.SzjgxdlQ.setItemEnabled(“btnNew”,false);
RS.controls.SzjgxdlQ.setItemEnabled(“btnEdit”,true);
RS.controls[‘HFaXDYQD’].setVisible(true);
RS.controls[‘HFaXDYQD’].refresh();
RS.controls[‘VMO3ywbw’].setValue(true,true);
RS.controls[‘CubYrubn’].setValue(false,true);
RS.controls[‘WeLG15BH’].setValue(false,true);
RS.controls[‘AuTdSO1R’].setValue(true,true);
RS.controls[‘Mv5hHTIu’].setValue(true,true);
RS.controls[‘Arjuq9at’].setEnabled(false);
RS.controls[‘Arjuq9at’].refresh();
RS.controls[‘JAM7GFxr’].setValue(“Active”);
RS.controls[‘OMkrOeO9’].setValue(“Y”);
RS.controls[‘VZc3Dbpw’].setValue(“x?gq?e?,”);"}

Are you using Xojo.Data.ParseJSON?

Also, something is being lost in translation when you paste to the forum. Can you copy the raw data into a text file and make that available?

I am not directly using and JSON in the app.

If “something is being lost in translation” refers to the diamond-questionmarks, that’s in the message.

I’ve got it in a text file. Where should I send it (or is there a way to attach things in the form)?

Ah. This makes more sense. This is an error being thrown by the web framework when trying to send commands to the browser.

Make sure the encoding on the strings you are sending are UTF-8.

By the way…

What version of Xojo are you using?

It is (sigh) RS 2012 2.1.

One of the projects for next year is to move everything to the current version.

Note, however, that it works in our test environment, which is on the same server; and it works from the IDE.

I’m off to get snow tires on the car (being in Minnesota, I get to deal with such things). I’ll be back later and/or tomorrow.

Thanks for the efforts.

-Bob

I have figured out the problem.

First, than you for your time.

The problem had to do with encryption. A key, in some cases, was wrong. So, when it decrypted it generated all sorts of weird stuff. This explains all the behavior I was seeing.

Moral: Look at the data!

Thank you, again.

-Bob