# Script Issue

**URL:** <https://forum.inductiveautomation.com/t/script-issue/12056>\
**Category:** Ignition\
**Created:** [August 22, 2016, 7:56pm UTC](https://forum.inductiveautomation.com/t/script-issue/12056 "2016-08-22T19:56:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.inductiveautomation.com/u/jreynolds)\
**Post date:** [August 22, 2016, 7:56pm UTC](https://forum.inductiveautomation.com/t/script-issue/12056/1 "2016-08-22T19:56:35Z")

</div>

I’m getting this error when I’m trying to run this script. I haven’t seen it before, any ideas?

[code]\<?xml version="1.0" ?\>  
  
  
def onStart(chart, step):  
“”"  
This will run when the step starts, before any  
other action.

```
Arguments:
	chart: A reference to the chart's scope.
	step: A reference to this step's scope.
"""
value0=0
chart.historyID = system.tag.read(chart.tagPath+"/HistoryID").value
system.db.runPrepUpdate("\
	UPDATE\
		PouHeader\
	SET\
		StatusID = 3,\
		KitLocationID = NULL\
	WHERE PHID = ?",
	[chart.phID], chart.databaseName)
system.db.runPrepUpdate("\
	UPDATE\
		CallButtonHistory\
	SET\
		Tstamp_off = ?,\
		TerminationType = 1\
	WHERE\
		CallButtonHistoryID = ?,"
	[system.date.now(), chart.historyID], chart.databaseName)
	
system.tag.write(chart.tagPath+"/Node/09_DORedLight",value0)</start-script>
</step>

```

[/code]

[code] 2:50:25 PM ChartInstance Chart ‘Charlotte/EPS\_R1\_0\_0/ScannerHUD’ aborted in ‘Script[Step:dbUpdate10]’

Traceback (most recent call last):  
File “”, line 20, in onStart  
TypeError: str indices must be integers

at org.python.core.Py.TypeError(Py.java:235)  
at org.python.core.SequenceIndexDelegate.checkIdxAndFindItem(SequenceIndexDelegate.java:74)  
at org.python.core.SequenceIndexDelegate.checkIdxAndGetItem(SequenceIndexDelegate.java:61)  
at org.python.core.PySequence.seq\_\_\_getitem\_\_(PySequence.java:305)  
at org.python.core.PySequence. **getitem** (PySequence.java:301)  
at org.python.pycode._pyx44410.onStart$1(:30)  
at org.python.pycode.pyx44410.call\_function()  
at org.python.core.PyTableCode.call(PyTableCode.java:165)  
at org.python.core.PyBaseCode.call(PyBaseCode.java:301)  
at org.python.core.PyFunction.function\_\_\_call_(PyFunction.java:376)  
at org.python.core.PyFunction. **call** (PyFunction.java:371)  
at org.python.core.PyFunction. **call** (PyFunction.java:361)  
at org.python.core.PyFunction. **call** (PyFunction.java:356)  
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:636)  
at com.inductiveautomation.sfc.elements.steps.StepScriptRunner.invoke(StepScriptRunner.java:46)  
at com.inductiveautomation.sfc.elements.steps.StepScriptRunner.invoke(StepScriptRunner.java:34)  
at com.inductiveautomation.sfc.elements.steps.action.ActionStep.activateStep(ActionStep.java:48)  
at com.inductiveautomation.sfc.elements.StepContainer.onActivateRequested(StepContainer.java:125)  
at com.inductiveautomation.sfc.fsm.element.ElementInactive.action(ElementInactive.java:33)  
at com.inductiveautomation.sfc.fsm.element.ElementInactive.action(ElementInactive.java:8)  
at com.inductiveautomation.sfc.fsm.StateContext.lambda$handleEvent$16(StateContext.java:52)  
at com.inductiveautomation.sfc.fsm.StateContext$$Lambda$570/1970647362.run(Unknown Source)  
at com.inductiveautomation.sfc.api.ExecutionQueue$ThrowableCatchingRunnable.run(ExecutionQueue.java:136)  
at com.inductiveautomation.sfc.api.ExecutionQueue$PollAndExecute.run(ExecutionQueue.java:111)  
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
at java.util.concurrent.FutureTask.run(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)[/code]

---

<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:** [August 22, 2016, 8:15pm UTC](https://forum.inductiveautomation.com/t/script-issue/12056/2 "2016-08-22T20:15:12Z")

</div>

Comma in the wrong place here:

```auto
CallButtonHistoryID = ?,"
      [system.date.now(), chart.historyID], chart.databaseName)
```

Should be outside the quote.

---

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.inductiveautomation.com/u/jreynolds)\
**Post date:** [August 23, 2016, 12:25pm UTC](https://forum.inductiveautomation.com/t/script-issue/12056/3 "2016-08-23T12:25:30Z")

</div>

Yep, that was it. thanks!
