Skip to content

Better error message if using new device manager without the new environment variable #1359

Closed

Description

@olliesilvester

If BlueAPI is running and using a dodal module which defines its devices using the new device factory, eg like

@devices.factory()
def smargon() -> Smargon:
    return Smargon(f"{PREFIX.beamline_prefix}-MO-SGON-01:")

and if the blueapi's values.yaml is missing the new environment variable required, eg

        - kind: deviceManager
          module: dodal.beamlines.i04

then posting a plan will give a BlueAPI validation error which isn't very obvious. The message body on the validation error response looks like: Value error, Device smargon is not of type dodal.devices.smargon.Smargon (etc for all devices in the plan you were trying to run). I didn't really have any idea where to look from that error message.

It would be really helpful if the error message pointed out that the deviceManager configuration was missing

Activity

  1. tpoliaw commented on Jan 29, 2026

    @tpoliaw
    Contributor

    This is partly covered by #1194 (and relates to #1193)

    It's difficult to tell in blueapi that a module should use deviceManager instead of dodal but we should definitely improve the error message.

    • We should deprecate the dodal version and warn if anyone is using it. We are aiming to remove the dodal dependency soon so this will help with that.
    • We should merge fix: Give better error message on non-existent device #1194 so that the error differentiates between something being the wrong type and the device not existing
    • We should log a warning if no devices have been configured with a message along the lines of "check modules are included and have the correct 'kind' field".

    Would that help debug situations like this?

  2. olliesilvester commented on Jan 29, 2026

    @olliesilvester
    ContributorAuthor

    Yes, that all sounds good thanks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions