ISISComputingGroup / IBEX

Top level repository for IBEX stories
5 stars 2 forks source link

Blockserver: Bug in saving configs #1626

Closed John-Holt-Tessella closed 4 years ago

John-Holt-Tessella commented 8 years ago

I got the following:

[Mon Sep 19 11:54:11 2016] INFO: Saving component: simple
[Mon Sep 19 11:54:11 2016] INFO: Adding PV BLOCKSERVER:SIMPLE:GET_COMPONENT_DETAILS
[Mon Sep 19 11:54:11 2016] INFO: Adding PV BLOCKSERVER:SIMPLE:DEPENDENCIES
[Mon Sep 19 11:54:11 2016] UPDATING CONFIG LIST MONITORS
[Mon Sep 19 11:54:11 2016] INFO: Saved
[Mon Sep 19 11:54:29 2016] CA exception in thread w/o CA ctx: status=User specified timeout on IO operation expired file=src/_ca314.cpp line=1612: 

[Mon Sep 19 11:54:29 2016] py_pend_ioUnable to find PV IN:DEMO:CS:IOCS
[Mon Sep 19 11:54:29 2016] INFO: Restarting IOC SIMPLE
[Mon Sep 19 11:54:31 2016] INFO: Setting IOC SIMPLE's auto-restart to False
[Mon Sep 19 11:54:31 2016] INFO: Toggling auto-restart for IOC SIMPLE
[Mon Sep 19 11:54:31 2016] Creating block: INST_LIST for CS:INSTLIST
[Mon Sep 19 11:54:31 2016] Creating block: invalid for INVALID
[Mon Sep 19 11:54:31 2016] Creating block: val1_simple for SIMPLE:VALUE1
[Mon Sep 19 11:54:31 2016] Creating block: simple_2 for SIMPLE:VALUE2
[Mon Sep 19 11:54:31 2016] Creating block: SIMPLE_IN_COMPOENT for NDW1407:HGV27692:SIMPLE:VALUE1
[Mon Sep 19 11:54:31 2016] INFO: Reloading gateway
[Mon Sep 19 11:54:31 2016] INFO: Gateway reloaded
[Mon Sep 19 11:54:31 2016] UPDATING CONFIG LIST MONITORS
[Mon Sep 19 11:54:31 2016] INFO: Generating archiver configuration file: C:\Instrument\Apps\EPICS\CSS\master\ArchiveEngine\block_config.xml
[Mon Sep 19 11:54:31 2016] INFO: Running archiver settings uploader: C:\Instrument\Apps\EPICS\CSS\master\ArchiveEngine\set_block_config.bat
[Mon Sep 19 11:54:33 2016] INFO: Reusing the existing run-control autosave files
[Mon Sep 19 11:54:33 2016] INFO: Restarting IOC RUNCTRL_01
[Mon Sep 19 11:54:34 2016] INFO: Auto-restart for IOC RUNCTRL_01 unchanged as value has not changed
[Mon Sep 19 11:54:34 2016] INFO: Waiting for runcontrol IOC to start
[Mon Sep 19 11:54:34 2016] INFO: Runcontrol IOC started
[Mon Sep 19 11:54:34 2016] Unexpected problem with CA circuit to server "NDXDEMO.isis.cclrc.ac.uk:60511" was "An existing connection was forcibly closed by the remote host. " - disconnecting

[Mon Sep 19 11:54:34 2016] CA.Client.Diagnostic.................................

[Mon Sep 19 11:54:34 2016]     Warning: "Virtual circuit disconnect"

[Mon Sep 19 11:54:34 2016] Source File: ..\cac.cpp Line Number: 1215

[Mon Sep 19 11:54:34 2016] .....................................................

[Mon Sep 19 11:54:37 2016] CA exception in thread w/o CA ctx: status=User specified timeout on IO operation expired file=src/_ca314.cpp line=1612: 

[Mon Sep 19 11:54:37 2016] py_pend_ioUnable to find PV IN:DEMO:CS:SB:SIMPLE_IN_COMPOENT:RC:HIGH
[Mon Sep 19 11:54:37 2016] INFO: Problem with setting runcontrol for SIMPLE_IN_COMPOENT: Unable to find PV IN:DEMO:CS:SB:SIMPLE_IN_COMPOENT:RC:HIGH
[Mon Sep 19 11:54:37 2016] UPDATING SYNOPTIC MONITORS
[Mon Sep 19 11:54:37 2016] MINOR: Unable to load devices file. [Errno 2] No such file or directory: u'C:\\Instrument\\Settings\\config\\NDXDEMO\\configurations\\configurations\\Isabella_system_tests_sept16\\screens.xml'. The PV data will default to a blank set of devices.
[Mon Sep 19 11:54:37 2016] UPDATING DEVICES MONITORS
[Mon Sep 19 11:54:37 2016] INFO: Restarting block cache...
[Mon Sep 19 11:54:37 2016] INFO: Restarting IOC BLOCKCACHE
[Mon Sep 19 11:54:37 2016] INFO: Auto-restart for IOC BLOCKCACHE unchanged as value has not changed
[Mon Sep 19 11:54:37 2016] INFO: Saving active configuration as: Isabella_system_tests_sept16
[Mon Sep 19 11:54:37 2016] UPDATING CONFIG LIST MONITORS
[Mon Sep 19 11:55:17 2016] INFO: Saving component: simple
[Mon Sep 19 11:55:17 2016] UPDATING CONFIG LIST MONITORS
[Mon Sep 19 11:55:17 2016] INFO: Saved
[Mon Sep 19 11:55:17 2016] INFO: Trying to load last_configuration Isabella_system_tests_sept16
[Mon Sep 19 11:55:17 2016] Exception in thread Thread-1:

