Gateway Shared Script not updated after save an Publish

scripting
ignition79
#1

We are experiencing a weird behavior I haven’t seen before. We have some gateway scripts, one of them we have a function to send an email as below.

def sendEmail (subject,body,sender, recipients, server):
	try:
		system.net.sendEmail(server, sender, subject, body, 0, recipients)
	except  Exception, ex:
		messagetoSend = "Error sending email: " + str(ex.message)
		shared.GW_Scripts.LogErrorMessage("GW_Scripts.EmailScript", messagetoSend)

we have some tags that trigger events to call the function below.

def CallBadPalletNotification(tagPath):
	try:
		recipients = ['emails']
		sender = "email@company.com"
		server = "mail.server"
		
                "*** Do something ***"
		subject = "A possible bad pallet was detected in line " + str(currentLine)
		body = "A possible \"Bad Pallet\" was detected \r\n"

		  "*** Do more stuff***"

		shared.EmailScript.sendEmail(subject,body,sender,recipients,server)
	
	except  Exception, ex:
		messagetoSend = "Error preparing to send email: " + str(ex.message)
		shared.GW_Scripts.LogErrorMessage("GW_Scripts.CallBadPalletNotification", messagetoSend)

When we change the body contents or the recipients lists and save an publish we see the logs “restarting gateway scripts…” for both [Global] and [project].

image

However when we trigger an event, the recipients and body are still the previous version of the script.

Any ideas??

BTW. Ignition 7.8.4 (b2016082217)

0 Likes

#2

This clearly seems like a bug, but the only thing I can suggest is to upgrade to a recent version and see if it’s fixed already. There were some issues with publishing in the past, so it’s possible.

0 Likes

#3

We are planing the upgrade, however we haven’t been able to find a time window that makes us feel comfortable to perform the upgrade and possible rollback if something doesn’t work.

@Kevin.Herron Do you think if we restart the gateway, the change could be published?

0 Likes

#4

Yes, I think restarting the gateway is likely to work.

0 Likes

#5

There are also possible problems with python object lifetimes, particularly if you are importing from shared or project scripts instead of spelling them out everywhere:

0 Likes