Page 2 of 4
Re: newlines in JSON
Posted: Mon Jul 14, 2014 10:00 am
by jssingh
Sorry, I was out on Friday and forgot to bump. =(
Re: newlines in JSON
Posted: Mon Jul 14, 2014 4:22 pm
by abrist
That's fine. So was Eric

I will attempt to get more information through email instead.
Re: newlines in JSON
Posted: Fri Jul 18, 2014 6:46 pm
by droland
Hi, I'm jjsingh's coworker and will be tracking this issue while she is out of the office.
I would appreciate it if you can add me to any email traffic.
David
Re: newlines in JSON
Posted: Mon Jul 21, 2014 11:53 am
by abrist
You may need to subscribe to this thread to receive emails. Eric[0] just committed and pushed code late last week. All standard JSON escaping should now be implemented in the json cgis.
Re: newlines in JSON
Posted: Mon Jul 21, 2014 12:34 pm
by jssingh
Hi,
first a note on personnel. I will be intermittently out of the office quite a bit until labor day, so (as mentioned earlier) David will be following up on things while I'm gone, but I will be popping in here now and then as well.
Thanks for the update and I installed the latest commit ... but now the JSON breaks for the services with newlines:
from the browser I get an Internal Service Error.
from a script on the command line I get this error:
Code: Select all
-bash-4.1$ ./qstat_test.pl
, or } expected while parsing object/hash, at character offset 574 (before "\n") at ./qstat_test.pl line 13
-bash-4.1$
I looked at the output from the original plugin and the character at 574 seems to be where a newline should be. Let me know if you need any more information before I revert back.
Re: newlines in JSON
Posted: Mon Jul 21, 2014 2:27 pm
by abrist
Could you post (obfuscate where necessary) the status string that is failing? (particularly he few chars before and after the offset?)
Re: newlines in JSON
Posted: Mon Jul 21, 2014 2:34 pm
by jssingh
from the plugin output:
Code: Select all
Server reports 3 jobs total (T:0 Q:0 H:0 W:0 R:3 E:0 B:0)\\n\\n Host CPUs Tasks Jobs Info\\n ---------- ---- ----- ---- ------------------\\n 243 hosts 1944 0 -- har\\n r710i1n15 0 0 0 har down\\n 370 hosts 2960 2960 -- har in-use\\n 25 hosts 40 0 -- har offline\\n r719i0n6 8 0 0 har {offline down}\\n\\n Req'd Elap\\nJobID Queue Jobname CPUs Nds wallt Ss wallt Eff Group Model\\n---------- ------ -------------- ---- --- ----- -- ----- --- ----- -------\\n13170.p233 long RS25VoF 800 100 16:00 R 00:12 28% e1120 100:har\\n Job run at Mon Jul 21 at 09:59 on (r704i0n10:ncpus=8)+(r704i0n11:ncpus=...\\n13171.p233 long MLHoleVoF 800 100 16:00 R 00:08 11% e1120 100:har\\n Job run at Mon Jul 21 at 10:03 on (r707i1n2:ncpus=8)+(r707i1n3:ncpus=8)...\\n13167.p233 normal tnksmthlwr4o6H 1360 170 08:00 R 02:45 86% e1201 170:har\\n Job run at Mon Jul 21 at 07:24 on (r701i0n1:ncpus=8)+(r701i0n3:ncpus=8)...
character 574 is the newline here:
hope this helps.
Re: newlines in JSON
Posted: Wed Jul 23, 2014 12:36 pm
by tmcdonald
What is your perl version?
I found a somewhat recent bug with older versions of perl parsing JSON resulting in that same error:
https://github.com/makamaka/JSON-PP/issues/8
It might still be a lingering issue worth looking into.
In addition, can you pipe the plugin output to a file and attach that file? I want to look at it from a hex level.
Re: newlines in JSON
Posted: Wed Jul 23, 2014 12:57 pm
by droland
Here is the perl version:
droland@lnxsrv78:~> perl -V | head -1
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Janice is expected back later this week. She will have to prepare and send the file.
David
Re: newlines in JSON
Posted: Thu Jul 24, 2014 4:24 pm
by sreinhardt
Sounds great, either pm it to tmcdonald or paste it here and he will take a look!