Uploaded image for project: 'Instrument control development'
  1. Instrument control development
  2. INSTRM-2291

Check values before opdb INSERTs

    XMLWordPrintable

    Details

    • Sprint:
      preRun18August1, EngRun18August

      Description

      We saw this error several times, where the invalid cobra_id = 0 was being inserted into cobra_match. We should catch that before it gets inserted, preferably in such a way that we can find where the value came from. FWIW, this always happened on iteration 2, but I suspect that the table being inserted for this frame had two rows with cobra_id = 0.

      2024-05-29 14:22:45.882Z cmds             20 CommandLink.py:124 > 2 202 w text="Failed to do fibreID: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "cobra_match_pkey"
      DETAIL:  Key (pfs_visit_id, iteration, cobra_id)=(111028, 2, 0) already exists.
      

      In one other case, there were clearly some other junk values – note the crazy cobra_id and suspicious center_mms:

      2024-05-29 14:44:26.186Z cmds             20 CommandLink.py:124 > 2 5 w text="Failed to do fibreID: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "cobra_match_pkey"
      DETAIL:  Key (pfs_visit_id, iteration, cobra_id)=(111032, 2, 0) already exists.
      
      [SQL: INSERT INTO cobra_match (pfs_visit_id, iteration, cobra_id, mcs_frame_id, spot_id, pfi_center_x_mm, pfi_center_y_mm, flags) VALUES (%(pfs_visit_id)s, %(iteration)s, %(cobra_id)s, %(mcs_frame_id)s, %(spot_id)s, %(pfi_center_x_mm)s, %(pfi_center_y_mm)s, %(flags)s)]
      [parameters: ({'pfs_visit_id': 111032, 'iteration': 2, 'cobra_id': -33562528, 'mcs_frame_id': 11103202, 'spot_id': 0, 'pfi_center_x_mm': -33562528.0, 'pfi_center_y_mm': 4.584908445424369e-41, 'flags': 0},
       [ ... ]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                karr karr
                Reporter:
                cloomis cloomis
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: