AnsweredAssumed Answered

foreign key constraint fails aaar_datamart.dm_dim_months

Question asked by marko.d on Dec 8, 2014
Latest reply on Dec 9, 2014 by marko.d
Alfresco Audit Analysis and Reporting 2.2 STABLE installed on Linux, with biserver-5.2.0.0, pentaho-5.2.0.0, Alfresco 5.0.b. Database is MariaDB.
Executing AAAR_Extract.sh yields:
<blockquote>
2014/12/04 12:09:48 - dm_dim_months.0 - Setting preparedStatement to [SELECT id, `DESC`, month_desc, year_id FROM dm_dim_months WHERE  ( ( id = ?  ) ) ]
2014/12/04 12:09:48 - AAAR_DataMart - Preparing statement:
2014/12/04 12:09:48 - AAAR_DataMart - INSERT INTO dm_dim_months (id, `DESC`, month_desc, year_id) VALUES ( ?,  ?,  ?,  ?)
2014/12/04 12:09:48 - dm_dim_months.0 - Setting update preparedStatement to [UPDATE dm_dim_months
2014/12/04 12:09:48 - dm_dim_months.0 - SET `DESC` = ?
2014/12/04 12:09:48 - dm_dim_months.0 - ,   month_desc = ?
2014/12/04 12:09:48 - dm_dim_months.0 - ,   year_id = ?
2014/12/04 12:09:48 - dm_dim_months.0 - WHERE  ( ( id = ?  ) ) ]
2014/12/04 12:09:48 - dm_dim_months.0 - Values set for lookup: [2000-01-01]
2014/12/04 12:09:48 - dm_dim_months.0 - Values set for lookup: [2014-12-01]
2014/12/04 12:09:48 - dm_dim_months.0 - Values set for lookup: [2015-01-01]
2014/12/04 12:09:48 - AAAR_DataMart - Connection to database closed!
2014/12/04 12:09:48 - START - Finished processing (I=3, O=0, R=0, W=3, U=0, E=0)
2014/12/04 12:09:48 - dm_dim_minutes.0 - Checking row: [-1], [UNKNOWN], [-1]
2014/12/04 12:09:48 - dm_dim_minutes.0 - Field [minute] has nr. 0
2014/12/04 12:09:48 - dm_dim_minutes.0 - Field [minute] has nr. 0
2014/12/04 12:09:48 - dm_dim_minutes.0 - Field [desc] has nr. 1
2014/12/04 12:09:48 - dm_dim_minutes.0 - Field [hour_id] has nr. 2
2014/12/04 12:09:48 - dm_dim_minutes.0 - Setting preparedStatement to [SELECT id, `DESC`, hour_id FROM dm_dim_minutes WHERE  ( ( id = ?  ) ) ]
2014/12/04 12:09:48 - AAAR_DataMart - Preparing statement:
2014/12/04 12:09:48 - AAAR_DataMart - INSERT INTO dm_dim_minutes (id, `DESC`, hour_id) VALUES ( ?,  ?,  ?)
2014/12/04 12:09:48 - dm_dim_minutes.0 - Setting update preparedStatement to [UPDATE dm_dim_minutes
2014/12/04 12:09:48 - dm_dim_minutes.0 - SET `DESC` = ?
2014/12/04 12:09:48 - dm_dim_minutes.0 - ,   hour_id = ?
2014/12/04 12:09:48 - dm_dim_minutes.0 - WHERE  ( ( id = ?  ) ) ]
2014/12/04 12:09:48 - dm_dim_minutes.0 - Values set for lookup: [-1]
2014/12/04 12:09:48 - minute.0 - Signaling 'output done' to 1 output rowsets.
2014/12/04 12:09:48 - minute.0 - Finished reading query, closing connection.
2014/12/04 12:09:48 - AAAR_DataMart - Connection to database closed!
2014/12/04 12:09:48 - minute.0 - Finished processing (I=1441, O=0, R=0, W=1441, U=0, E=0)
2014/12/04 12:09:48 - dm_dim_minutes.0 - Values set for lookup: [0]
2014/12/04 12:09:48 - dm_dim_minutes.0 - Values set for lookup: [1]
2014/12/04 12:09:48 - dm_dim_months.0 - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : Unexpected error
2014/12/04 12:09:48 - dm_dim_months.0 - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : org.pentaho.di.core.exception.KettleStepException:
2014/12/04 12:09:48 - dm_dim_months.0 - Error in step, asking everyone to stop because of:
2014/12/04 12:09:48 - dm_dim_months.0 -
2014/12/04 12:09:48 - dm_dim_months.0 - Error inserting/updating row
2014/12/04 12:09:48 - dm_dim_months.0 - Cannot add or update a child row: a foreign key constraint fails (`aaar_datamart`.`dm_dim_months`, CONSTRAINT `fk_dm_dim_months_dm_dim_years` FOREIGN KEY (`year_id`) REFERENCES `dm_dim_years` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)
</blockquote>

I found another thread about the same issue, but I don't believe that the connection between Alfresco and AAAR is the problem here.

Outcomes