Error: JSON.parse

General discussions and questions.
Post Reply
belegdae
Posts: 7
Joined: Tue May 28, 2019 2:10 pm

Error: JSON.parse

Post by belegdae » Fri Jun 07, 2019 9:04 am

Hey, I'm having an issue I'm struggling to find the cause of.
In the log, I have a large number of JSON parse errors for what I believe is the render info:

Code: Select all

3251: Error: JSON.parse:
3247: Unexpected token in JSON at position 1736

{
	"renders": [{
			"name": "d104-01",
			"id": 1,
			"priority": 99,
			"user_name": "rendf1",
			"time_register": 1559673925,
			"time_launch": 0,
			"time_update": 1559880938,
			"address": {
				"family": 4,
				"ip": "10.6.111.69",
				"port": 0
			},
			"netifs": [{
				"name": "{F1AF32D1-1100-4768-8836-33C3527FB08E}",
				"mac": "c8:d3:ff:be:83:ae",
				"addresses": [{
					"family": 4,
					"ip": "10.6.111.0",
					"port": 0
				}, {
					"family": 4,
					"ip": "10.6.111.69",
					"port": 0
				}, {
					"family": 4,
					"ip": "10.6.111.255",
					"port": 0
				}, {
					"family": 4,
					"ip": "224.0.0.0",
					"port": 0
				}, {
					"family": 4,
					"ip": "255.255.255.255",
					"port": 0
				}]
			}],
			"engine": "2.3.1",
			"st": 128,
			"state": " OFF WWK",
			"capacity_used": 0,
			"task_start_finish_time": 0,
			"wol_operation_time": 1559895464,
			"idle_time": 1559895464,
			"busy_time": 1559895464,
			"host": {
				"capacity": 1100,
				"max_tasks": 10,
				"power": 1000,
				"os": "windows 64",
				"nimby_idle_cpu": 10,
				"nimby_busy_cpu": 50,
				"nimby_idle_mem": 50,
				"nimby_busy_mem": 90,
				"nimby_idle_swp": 30,
				"nimby_busy_swp": 80,
				"nimby_idle_hddgb": 1,
				"nimby_busy_hddgb": 1,
				"nimby_idle_hddio": 50,
				"nimby_busy_hddio": 95
			}
		}, {
			"tasks_percents": [-1],
			"name": "d102-01",
			"id": 184,
			"priority": 99,
			"user_name": "rendf1",
			"time_register": 1559894602,
			"time_launch": 1559894712,
			"time_update": 1559895464,
			"address": {
				"family": 4,
				"ip": "10.6.111.34",
				"port": 0
			},
			"netifs": [{
				"name": "{54011075-23DC-402C-831C-1257798542CC}",
				"mac": "b4:b5:2f:e0:7a:cb",
				"addresses": [{
					"family": 4,
					"ip": "10.6.111.0",
					"port": 0
				}, {
					"family": 4,
					"ip": "10.6.111.34",
					"port": 0
				}, {
					"family": 4,
					"ip": "10.6.111.255",
					"port": 0
				}, {
					"family": 4,
					"ip": "224.0.0.0",
					"port": 0
				}, {
					"family": 4,
					"ip": "255.255.255.255",
					"port": 0
				}]
			}],
			"engine": "2.3.1",
			"st": 9,
			"state": " ONL RUN",
			"capacity_used": 1000,
			"task_start_finish_time": 1559895464,
			"wol_operation_time": 1559894712,
			"idle_time": 1559895464,
			"busy_time": 1559895419,
			"tasks": [{
					"name": " {
						"name": "d104-01",
						"id": 1,
						"pri",
						"service": "wakeonlan",
						"capacity": 1000,
						"time_start": 1559895464,
						"user_name": "d104-01",
						"block_name": "wake-on-lan",
						"job_name": "d104-01",
						"job_id": 1,
						"block_num": 1,
						"task_num": 0
					}], "host": {
					"capacity": 1100,
					"max_tasks": 10,
					"power": 1000,
					"os": "windows 64",
					"nimby_idle_cpu": 10,
					"nimby_busy_cpu": 50,
					"nimby_idle_mem": 50,
					"nimby_busy_mem": 90,
					"nimby_idle_swp": 30,
					"nimby_busy_swp": 80,
					"nimby_idle_hddgb": 1,
					"nimby_busy_hddgb": 1,
					"nimby_idle_hddio": 50,
					"nimby_busy_hddio": 95
				}
			}]
	}
After running it through a JSON validator it comes up with the following error lines:

Code: Select all

"name": "{ "

Code: Select all

"pri":,

Code: Select all

