# Help interpreting a traceback

**URL:** <https://forum.inductiveautomation.com/t/help-interpreting-a-traceback/76335>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [July 13, 2023, 3:53pm UTC](https://forum.inductiveautomation.com/t/help-interpreting-a-traceback/76335 "2023-07-13T15:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![L\_F](https://avatars.discourse-cdn.com/v4/letter/l/5f8ce5/32.png) [@L\_F](https://forum.inductiveautomation.com/u/L_F)\
**Post date:** [July 13, 2023, 3:53pm UTC](https://forum.inductiveautomation.com/t/help-interpreting-a-traceback/76335/1 "2023-07-13T15:53:17Z")

</div>

I have half a dozen timre scripts running on my gateway. In the last week 2 copies of my project were made on the gateway. I needed to make some changes to the scripts, and noticed the changes not taking. I disabled the project copies and now the scripts have completely crashed. Just about every script is reporting the some version of the following error to my logs with cahnges to the line called out:

```auto
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 23, in SyntaxError: ("no viable alternative at input 'json'", ('', 463, 20, '\treturn stateimport json\n'))

```

I don't know where to begin troubleshooting this guy. Below is the script reporting the above traceback. I've removed a bunch of comments, but the 1st line of the code corresponds to line 23 of the script.

```auto
values = system.tag.readBlocking(tagPathUtil.mcrTagPaths) #Retireve tag values. (line 23)

valList = [] #Create an empty list object
for i in range(len(values)): #For each index of an object in the list:
	if values[i].value: #	If the value of the object in the list is 1
		valList.append(1) # Append 1 to the end of the list
	else: #	Else if the value of the object in the list is a 0
		valList.append(0) # Append 0 to the end of the list
valList.append(system.date.now())	#Add a timestamp to the end of the list
packet = str(valList) #Convert the list to a string for transmission (requested by MCR)

if mcrUtil.needContext(): #Check if new context is needed
	for server in mcrUtil.serverList: #For each server in the server list, try to retrieve a context value
		mcrUtil.context = mcrUtil.mcrGetContext(server = server, repTags = tagPathUtil.mcrErrTags)
		if mcrUtil.context.good: #If the context request is successful (status code 200)
			mcrUtil.lastGoodServer = server	#Set the last good server variable to the server requested
			break #Exit the FOR loop on the first success

if mcrUtil.context == None: #If the context variable is undefined after context retrieval report
	message = "Set parameter script ended early due to bad context."
	system.util.getLogger('Infrastructure').info(message)
	#quit()				

device = 'sPhenixPlcMon' #The name of the device in the MCR Device Server
parameter = 'transFromPlcS' #The http parameter to be set within the Device Server
ppmuser = '0'
params = { #The dictionary of values
	'name': device, 
	'prop': parameter, 
	'ppmuser': ppmuser, 
	'context': mcrUtil.context.text,	#The context value retrieved in Step 3
	'value': packet #The data string created in Step 2
	}

mcrUtil.mcrPutRequest(params = params, repTags = tagPathUtil.mcrErrTags, server = mcrUtil.lastGoodServer)

```

Please help, some of the most critical aspects of my system are down.  
-Lee

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2023, 3:57pm UTC](https://forum.inductiveautomation.com/t/help-interpreting-a-traceback/76335/2 "2023-07-13T15:57:28Z")

</div>

This code and the error don't seem to line up.

> [@L\_F](#):
>
> Please help, some of the most critical aspects of my system are down.

Call support?

---

<div class="post-metadata">

**Author:** ![L\_F](https://avatars.discourse-cdn.com/v4/letter/l/5f8ce5/32.png) [@L\_F](https://forum.inductiveautomation.com/u/L_F)\
**Post date:** [July 13, 2023, 3:58pm UTC](https://forum.inductiveautomation.com/t/help-interpreting-a-traceback/76335/3 "2023-07-13T15:58:11Z")

</div>

Yeah, I had the feeling. Thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 13, 2023, 4:16pm UTC](https://forum.inductiveautomation.com/t/help-interpreting-a-traceback/76335/4 "2023-07-13T16:16:05Z")

</div>

The content of the parse error suggests that you've accidentally deleted the newline before the `import json`.

---

<div class="post-metadata">

**Author:** ![L\_F](https://avatars.discourse-cdn.com/v4/letter/l/5f8ce5/32.png) [@L\_F](https://forum.inductiveautomation.com/u/L_F)\
**Post date:** [July 13, 2023, 4:55pm UTC](https://forum.inductiveautomation.com/t/help-interpreting-a-traceback/76335/5 "2023-07-13T16:55:57Z")

</div>

I figured it out, and am quite embarrassed. At some point while making changes I managed to copy one of my gateway scripts, in its entirety, to the end of an unused function at the bottom one of my project library files. This included the `import json` statement.

The library was the source of the error which wasn't evident by the contents of the log's traceback. Thankfully the Gateway Scripts tab pointed to the issue more directly. Thanks for taking the time to help, and sorry for the inconvenience. I'll be more thorough next time.
