# Gateway error: Received event for missing view "Audit1\_SP@C"

**URL:** <https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 30, 2022, 6:47pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102 "2022-11-30T18:47:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Coleman](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Coleman](https://forum.inductiveautomation.com/u/Michael_Coleman)\
**Post date:** [November 30, 2022, 6:47pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/1 "2022-11-30T18:47:04Z")

</div>

I am receiving a gateway error: "Received event for missing view 'Audit1\_SP@C"'. The script is taking the drop down box answers and dumping them into a SQL database. The script works in preview mode on the Ignition designer, but I receive the error when I run the script online. I have attached a screen shot of the error below.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a758b87bba4e596df40285ce1d315a3bca8d63ba.png)

---

<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:** [November 30, 2022, 6:49pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/2 "2022-11-30T18:49:27Z")

</div>

Is the named view the one running the script? Is there a close or navigation action also firing? Actions run in parallel, so the timing from a real client could be faster than the designer.

Show your code.

---

<div class="post-metadata">

**Author:** ![Michael\_Coleman](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Coleman](https://forum.inductiveautomation.com/u/Michael_Coleman)\
**Post date:** [November 30, 2022, 6:53pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/3 "2022-11-30T18:53:05Z")

</div>

Here is a screen shot of the script & navigation:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/57cd7585e65e084886181b77e88f34543956efca.png)

There is a navigation to a different URL. The script is pulling from two different views.

---

<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:** [November 30, 2022, 6:53pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/4 "2022-11-30T18:53:57Z")

</div>

Try removing the navigation action and using the equivalent at the end of the script.

---

<div class="post-metadata">

