Search Engine: Elastic

Article ID: 132246, created on Feb 15, 2018, last review on Jul 14, 2018

  • Applies to:
  • Operations Automation 7.2
  • Operations Automation 7.3


After Azure CSP application upgrade to 5.0, many periodic tasks to synchronize resource usage for Azure fail with errors like:

Could not get resource usage for resource with UUID 'c81f263c-6bbe-4ffa-92ae-ac838ff211a8': HTTP request has failed.
500 Internal Server Error

with the following pattern in Azure log /usr/local/azure/site/log/azure.log:

2018-02-13 07:27:52,714 DEBUG [] (azure task-26) Called:
2018-02-13 07:27:53,198 ERROR [] (azure task-26) <APS-APP> Error: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not extract ResultSet
Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "consumption_records" violates foreign key constraint "fk_consumption_records_reseller_oss_report_id"
  Detail: Key (reseller_oss_report_id)=(0) is not present in table "oss_reports".
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(
        at org.postgresql.core.v3.QueryExecutorImpl.execute(
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(
        at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract( [hibernate-core-5.0.10.Final.jar:5.0.10.Final]

from postgres log /var/log/pgsql/9.6/data/pg_log/postgresql-Thu.log:

< 2018-02-12 04:02:45.692 AEDT > ERROR:  insert or update on table "consumption_records" violates foreign key constraint "fk_consumption_records_reseller_oss_report_id"
< 2018-02-12 04:02:45.692 AEDT > DETAIL:  Key (reseller_oss_report_id)=(0) is not present in table "oss_reports".
< 2018-02-12 04:02:45.692 AEDT > STATEMENT:  WITH deleted AS ( DELETE FROM consumption_queue WHERE oss_id = $1 RETURNING *), updated AS ( UPDATE consumption_records cr SET reseller_oss_report_id = $2 FROM deleted WHERE = deleted.consumption_record_id RETURNING cr.*) SELECT COALESCE(SUM(cost), 0) AS total_cost, COALESCE(SUM(reseller_cost), 0) AS total_reseller_cost, COALESCE(SUM(partner_cost), 0) AS total_partner_cost, COALESCE(MAX(end_time), TO_TIMESTAMP(0)) AS last_update_time FROM updated


An Azure CSP application issue APSA-19544: "Synchronize resource usage for Azure CSP periodic task fails after upgrade to 5.x due to null reseller_oss_report_id values in consumption_records".


Contact Odin Technical Support to apply the fix.

31987597efff5a3a9ce779cc203bbe5e caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 5356b422f65bdad1c3e9edca5d74a1ae 1941880841f714e458ae4dc3d9f3062d dd79f16c76b9dca75205ab5e9f5465ea

Email subscription for changes to this article
Save as PDF