"task_num ": 0
}],
"host ": {
"capacity ": 1100,
and possibly a few others

I'm not sure if this is something I have broken in a configuration file, but it appears to be affecting all nodes.
Any ideas would be greatly appreciated!
Rich
CGRU 2.3.1, Server - Win 2012 R2, ~300x Render Nodes - Windows 10.

User avatar
timurhai
Site Admin
Posts: 490
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Error: JSON.parse

Post by timurhai » Fri Jun 07, 2019 9:47 am

Hi.
Some parts of a JSON were cut off.

Code: Select all

"tasks": [{
					"name": " {
						"name": "d104-01",
- in tasks list new render object started.

How did you got that JSON? Who reads it?

ps
There is no config option to make server to mix JSON parts.

pss
Better to write a useful signature like me.
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

belegdae
Posts: 7
Joined: Tue May 28, 2019 2:10 pm

Re: Error: JSON.parse

Post by belegdae » Fri Jun 07, 2019 10:42 am

Hi Timur,

It is printed into the WebGUI after triggering a Wake-on-Lan job from the web GUI, along with other WWK job machines erroring too.

It might be related, the wolwake job errors as follows:

Code: Select all

Fri 07 Jun 10:10.25 : Error task output:
=======================================================
['C:\\_PLUGINS\\CGRU\\utilities\\wolwake.py', '--wake', '--ip', '10.6.111.98', '--hostname', 'd104-07', 'c8d3ffbe99bc']
No mac address(es) specified.
Usage C:\_PLUGINS\CGRU\utilities\wolwake.py --(wake|sleep) --ip IP mac1 mac2 .. macN
MAC address(es) should be without any separators, just a string of 12 characters.
=======================================================
Fri 07 Jun 10:10.25 : #1: Automatically retrying error task4 of 9.: d104-07: "d104-07":
{
"name":"d104-07",
"id":13,
"priority":99,
"user_name":"rendf1",
"time_register":1559673925,
"time_launch":0,
"time_update":1559880941,
"address":{"family":4,"ip":"10.6.111.98","port":0},
"netifs":[
{"name":"{7F94C885-3EE9-4C00-A702-FC83280AAB5D}","mac":"c8:d3:ff:be:99:bc","addresses":[{"family":4,"ip":"10.6.111.0","port":0},{"family":4,"ip":"10.6.111.98","port":0},{"family":4,"ip":"10.6.111.255","port":0},{"family":4,"ip":"224.0.0.0","port":0},{"family":4,"ip":"255.255.255.255","port":0}]}
],
"engine":"2.3.1",
"st":384,
"state":" OFF WWK PAU",
"capacity_used":0,
"task_start_finish_time":0,
"wol_operation_time":1559898609,
"idle_time":1559898608,
"busy_time":1559898608,
"host":{
"capacity":1100,
"max_tasks":10,
"power":1000,
"os":"windows 64",
"nimby_idle_cpu":10,
"nimby_busy_cpu":50,
"nimby_idle_mem":50,
"nimby_busy_mem":90,
"nimby_idle_swp":30,
"nimby_busy_swp":80,
"nimby_idle_hddgb":1,
"nimby_busy_hddgb":1,
"nimby_idle_hddio":50,
"nimby_busy_hddio":95
}
Thanks again for all your help!
Rich
CGRU 2.3.1, Server - Win 2012 R2, ~300x Render Nodes - Windows 10.

User avatar
timurhai
Site Admin
Posts: 490
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Error: JSON.parse

Post by timurhai » Fri Jun 07, 2019 6:57 pm

What WEB browser are you using?
Anyway try some other one, this error happens?
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

User avatar
timurhai
Site Admin
Posts: 490
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Error: JSON.parse

Post by timurhai » Fri Jun 07, 2019 7:02 pm

Just read your signature..
300 windows clients on a windows server!!!
I bet that you are the first who did it!
For a such amount of clients i want to recommend Linux server.
If you can run soft Linux - it is definitely better to use Linux on clients too.
Linux is much more better for networks.
( You can work on Windows and use Linux farm, such way is widely used, Afanasy has paths map mechanisms )
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

belegdae
Posts: 7
Joined: Tue May 28, 2019 2:10 pm

Re: Error: JSON.parse

Post by belegdae » Sat Jun 08, 2019 8:41 am

Hey Timur,

I've recorded a video of what happens in various browsers:
https://i.imgur.com/du3Nnhh.mp4

Shown in the video is Chrome, Internet Explorer and Firefox.

Other commands like reboot, launch command appear to work fine with "action processed"

We're a univeristy, and our layout is 400 workstations without dedicated farm machines.
The workstations go Nimby on login, and free on logoff. I don't have any control over the OS's used sadly!
Rich
CGRU 2.3.1, Server - Win 2012 R2, ~300x Render Nodes - Windows 10.

User avatar
timurhai
Site Admin
Posts: 490
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Error: JSON.parse

Post by timurhai » Mon Jun 10, 2019 9:18 am

Hi.
Ok! I will check it. Looks like a bug on server.

Also, you can try afwatch (Qt GUI) - it is much faster, may be better on a big amount of clients.
And you can try Linux for afserver only.
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

User avatar
timurhai
Site Admin
Posts: 490
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Error: JSON.parse

Post by timurhai » Mon Jun 10, 2019 8:34 pm

Hi.
I reproduced the same bug on Linux server with a Linux client.
So OS does not matter here.
Will dig it deeper.
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

User avatar
timurhai
Site Admin
Posts: 490
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Error: JSON.parse

Post by timurhai » Tue Jun 11, 2019 9:02 am

Hi.

Yes it is a bug in afserver:
https://github.com/CGRU/cgru/blob/maste ... ob.cpp#L54
If task name is not specified, we can't just use a beginning of a command for it, as command can contain JSON data with a special characters.
So now, we can fix it.

Were have you got an afserver binary?
From a release archive?
Can you compile it yourself?

btw
This bug can't hung an afserver or a GUI, may be you can simple ignore it? Or it bothers you much?
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

belegdae
Posts: 7
Joined: Tue May 28, 2019 2:10 pm

Re: Error: JSON.parse

Post by belegdae » Tue Jun 11, 2019 11:30 am

Hey Timur,

Binaries from sourceforge:
http://sourceforge.net/projects/cgru/fi ... p/download

It's not an essential feature for me, I just wanted to make sure it wasn't having other unexpected effects!

I've not compiled before, but not afraid to look into it! Thank you!
Rich
CGRU 2.3.1, Server - Win 2012 R2, ~300x Render Nodes - Windows 10.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest