Skip to content

Add error message when failing to load DAQModule plugins - #365

Open
eflumerf wants to merge 5 commits into
developfrom
eflumerf/AddErrorMessage
Open

Add error message when failing to load DAQModule plugins#365
eflumerf wants to merge 5 commits into
developfrom
eflumerf/AddErrorMessage

Conversation

@eflumerf

Copy link
Copy Markdown
Member

Description

Add an ers::error report of DAQModuleCreationFailed to ensure output when running in unit tests.

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature or enhancement (non-breaking change which adds functionality)
  • Optimization (non-breaking change that improves code/performance)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Testing checklist

  • Unit tests pass (e.g. dbt-build --unittest)
  • Minimal system quicktest passes (pytest -s minimal_system_quick_test.py)
  • Full set of integration tests pass (dunedaq_integtest_bundle.sh)
  • Python tests pass if applicable (e.g. python -m pytest)
  • Pre-commit hooks run successfully if applicable (e.g. pre-commit run --all-files)

Comments here on the testing

Further checks

  • Code is commented where needed, particularly in hard-to-understand areas
  • Code style is correct (dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)
  • If applicable, new tests have been added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))

@eflumerf
eflumerf requested a review from bieryAtFnal June 26, 2026 17:54
@eflumerf

Copy link
Copy Markdown
Member Author

Possibly something in DUNE-DAQ/logging#45

@bieryAtFnal bieryAtFnal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm that I see the following message in the output from the appfwk unit tests when I use the code on this branch.

2026-Jun-30 10:57:36,136 ERROR [dunedaq::appfwk::make_module(...) at /home/nfs/biery/dunedaq/30JunFDDevLBIteratorTesting/sourcecode/appfwk/include/appfwk/detail/DAQModule.hxx:48] Failed to create DAQModule error_test of type not_a_real_plugin_name
  IllegalUnderscore. Library specification "not_a_real_plugin_name" contains an illegal underscore.

@eflumerf

Copy link
Copy Markdown
Member Author

I confirm that I see the following message in the output from the appfwk unit tests when I use the code on this branch.

2026-Jun-30 10:57:36,136 ERROR [dunedaq::appfwk::make_module(...) at /home/nfs/biery/dunedaq/30JunFDDevLBIteratorTesting/sourcecode/appfwk/include/appfwk/detail/DAQModule.hxx:48] Failed to create DAQModule error_test of type not_a_real_plugin_name
  IllegalUnderscore. Library specification "not_a_real_plugin_name" contains an illegal underscore.

Wait, this is really interesting! Apparently, the unit test has been testing the wrong thing all this time! The intent was to test trying to load a plugin type that doesn't exist, but apparently we've actually been testing an invalid plugin name format!

@bieryAtFnal

Copy link
Copy Markdown
Contributor

I confirm that I now see two "new" error messages:

2026-Jun-30 11:36:55,152 ERROR [dunedaq::appfwk::make_module(...) at /home/nfs/biery/dunedaq/30JunFDDevLBIteratorTesting/sourcecode/appfwk/include/appfwk/detail/DAQModule.hxx:48] Failed to create DAQModule error_test of type not_a_valid_plugin_name
	was caused by: 2026-Jun-30 11:36:55,152 ERROR [ers::Issue::Issue(...) at /tmp/root/spack-stage/spack-stage-ers-NB_DEV_260630_A9-75xklo2djghuvo5ygosqin2djbaadupl/spack-src/src/Issue.cpp:102] ---- LogicError BEGIN
  IllegalUnderscore. Library specification "not_a_valid_plugin_name" contains an illegal underscore.
  The class name and path to it may not contain an underscore. If this is a configuration error, plase correct it; if the module's class name or its location within its enclosing package really do have an underscore this situation must be rectified.
---- LogicError END

and

2026-Jun-30 11:38:54,476 ERROR [dunedaq::appfwk::make_module(...) at /home/nfs/biery/dunedaq/30JunFDDevLBIteratorTesting/sourcecode/appfwk/include/appfwk/detail/DAQModule.hxx:48] Failed to create DAQModule error_test of type not-a-real-plugin-name
	was caused by: 2026-Jun-30 11:38:54,476 ERROR [ers::Issue::Issue(...) at /tmp/root/spack-stage/spack-stage-ers-NB_DEV_260630_A9-75xklo2djghuvo5ygosqin2djbaadupl/spack-src/src/Issue.cpp:102] ---- Configuration BEGIN
  UnknownPlugin
  ---- Configuration BEGIN
    Library specification "not-a-real-plugin-name" does not correspond to any library in CET_PLUGIN_PATH of type "duneDAQModule"
  ---- Configuration END
  Plugin not-a-real-plugin-name with version Unknown was not registered.
  Perhaps your plugin type is misspelled or is not a plugin recognized by this
  system.
---- Configuration END

@mroda88

mroda88 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Hi all, I was thinking about this after the SWIT meeting yesterday. I think adding these additional messages is not the right way to address this. I believe the problem is this line here in ers https://github.com/DUNE-DAQ/ers/blob/fba16758987f04d5f62a669f85af3ef015369e2e/src/StandardStreamOutput.cpp#L139 as you can see when we have a stack of ERS::ISsues, we only print the first cause, while in fact we should print the whole stack.

Can we try to address this first before overflowing our code with additional messages? I think this will make what we publish in the database more consistent with the content of our logs.

I'm happy to have a chat about this if this is not clear.

@eflumerf

eflumerf commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

I don't think that is the problem; cause() is itself an ers::Issue, so that should recursively print the entire stack. The problem is that in the unit testing environment, the exception is caught by BOOST_REQUIRE_EXCEPTION, and the stdout print is never made. I do think this solution is pretty specific to this particular issue, since this code only is executed once per module per application, so that additional messages shouldn't be too much of a burden to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants