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

NULL IntegrityError in ci_hsc_gen3 registerInstrument.py using w_2020_01 stack with Oracle

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Invalid
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Running ci_hsc_gen3 master with w_2020_01 stack against Oracle, fails.   First backtracked and ran using sqlite3 which completed successfully.  Tried Oracle again and still fails with 

      cx_Oracle.IntegrityError: ORA-01400: cannot insert NULL into ("GEN3_MGOWER_3"."DATASET"."RUN_ID") in registerInstrument.py.

      (cloned ci_hsc_gen3 from scratch just to be sure and still got same error)

      Here is the output of scons past the chmod'ing of the bin files:

      python /usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/daf_butler/19.0.0-11-g1917748+1/bin/makeButlerRepo.py /work/mgower/gen3work/weeklyCItest/git/ci_hsc_gen3/DATA
      python /work/mgower/gen3work/weeklyCItest/git/ci_hsc_gen3/bin/registerInstrument.py /work/mgower/gen3work/weeklyCItest/git/ci_hsc_gen3/DATA
      Traceback (most recent call last):
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1249, in _execute_context
          cursor, statement, parameters, context
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/default.py", line 552, in do_execute
          cursor.execute(statement, parameters)
      cx_Oracle.IntegrityError: ORA-01400: cannot insert NULL into ("GEN3_MGOWER_3"."DATASET"."RUN_ID")
      The above exception was the direct cause of the following exception:Traceback (most recent call last):
        File "/work/mgower/gen3work/weeklyCItest/git/ci_hsc_gen3/bin/registerInstrument.py", line 33, in <module>
          instrument.writeCuratedCalibrations(butler)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/obs_subaru/19.0.0-5-g3655d4e4+1/python/lsst/obs/subaru/gen3/hsc/instrument.py", line 155, in writeCuratedCalibrations
          butler.put(camera, datasetType, unboundedDataId)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/daf_butler/19.0.0-11-g1917748+1/python/lsst/daf/butler/core/utils.py", line 243, in inner
          return func(self, *args, **kwargs)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/daf_butler/19.0.0-11-g1917748+1/python/lsst/daf/butler/butler.py", line 390, in put
          recursive=not isVirtualComposite)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/daf_butler/19.0.0-11-g1917748+1/python/lsst/daf/butler/core/utils.py", line 243, in inner
          return func(self, *args, **kwargs)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/daf_butler/19.0.0-11-g1917748+1/python/lsst/daf/butler/registries/sqlRegistry.py", line 502, in addDataset
          result = self._connection.execute(datasetTable.insert(), row)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 988, in execute
          return meth(self, multiparams, params)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
          return connection._execute_clauseelement(self, multiparams, params)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
          distilled_params,
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1253, in _execute_context
          e, statement, parameters, cursor, context
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1473, in _handle_dbapi_exception
          util.raise_from_cause(sqlalchemy_exception, exc_info)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/util/compat.py", line 398, in raise_from_cause
          reraise(type(exception), exception, tb=exc_tb, cause=cause)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/util/compat.py", line 152, in reraise
          raise value.with_traceback(tb)
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1249, in _execute_context
          cursor, statement, parameters, context
        File "/usr/local/lsst_stack/w_2020_01/stack/miniconda3-4.7.10-4d7b902/Linux64/sqlalchemy/1.3.8/lib/python/SQLAlchemy-1.3.8-py3.7-linux-x86_64.egg/sqlalchemy/engine/default.py", line 552, in do_execute
          cursor.execute(statement, parameters)
      sqlalchemy.exc.IntegrityError: (cx_Oracle.IntegrityError) ORA-01400: cannot insert NULL into ("GEN3_MGOWER_3"."DATASET"."RUN_ID")
      [SQL: INSERT INTO dataset (dataset_id, dataset_type_name, run_id, quantum_id, dataset_ref_hash, instrument, calibration_label) VALUES (dataset_dataset_id_seq.nextval, :dataset_type_name, :run_id, :quantum_id, :dataset_ref_hash, :instrument, :calibration_label) RETURNING dataset.dataset_id INTO :ret_0]
      [parameters: {'dataset_type_name': 'camera', 'run_id': None, 'quantum_id': None, 'dataset_ref_hash': 'OeOtppT6QKq3re8SwPDkgschPbvIx2Q8+Rx2HHEwfY4=', 'instrument': 'HSC', 'calibration_label': 'unbounded', 'ret_0': <cx_Oracle.STRING with value [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]>}]
      (Background on this error at: http://sqlalche.me/e/gkpj)
      scons: *** [DATA/calib] Error 1
      scons: building terminated because of errors.
      

       

        Attachments

          Activity

          Hide
          jbosch Jim Bosch added a comment -

          Could you please see if this goes away with branches tickets/DM-21768 (daf_butler, ctrl_mpexec) and tickets/DM-22609 (obs_base)?

          I don't understand what's causing the problem here, but I have been changing the code that generates that query for other reasons, and if I've accidentally fixed it, all the better.

          Show
          jbosch Jim Bosch added a comment - Could you please see if this goes away with branches tickets/ DM-21768 (daf_butler, ctrl_mpexec) and tickets/ DM-22609 (obs_base)? I don't understand what's causing the problem here, but I have been changing the code that generates that query for other reasons, and if I've accidentally fixed it, all the better.
          Hide
          mgower Michelle Gower added a comment -

          Using those branches, scons has made it past registerInstrument.py without that IntegrityError.  I'll add another comment here when the entire ci_hsc_gen3 run has completed.

          Show
          mgower Michelle Gower added a comment - Using those branches, scons has made it past registerInstrument.py without that IntegrityError.  I'll add another comment here when the entire ci_hsc_gen3 run has completed.
          Hide
          mgower Michelle Gower added a comment -

          Using those branches + w_2020_01, ci_hsc_gen3 ran successfully against Oracle.

          I can do more comparisons if needed, but the one thing I did notice is that the branches create a run id sequence, but the w_2020_01 alone does not.  Because of the holiday break I didn't run w_2019_51 or w_2019_52, so the change could have happened any time post w_2019_50. 

          I am ok with closing this and watching to make sure it doesn't happen when these branches are merged with the current master.

           

          Show
          mgower Michelle Gower added a comment - Using those branches + w_2020_01, ci_hsc_gen3 ran successfully against Oracle. I can do more comparisons if needed, but the one thing I did notice is that the branches create a run id sequence, but the w_2020_01 alone does not.  Because of the holiday break I didn't run w_2019_51 or w_2019_52, so the change could have happened any time post w_2019_50.  I am ok with closing this and watching to make sure it doesn't happen when these branches are merged with the current master.  
          Hide
          jbosch Jim Bosch added a comment -

          Closing this as Invalid since it hasn't come back in a year; seems sufficiently probably that it was fixed by those other tickets that we don't even need to spend time investigating.

          Show
          jbosch Jim Bosch added a comment - Closing this as Invalid since it hasn't come back in a year; seems sufficiently probably that it was fixed by those other tickets that we don't even need to spend time investigating.

            People

            Assignee:
            jbosch Jim Bosch
            Reporter:
            mgower Michelle Gower
            Watchers:
            Jim Bosch, Michelle Gower
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.