archiveRunConfiguration doesn't let calling programs know it wasn't able to save a FHiCL document
Just a little while ago I filed DAQInterface Issue #23244, since under certain circumstances DAQInterface creates a boot.fcl file which contains illegal FHiCL syntax and consequently doesn't get saved to the database. I only uncovered this as part of regression testing and was trying to figure out why this problem had flown under the radar; what I discovered is that the archiveRunConfiguration function from conftool returns True even if it can't save boot.fcl and prints out an error message:
Caught fhicl::exception message=---- Parse error BEGIN detected at or near line 28, character 35, of file "-" trigcand600_tpwindow_inputs_keys: "["felix601","felix602","felix603","felix604","felix605","felix606","felix607","felix608","felix609","felix610"]" ^ ---- Parse error END
While a message like this is useful for a human to read, for a calling program like DAQInterface, there should be another way to alert it that there was a problem. DAQInterface assumes that if archiveRunConfiguration returns True, then there wasn't a problem, but that doesn't appear to be the case.
#2 Updated by Gennadiy Lukhanin about 1 month ago
- % Done changed from 0 to 90
- Status changed from New to Work in progress
Fixed error reporting in the bulkloader and bulkdownloader applications.
Please follow the steps below to test this bugfix.¶
- Install the e17:s82:prof variant of artdaq_demo v3_06_00.
- Download and install artdaq_database v1_4_76 with the same qualifiers from scisoft.
- Open two shells and setup artdaq_database in both of them.
- source [your-artdaq-products-area]/setup
- setup artdaq_database v1_04_76 -q e17:prof:s82
- export ARTDAQ_DATABASE_URI=mongodb://127.0.0.1/artdaqtest_db
- In the first shell start mongodb.
- mkdir -p $HOME/database/mongodb
- mongod --dbpath=$HOME/database/mongodb --bind_ip=127.0.0.1
- leave mongod running in the foreground
- Switch to the second shell, which will be used for running conftool.py and confirm that the test database is accessible.
- conftool.py readDatabaseInfo
- Create a working directory for configuration files and copy a test configuration into it.
- mkdir -p $HOME/database/work-dir/aa/
- cp -r [your-test-configuration] $HOME/database/work-dir/aa/
- cd $HOME/database/work-dir/aa/
- Archive your good configuration into the run history database.
- conftool.py archiveRunConfiguration mygoodconfig 1
- confirm that the last printed line says "True" and the "echo $?" prints "0"
- Now change the contents of any configuration file in the $HOME/database/work-dir/aa/ directory to be invalid fhicl.
- Archive your broken configuration into the run history database.
- conftool.py archiveRunConfiguration mybrokenconfig 1
- confirm that the last printed line says "False" and the "echo $?" prints "1"