Gateway Crash and Restart after Report Execute Script

v8.1.27

I just ran into a really weird gateway issue right after I tested a simple script to print a report. Below is the button onActionPerformed script.

I tested it, and I noticed the gateway immediately restart. I didn't realize that this script was the "problem" until it restarted the gateway again the next time, I tested it. I tried the same script on another gateway that is mirrored to the one that restarts, and it runs perfect and the gateway doesn't restart.

def runAction(self, event):
	plant = self.session.custom.plant
	department = self.view.params.department
	user = self.getSibling("User").props.value
	
	printer = 'P1Engineer'
	
#	if plant == 1:
#		if department == 'sewing':
#			printer = 'P1Sewing'
#		elif department == 'staging':
#			printer = 'P1Staging'
#	elif plant == 5:
#		printer = 'P5Office'
	
	system.report.executeAndDistribute(
		path='Employee_Label', 
		action = 'print', 
		actionSettings = {'primaryPrinterName':printer, 'copies':1}
	)
		
	self.getSibling("Result").props.text = 'Sent to %s' % printer
	
	self.getSibling("Cancel").meta.visible = False
	self.getSibling("Confirm").meta.visible = False

The last time I tried the script which forced a restart, the gateway has no logs until it starts to start up again. I have never seen this happen, and it is very strange.

My guess would be the report is the problem; depending on your version there could be some bugs where a 'bad' report could end up growing to infinite (or thousands) of pages and instantly sucking up a lot of memory, only to be killed by the OS ungracefully. There may be hs_err.pid.log files in the Ignition install directory with more info.

2 Likes

The funny thing though, is that I'm displaying the same report in a perspective report viewer with no issues. The report has a single query that returns a single row, and I've been using it for months and has not been changed.

The report executes and prints fine, then the gateway restarts afterwards. Works perfect on the other gateway, so it doesn't seem easily reproducible. I do have an hs_err.pid.log file in my install directory, I guess I should contact support.