Uploaded image for project: 'Automation Analytics'
  1. Automation Analytics
  2. AA-1816

Rollups on conflict error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • aa-latest
    • rollups
    • None
    • Sprint ending Sept 14, 2023

      • Aug 21, 2023 @ 10:10:46.985 automation-analytics-rollups-v2-65d4b66cc9-29vtj
      • ERROR
      • 12,702,713
      • [Rollups] Error processing rollups: ON CONFLICT DO UPDATE command cannot affect row a second time
      • HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
      tenant: Descending Count Count percentages
      11,009,103 1,001 83.6%
      12,702,713 159 13.3%
      6,700,314 37 3.1%
      11,950,158 1 0.1%
      * Traceback (most recent call last):
      
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollup_common.py", line 50, in _execute_queries
          self._real_execute_queries()
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollup_common.py", line 89, in _real_execute_queries
          cursor.execute(query.as_string(cursor))
      ,
      psycopg2.errors.CardinalityViolation: ON CONFLICT DO UPDATE command cannot affect row a second time
      HINT:  Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
      
      ,
      
      During handling of the above exception, another exception occurred:
      
      ,
      Traceback (most recent call last):
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollups_worker.py", line 208, in _process_rollup
          self.execute_rollup_jobs(engine, tenant_id, tenant_name)
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollups_worker.py", line 138, in execute_rollup_jobs
          self._processor().rollup(engine, tenant_id, tenant_name, dates)
      ,
        File "<decorator-gen-18>", line 2, in rollup
      ,
        File "/opt/app-root/lib64/python3.9/site-packages/prometheus_client/context_managers.py", line 66, in wrapped
          return func(*args, **kwargs)
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/controller/rollups_processor.py", line 23, in rollup
          super().rollup(engine, tenant_id, tenant_name, dates)
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollups_processor.py", line 17, in rollup
          self._rollup(engine, tenant_id, tenant_name, dates)
      ,
        File "<decorator-gen-19>", line 2, in _rollup
      ,
        File "/opt/app-root/lib64/python3.9/site-packages/prometheus_client/context_managers.py", line 66, in wrapped
          return func(*args, **kwargs)
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/controller/rollups_processor.py", line 47, in _rollup
          self._rollup_group_controller_jobs_and_events(
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/controller/rollups_processor.py", line 83, in _rollup_group_controller_jobs_and_events
          new_dates = RealtimeRollupsFactory(
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/controller/factories/realtime_rollups_factory.py", line 12, in run
          self._get_rollup('host_event_explorer').execute()
      ,
        File "<decorator-gen-4>", line 2, in execute
      ,
        File "/opt/app-root/lib64/python3.9/site-packages/prometheus_client/context_managers.py", line 66, in wrapped
          return func(*args, **kwargs)
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/controller/rollups/realtime_host_event_explorer_rollup.py", line 13, in execute
          self._execute()
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollup_common.py", line 41, in _execute
          return self._execute_queries()
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollup_common.py", line 81, in _execute_queries
          self._real_execute_queries()
      ,
        File "/opt/app-root/src/tower_analytics_report/rollups/rollup_common.py", line 89, in _real_execute_queries
          cursor.execute(query.as_string(cursor))
      ,
      

      psycopg2.errors.CardinalityViolation: ON CONFLICT DO UPDATE command cannot affect row a second time
      HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values.

              mslemr Martin Šlemr (Inactive)
              mslemr Martin Šlemr (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: