Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-12046

Unhelpful error messages while saving configs

    Details

    • Type: Story
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: butler
    • Labels:
      None
    • Templates:
    • Team:
      Data Access and Database

      Description

      (See discussion on slack in #dm-butler, 2017-09-28 08:41 AM Pacific)

      I'm seeing an unhelpful error message coming from saving a config:

        File "/Users/lsst/products/DarwinX86/miniconda/latest/envs/lsst-13_0/var/opt/eups/DarwinX86/pipe_base/13.0-11-gdf6a56c+7/python/lsst/pipe/base/cmdLineTask.py", line 317, in _precallImpl
          task.writeConfig(parsedCmd.butler, clobber=self.clobberConfig, doBackup=self.doBackup)
        File "/Users/lsst/products/DarwinX86/miniconda/latest/envs/lsst-13_0/var/opt/eups/DarwinX86/pipe_base/13.0-11-gdf6a56c+7/python/lsst/pipe/base/cmdLineTask.py", line 604, in writeConfig
          butler.put(self.config, configName)
        File "/Users/lsst/products/DarwinX86/miniconda/latest/envs/lsst-13_0/var/opt/eups/DarwinX86/daf_persistence/13.0-28-gf70af18/python/lsst/daf/persistence/butler.py", line 1431, in put
          location.getRepository().write(location, obj)
        File "/Users/lsst/products/DarwinX86/miniconda/latest/envs/lsst-13_0/var/opt/eups/DarwinX86/daf_persistence/13.0-28-gf70af18/python/lsst/daf/persistence/repository.py", line 184, in write
          return butlerLocationStorage.write(butlerLocation, obj)
        File "/Users/lsst/products/DarwinX86/miniconda/latest/envs/lsst-13_0/var/opt/eups/DarwinX86/daf_persistence/13.0-28-gf70af18/python/lsst/daf/persistence/posixStorage.py", line 270, in write
          importType = __import__(importPackage, globals(), locals(), [importClassString], 0)
      ImportError: No module named constructFiberFlatTask
      

      And proposed changing that import to something like:

      try:
         importType = __import__(importPackage, globals(), locals(), [importClassString], 0)
      except ImportError as e:
         raise ImportError("Importing %s writing %s: %s" % (importPackage, locations[0], e))
      

      KT tells me that that exact import is gone as of a76108b, but that the problem of generating good error messages remains.

      Please make sure that the butler generates a helpful error message (e.g. telling the user which file the problematic import is in) whenever an import fails.

        Attachments

          Container Issues

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rhl Robert Lupton
                Watchers:
                Fritz Mueller, John Swinbank, Robert Lupton
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel