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

Fix bitrot in PgsqlRegistry

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: daf_persistence
    • Labels:
      None
    • Templates:
    • Team:
      External

      Description

      Fabio Hernandez reports the following error while testing ingestImagesPgsql.py:

      $ setup pipe_tasks
      $ setup obs_subaru
       
      $ ingestImagesPgsql.py data @filesToProcess.txt --mode link
      root INFO: Loading config overrride file '/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/obs_subaru/13.0-49-gcb35f37b+2/config/ingest.py'
      CameraMapper INFO: Loading exposure registry from /sps/lsst/dev/fabio/hscIO/ingestPostgres/data/registry.pgsql
      Traceback (most recent call last):
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_tasks/13.0-66-gfbf2f2ce+5/bin/ingestImagesPgsql.py", line 3, in <module>
          PgsqlIngestTask.parseAndRun()
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_tasks/13.0-66-gfbf2f2ce+5/python/lsst/pipe/tasks/ingest.py", line 397, in parseAndRun
          args = parser.parse_args(config)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_base/13.0-14-g8b3bf66+30/python/lsst/pipe/base/argumentParser.py", line 618, in parse_args
          namespace.butler = dafPersist.Butler(outputs=outputs)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/daf_persistence/13.0-40-g460649b+6/python/lsst/daf/persistence/butler.py", line 537, in __init__
          repoData.repo = Repository(repoData)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/daf_persistence/13.0-40-g460649b+6/python/lsst/daf/persistence/repository.py", line 143, in __init__
          self._initMapper(repoData)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/daf_persistence/13.0-40-g460649b+6/python/lsst/daf/persistence/repository.py", line 172, in _initMapper
          **mapperArgs)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/obs_subaru/13.0-49-gcb35f37b+2/python/lsst/obs/hsc/hscMapper.py", line 37, in __init__
          super(HscMapper, self).__init__(policy, os.path.dirname(policyFile), **kwargs)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/obs_base/13.0-55-gb064ced+1/python/lsst/obs/base/cameraMapper.py", line 248, in __init__
          posixIfNoSql=(not parentRegistry))
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/obs_base/13.0-55-gb064ced+1/python/lsst/obs/base/cameraMapper.py", line 857, in _setupRegistry
          registry = dafPersist.Registry.create(localFileObj.name)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/daf_persistence/13.0-40-g460649b+6/python/lsst/daf/persistence/registries.py", line 89, in create
          return PgsqlRegistry(location)
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/daf_persistence/13.0-40-g460649b+6/python/lsst/daf/persistence/registries.py", line 439, in __init__
          raise RuntimeError("Cannot use PgsqlRegistry: could not import psycopg2")
      RuntimeError: Cannot use PgsqlRegistry: could not import psycopg2
      Exception ignored in: <bound method SqlRegistry.__del__ of <lsst.daf.persistence.registries.PgsqlRegistry object at 0x7f4209755b38>>
      Traceback (most recent call last):
        File "/sps/lsst/software/lsst_distrib/w_2017_40/stack/miniconda3-4.3.21-10a4fa6/Linux64/daf_persistence/13.0-40-g460649b+6/python/lsst/daf/persistence/registries.py", line 322, in __del__
          if self.conn:
      AttributeError: 'PgsqlRegistry' object has no attribute 'conn'
      + exit
      

        Attachments

          Activity

            People

            • Assignee:
              price Paul Price
              Reporter:
              price Paul Price
              Reviewers:
              Pim Schellart [X] (Inactive)
              Watchers:
              Fabio Hernandez, Paul Price, Pim Schellart [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel