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

Butler should generate more helpful errors when pointed at any empty directory


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


      In DM-8832, a failure to run processCcd.py ultimately led to the Butler attempting to open an empty directory. When doing so, it throws a somewhat obscure and intimidating error:

      >>>  Butler(tempfile.mkdtemp())
      RuntimeError                              Traceback (most recent call last)
      <ipython-input-5-4dc5ee5ae70e> in <module>()
      ----> 1 Butler(tempfile.mkdtemp())
      /ssd/lsstsw/stack/Linux64/daf_persistence/12.1-17-g9654cba+1/python/lsst/daf/persistence/butler.pyc in __init__(self, root, mapper, inputs, outputs, **mapperArgs)
          303         for args in outputs:
      --> 304             self._addRepo(args, inout='out', defaultMapper=defaultMapper, butlerIOParents=butlerIOParents)
          306         for args in inputs:
      /ssd/lsstsw/stack/Linux64/daf_persistence/12.1-17-g9654cba+1/python/lsst/daf/persistence/butler.pyc in _addRepo(self, args, inout, defaultMapper, butlerIOParents, tags)
          397                     if defaultMapper is None:
          398                         raise RuntimeError(
      --> 399                             "Could not infer mapper and one not specified in repositoryArgs:%s" % args)
          400                     args.mapper = defaultMapper
          401                 parents = [cfgRoot for cfgRoot in list(butlerIOParents.keys()) if cfgRoot != args.cfgRoot]
      RuntimeError: Could not infer mapper and one not specified in repositoryArgs:RepositoryArgs(root='/tmp/tmp8pCn6I', cfgRoot=None, mapper=None, mapperArgs={}, tags=set([]), mode='rw', policy=None)

      While a little knowledge of what the Butler is doing makes the error understandable, it's not really helpful, particularly for those who are less familiar with the code (see the discussion at DM-8832, which was initially interpreted as being an error in the Butler due to this message).

      Can we do something to make it clearer what's happening?


          Issue Links



              • Assignee:
                ktl Kian-Tat Lim
                swinbank John Swinbank
                John Parejko, John Swinbank, Nate Pease
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created:

                  Summary Panel