**Author:** ![Michael\_Coleman](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Coleman](https://forum.inductiveautomation.com/u/Michael_Coleman)\
**Post date:** [November 30, 2022, 6:58pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/5 "2022-11-30T18:58:13Z")

</div>

I removed the navigation, and I received the same error.

---

<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:** [November 30, 2022, 7:44pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/6 "2022-11-30T19:44:54Z")

</div>

Please show the whole script, pasted as text here, and then formatted with the "pre-formatted text" button (so the indentation and punctuation is preserved).

---

<div class="post-metadata">

**Author:** ![Michael\_Coleman](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Coleman](https://forum.inductiveautomation.com/u/Michael_Coleman)\
**Post date:** [November 30, 2022, 8:08pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/7 "2022-11-30T20:08:37Z")

</div>

```auto
	Time = system.date.now()
	MachineNumber = self.session.custom.MachineNumberSP
	PPE = self.session.custom.PPESP[0]  
	StartStopSwitch = self.session.custom.switchSP[0] 
	Swept = self.session.custom.SweptSP[0] 
	Trips = self.session.custom.TripsSP[0]
	Desk = self.session.custom.DeskSP[0]
	PaperWork = self.session.custom.PaperWorkSP[0] 
	YarnLot = self.session.custom.YarnlotSP[0]  
	MergeLot = self.session.custom.MergeLotSP[0]  
	BackingNumber = self.session.custom.BackingNumberSP[0]  
	PatternVStandard = self.session.custom.PatternVStandardSP[0]    
	PileHeight = self.session.custom.PileHeightSP[0]
	StitchCount = self.session.custom.StitchSP[0]
	Sidelight = self.session.custom.SidelightSP[0]
	CombLoops = self.session.custom.CombloopsSP[0]   
	Mendgun = self.session.custom.MendgunSP[0]    
	Lines = self.session.custom.LinesSP[0]    
	CrossedEnds = self.session.custom.CrossedEndsSP[0]  
	BowSkew = self.session.custom.BowSP[0]   
	StopMark = self.session.custom.StopSP[0]  
	DropEyes = self.session.custom.DropEyesSP[0] 
	CenterLine = self.session.custom.CenterlineSP[0]
	BackingJack = self.session.custom.BackingJackSP[0]  
	BladeBlocks = self.session.custom.BladeBlocksSP[0]     

	#system.db.runPrepUpdate("INSERT INTO Tufting_Audit_Table (MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, BladeBlocks) Values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",[MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, Bladeblocks])
	
	system.db.runPrepUpdate("INSERT INTO Tufting_Machine_Audit ([Time Submitted], MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, BladeBlocks) Values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",[Time, MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, BladeBlocks])
	
	self.session.custom.MachineNumberSP = ' '
	self.session.custom.PPESP = ' '  
	self.session.custom.switchSP = ' ' 
	self.session.custom.SweptSP = ' '
	self.session.custom.TripsSP = ' '
	self.session.custom.DeskSP = ' '
	self.session.custom.PaperWorkSP = ' ' 
	self.session.custom.YarnlotSP = ' '  
	self.session.custom.MergeLotSP = ' '
	self.session.custom.BackingNumberSP = ' '  
	self.session.custom.PatternVStandardSP = ' '    
	self.session.custom.PileHeightSP = ' '
	self.session.custom.StitchSP = ' '
	self.session.custom.SidelightSP = ' '
	self.session.custom.CombloopsSP = ' '   
	self.session.custom.MendgunSP = ' '    
	self.session.custom.LinesSP = ' '    
	self.session.custom.CrossedEndsSP = ' '  
	self.session.custom.BowSP = ' '   
	self.session.custom.StopSP = ' '  
	self.session.custom.DropEyesSP = ' ' 
	self.session.custom.CenterlineSP = ' '
	self.session.custom.BackingJackSP = ' '
	self.session.custom.BladeBlocksSP = ' '   

```

---

<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:** [November 30, 2022, 8:19pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/8 "2022-11-30T20:19:17Z")

</div>

Hmmm. I'm stumped. Look for other scripts being activated that are causing navigation anyways. **Something** is making that view cease to exist.

---

<div class="post-metadata">

**Author:** ![Michael\_Coleman](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Coleman](https://forum.inductiveautomation.com/u/Michael_Coleman)\
**Post date:** [December 1, 2022, 12:12pm UTC](https://forum.inductiveautomation.com/t/gateway-error-received-event-for-missing-view-audit1-sp-c/67102/9 "2022-12-01T12:12:49Z")

</div>

The script that is running is very similar to another script. The scripts are dumping the data into the same SQL table "Tufting\_Machine\_Audit". The difference between the two views is one is English & the other is Spanish.

Here is the English script:

```auto
	Time = system.date.now()
	MachineNumber = self.session.custom.MachineNumber
	PPE = self.session.custom.PPE[0]  
	StartStopSwitch = self.session.custom.switch[0] 
	Swept = self.session.custom.Swept[0] 
	Trips = self.session.custom.Trips[0]
	Desk = self.session.custom.Desk[0]
	PaperWork = self.session.custom.PaperWork[0] 
	YarnLot = self.session.custom.Yarnlot[0]  
	MergeLot = self.session.custom.MergeLot[0]  
	BackingNumber = self.session.custom.BackingNumber[0]  
	PatternVStandard = self.session.custom.PatternVStandard[0]    
	PileHeight = self.session.custom.PileHeight[0]
	StitchCount = self.session.custom.Stitch[0]
	Sidelight = self.session.custom.Sidelight[0]
	CombLoops = self.session.custom.Combloops[0]   
	Mendgun = self.session.custom.Mendgun[0]    
	Lines = self.session.custom.Lines[0]    
	CrossedEnds = self.session.custom.CrossedEnds[0]  
	BowSkew = self.session.custom.Bow[0]   
	StopMark = self.session.custom.Stop[0]  
	DropEyes = self.session.custom.DropEyes[0] 
	CenterLine = self.session.custom.Centerline[0]
	BackingJack = self.session.custom.BackingJack[0]  
	BladeBlocks = self.session.custom.BladeBlocks[0]       

	#system.db.runPrepUpdate("INSERT INTO Tufting_Audit_Table (MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, BladeBlocks) Values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",[MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, Bladeblocks])
	
	system.db.runPrepUpdate("INSERT INTO Tufting_Machine_Audit ([Time Submitted], MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, BladeBlocks) Values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",[Time, MachineNumber, PPE, StartStopSwitch, Swept, Trips, Desk, PaperWork, YarnLot, MergeLot, BackingNumber, PatternVStandard, PileHeight, StitchCount, Sidelight, CombLoops, Mendgun, Lines, CrossedEnds, BowSkew, StopMark, DropEyes, CenterLine, BackingJack, BladeBlocks])
	
	self.session.custom.MachineNumber = ' '
	self.session.custom.PPE = ' '  
	self.session.custom.switch = ' ' 
	self.session.custom.Swept = ' '
	self.session.custom.Trips = ' '
	self.session.custom.Desk = ' '
	self.session.custom.PaperWork = ' ' 
	self.session.custom.Yarnlot = ' '  
	self.session.custom.MergeLot = ' '
	self.session.custom.BackingNumber = ' '  
	self.session.custom.PatternVStandard = ' '    
	self.session.custom.PileHeight = ' '
	self.session.custom.Stitch = ' '
	self.session.custom.Sidelight = ' '
	self.session.custom.Combloops = ' '   
	self.session.custom.Mendgun = ' '    
	self.session.custom.Lines = ' '    
	self.session.custom.CrossedEnds = ' '  
	self.session.custom.Bow = ' '   
	self.session.custom.Stop = ' '  
	self.session.custom.DropEyes = ' ' 
	self.session.custom.Centerline = ' '
	self.session.custom.BackingJack = ' '
	self.session.custom.BladeBlocks = ' '  

```
