Perspective Session Props:

Hi cmallonee,

Thank you for your reply.
My script is failing because of "self.props.host" is missing from session.
I am getting an error like:
'com.inductiveautomation.perspective.gateway.script' object has no attribute 'host'

And also I am encountering error of missing session custom props.
Below is the image of session custom props created in project.
image

Error of missing session custom prop,


After the error all above mentioned custom props disappears.

So please share any possible solution to counter this error.

Those custom session props do run the risk of not being present because they are dependent on their binding having resolved before they will exist. Do you see the icon which looks like a block with pieces floating away? That means the property is not Persistent. Properties which are not Persistent do not exist until the binding which would determine their value successfully resolves, resulting in an initial value. If the binding fails in any way (or if an associated transform fails), then the property won't exist. To force these properties to always exist for reference, you need to right-click the property and select the Persistent option.

I noticed above that you don't want to force persistence because the properties shouldn't exist until something is scanned - and that's fair - BUT it tells me that you're crafting something incredibly brittle, with potential race conditions where you're referencing props which could potentially not exist in scripts. It's on you to handle these missing values if you do indeed require such a script.

As for the host property, we do have an open ticket to investigate - but we've never been able to replicate the issue internally. When this occurs, do you see any errors in your Gateway logs?

Thanks cmallonee for your reply.
Yes, in gateway logs I can see error of missing host property.
Please find attached screen shot of error in gateway log,


Note: On first line towards right same error message is printed ''com.inductiveautomation.perspective.gateway.script' object has no attribute 'host'

No, that error is to be expected because of the script failure. I was looking to see if the logs contained anything else that might be able to point us to the root cause.

Ok cmallonee .
At this moment, I can see only error which is shared in above reply.