[Mon Sep 19 11:55:17 2016] Traceback (most recent call last):

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\Python\lib\threading.py", line 810, in __bootstrap_inner

[Mon Sep 19 11:55:17 2016]     self.run()

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\Python\lib\threading.py", line 763, in run

[Mon Sep 19 11:55:17 2016]     self.__target(*self.__args, **self.__kwargs)

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\\block_server.py", line 675, in consume_write_queue

[Mon Sep 19 11:55:17 2016]     cmd(*arg)

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\\block_server.py", line 571, in save_inactive_config

[Mon Sep 19 11:55:17 2016]     self.load_last_config()

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\\block_server.py", line 407, in load_last_config

[Mon Sep 19 11:55:17 2016]     last = self._active_configserver.load_last_config()

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\BlockServer\core\active_config_holder.py", line 106, in load_last_config

[Mon Sep 19 11:55:17 2016]     self.load_active(last_config)

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\BlockServer\core\active_config_holder.py", line 65, in load_active

[Mon Sep 19 11:55:17 2016]     conf = super(ActiveConfigHolder, self).load_configuration(name, False)

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\BlockServer\core\config_holder.py", line 460, in load_configuration

[Mon Sep 19 11:55:17 2016]     return self._filemanager.load_config(name, self._macros, False)

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\BlockServer\fileIO\file_manager.py", line 111, in load_config

[Mon Sep 19 11:55:17 2016]     self._check_againgst_schema(correct_xml, FILENAME_IOCS)

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\BlockServer\fileIO\file_manager.py", line 159, in _check_againgst_schema

[Mon Sep 19 11:55:17 2016]     ConfigurationSchemaChecker.check_xml_data_matches_schema(schema_path, xml)

[Mon Sep 19 11:55:17 2016]   File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\BlockServer\fileIO\schema_checker.py", line 71, in check_xml_data_matches_schema

[Mon Sep 19 11:55:17 2016]     raise ConfigurationInvalidUnderSchema(str(err.message))

[Mon Sep 19 11:55:17 2016] ConfigurationInvalidUnderSchema: "Element '{http://epics.isis.rl.ac.uk/schema/iocs/1.0}pv', attribute 'name': 'NEW_PV^&*ASD^&8' is not a valid value of the atomic type '{http://epics.isis.rl.ac.uk/schema/iocs/1.0}pvname'."

[Mon Sep 19 11:55:17 2016] 

After trying to edit current configuration from my machine on Demo. The whole blockserver now seems to be dead. I was trying to add a component to it. The configuration was:

<?xml version="1.0" ?>
<iocs xmlns="http://epics.isis.rl.ac.uk/schema/iocs/1.0" xmlns:ioc="http://epics.isis.rl.ac.uk/schema/iocs/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
    <ioc autostart="false" name="AG33220A_01" restart="false" simlevel="none">
        <macros/>
        <pvs>
            <pv name="NEW_PV" value="NEW_VALUE"/>
            <pv name="NEW_PV^&amp;*ASD^&amp;8" value="NEW_VALUE&amp;*(&amp;*("/>
        </pvs>
        <pvsets/>
    </ioc>
    <ioc autostart="false" name="GALIL_01" restart="false" simlevel="none">
        <macros/>
        <pvs/>
        <pvsets>
            <pvset enabled="True" name="Motor Limits"/>
        </pvsets>
    </ioc>
    <ioc autostart="false" name="GALIL_02" restart="false" simlevel="none">
        <macros/>
        <pvs/>
        <pvsets>
            <pvset enabled="True" name="Motor Limits"/>
        </pvsets>
    </ioc>
    <ioc autostart="false" name="MCLEN_01" restart="false" simlevel="devsim">
        <macros>
            <macro name="PORT1" value="COM1"/>
            <macro name="MTRCTRL" value="1"/>
        </macros>
        <pvs/>
        <pvsets/>
    </ioc>
    <ioc autostart="false" name="MCLEN_02" restart="false" simlevel="devsim">
        <macros>
            <macro name="PORT2" value="COM1"/>
            <macro name="MTRCTRL" value="2"/>
        </macros>
        <pvs/>
        <pvsets/>
    </ioc>
    <ioc autostart="false" name="MCLEN_03" restart="false" simlevel="devsim">
        <macros>
            <macro name="PORT3" value="COM1"/>
            <macro name="MTRCTRL" value="3"/>
        </macros>
        <pvs/>
        <pvsets/>
    </ioc>
    <ioc autostart="true" name="SIMPLE" restart="true" simlevel="none">
        <macros/>
        <pvs/>
        <pvsets/>
    </ioc>
</iocs>

Simple component was:

<?xml version="1.0" ?>
<iocs xmlns="http://epics.isis.rl.ac.uk/schema/iocs/1.0" xmlns:ioc="http://epics.isis.rl.ac.uk/schema/iocs/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
    <ioc autostart="true" name="SIMPLE" restart="false" simlevel="none">
        <macros/>
        <pvs/>
        <pvsets/>
    </ioc>
</iocs>
AdrianPotter commented 6 years ago

Presumably the issue was that the config has SIMPLE, and so does the component. Although I can create a similar structure and it doesn't crash. It does beg the question as to what should happen in this case. As far as the config editor is concerned, it can do both:

image

AdrianPotter commented 6 years ago

It seems from my limited tests that the config wins, but it's not clear whether that's always the case.

John-Holt-Tessella commented 6 years ago

I think config should always win.

DominicOram commented 4 years ago

I believe this is fixed by https://github.com/ISISComputingGroup/IBEX/issues/4202 and https://github.com/ISISComputingGroup/IBEX/issues/4540