Elettra AlarmHandler crash

Hi I am trying to configure an alarm on Elettra alarm handler using Panic. I have installed Panic version 6.5.1 and built Elettra Alarm Handler from Elettra git repository. As per recommendation, I have also renamed the tango class from AlarmHandler to PyAlarm.
I can see my alarm server is detected by Panic.
When I try to create a new alarm and click on Save button, the alarm server process crashes. There is not much information on the console. Attaching a screenshot of the alarm handler console.
Please help me with this.
Here are some logs on the Panic console:


onSave()<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
getDataFields(testtag): {'description': 'test description', 'receivers': '', 'tag': 'testtag', 'device': 'pyalarm-srv/01/01', 'formula': 'testdevice/01/01/attr2 = false', 'severity': 'WARNING'}
>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#
In saveData()
getDataFields(testtag): {'description': 'test description', 'receivers': '', 'tag': 'testtag', 'device': 'pyalarm-srv/01/01', 'formula': 'testdevice/01/01/attr2 = false', 'severity': 'WARNING'}
********************************************************************************
<fandango.qt.QDropTextEdit object at 0x7fca3008f348> => testdevice/01/01/attr2 = false
In AlarmFormula.updateFormula(testdevice/01/01/attr2 = false,changed=True)
	Alarm doesn't exist… creating new
In Alarm(testtag).write(): line added: testtag:testdevice/01/01/attr2 = false
In Alarm(testtag).write(): line added: testtag:
In Alarm(testtag).write(): line added: testtag:test description
In Alarm(testtag).write(): line added: testtag:WARNING
Device pyalarm-srv/01/01 is not running
AlarmForm.setCurrentAlarm(Alarm(testtag:pyalarm-srv/01/01:0))
AlarmForm.setAlarmData(Alarm(testtag:pyalarm-srv/01/01:0))
********************************************************************************
<fandango.qt.QDropTextEdit object at 0x7fca3008f348> => testdevice/01/01/attr2 = false
In AlarmFormula.updateFormula(testdevice/01/01/attr2 = false,changed=True)
AlarmValueLabel.setModel(<class 'panic.alarmapi.Alarm'>(Alarm(testtag:pyalarm-srv/01/01:0)))
AlarmForm(testtag).valueChanged(True,False)
2018-10-27 16:00:22:AlarmDS(pyalarm-srv/01/01).get_version(): device not running
pyalarm-srv/01/01/DisabledAlarms WARNING 2018-10-27 16:00:22.514: read_hw(): pyalarm-srv/01/01 not running!
pyalarm-srv/01/01/AcknowledgedAlarms WARNING 2018-10-27 16:00:22.514: read_hw(): pyalarm-srv/01/01 not running!
('\tdis,ack = ', (False, False))
AlarmForm(testtag).valueChanged(False,False)
Out of saveNewData()
In AlarmFormula.onEdit(False)
********************************************************************************
<fandango.qt.QDropTextEdit object at 0x7fca3008f348> => testdevice/01/01/attr2 = false
In AlarmFormula.updateFormula(testdevice/01/01/attr2 = false,changed=False)
In AlarmFormula.undoEdit()
********************************************************************************
<fandango.qt.QDropTextEdit object at 0x7fca3008f348> => testdevice/01/01/attr2 = false
In AlarmFormula.updateFormula(testdevice/01/01/attr2 = false,changed=False)
********************************************************************************
<fandango.qt.QDropTextEdit object at 0x7fca3008f348> => testdevice/01/01/attr2 = false
In AlarmFormula.updateFormula(testdevice/01/01/attr2 = false,changed=False)
AlarmForm(testtag).valueChanged(False,False)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Can you try and run the AlarmHandler device in foregroung with -v4 or -v5 to catch the server output?
Yes. Please check the attached log file.
Hi Lochan,
if you look at the last 20 lines of the log… seems that the Init() method has been called on the device. It is properly executing delete_device() and should then reinitialize, e.g. execute init_device(). Is the log complete?
Edited 5 years ago
Yes. The log is complete. My device server was already running. So this call to init method seems redundant. Also, I want the device server to continue running after alarm configuration. So ideally delete device method should not get called.
One more thing I noticed is, it is printing 'Core dumped' message as well.
Hi Lochan, Lorenzo

In principle, it should not be needed to rename the AlarmHandler to PyAlarm; Panic should be able to connect to the AlarmHandler anyway.

Init() is executed because it is the default way to reload properties on PyAlarm; in the case of AlarmHandler I can do a restart using Starter if this solution is fine for you.

If this solution is fine I can upload a patch,

Sergi
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Hi Sergi,
in the case of AlarmHandler I suppose there is no need to reload properties… the methods for adding an alarm take care of updating the runtime data structures *and* inserting the line in the properties for the next device startup… but there is no need to Init/Restart… (which will eventually cause unsubscribing to all events, cleanup of all runtime data structures etc…).

I just pushed the changes to develop so you can test them

Sergi
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Hi Sergi.
I would like to understand better: are you adding a new alarm in the AlarmHandler writing the attribute properties and then trying to restart the device? This should be possible (except for bug in the AlarmHandler Init method to be analyzed) but as Lorenzo said calling the Load command should be the preferred way when the device is already running.

I hope I will have time to check your changes next days.

Graziano

 
Register or login to create to post a reply.