Re: [ovirt-users] ERROR: update or delete on table "luns" violates foreign key constraint...

2015-12-22 Thread Aleksey Chudov
First time I've seen the problem version was
ovirt-engine-3.6.0.3-1.el7.centos.noarch. Current version is
ovirt-engine-3.6.1.3-1.el7.centos.noarch and error persists.

On Tue, Dec 22, 2015 at 10:15 AM, Roy Golan <rgo...@redhat.com> wrote:

>
>
> On Sun, Dec 20, 2015 at 12:28 PM, Eli Mesika <emes...@redhat.com> wrote:
>
>>
>>
>> - Original Message -
>> > From: "Aleksey Chudov" <aleksey.chu...@gmail.com>
>> > To: users@ovirt.org
>> > Sent: Friday, December 18, 2015 11:38:21 AM
>> > Subject: [ovirt-users] ERROR: update or delete on table "luns"
>> violates   foreign key constraint...
>> >
>> > Hi,
>> >
>> > I have two-node self hosted engine cluster with iscsi shared storage.
>> Every
>> > ovirt-engine restart produces the following error in
>> > /var/log/ovirt-engine/engine.log. After that engine works without any
>> > problems.
>> >
>> > How to fix it?
>>
>>
> Aleksey what's the engine version?
>
>
>> CCing Allon M
>>
>> This seems as a bug
>>
>> disk_lun_map FK is created without ON DELETE/UPDATE CASCADE
>> This makes the FK failing in deleting from the luns table (by calling
>> DeleteLun) while the deleted lun in the parent table has references in
>> disk_lun_map
>>
>> Allon, please advice
>>
>> >
>> > 2015-12-18 11:33:00,053 ERROR
>> >
>> [org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
>> > (org.ovirt.thread.pool-8-thread-11) [674068d8] Command
>> >
>> 'org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand'
>> > failed: CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR:
>> update
>> > or delete on table "luns" violates foreign key constraint
>> > "disk_lun_to_lun_fk" on table "disk_lun_map"
>> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
>> referenced
>> > from table "disk_lun_map".
>> > Where: SQL statement "DELETE FROM LUNs
>> > WHERE LUN_id = v_LUN_id"
>> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
>> > nested exception is org.postgresql.util.PSQLException: ERROR: update or
>> > delete on table "luns" violates foreign key constraint
>> "disk_lun_to_lun_fk"
>> > on table "disk_lun_map"
>> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
>> referenced
>> > from table "disk_lun_map".
>> > Where: SQL statement "DELETE FROM LUNs
>> > WHERE LUN_id = v_LUN_id"
>> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement
>> > 2015-12-18 11:33:00,053 ERROR
>> >
>> [org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
>> > (org.ovirt.thread.pool-8-thread-11) [674068d8] Exception:
>> > org.springframework.dao.DataIntegrityViolationException:
>> > CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: update or
>> > delete on table "luns" violates foreign key constraint
>> "disk_lun_to_lun_fk"
>> > on table "disk_lun_map"
>> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
>> referenced
>> > from table "disk_lun_map".
>> > Where: SQL statement "DELETE FROM LUNs
>> > WHERE LUN_id = v_LUN_id"
>> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
>> > nested exception is org.postgresql.util.PSQLException: ERROR: update or
>> > delete on table "luns" violates foreign key constraint
>> "disk_lun_to_lun_fk"
>> > on table "disk_lun_map"
>> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
>> referenced
>> > from table "disk_lun_map".
>> > Where: SQL statement "DELETE FROM LUNs
>> > WHERE LUN_id = v_LUN_id"
>> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement
>> > at
>> >
>> org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:245)
>> > [spring-jdbc.jar:3.1.1.RELEASE]
>> > at
>> >
>> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
>> > [spring-jdbc.jar:3.1.1.RELEASE]
>> > at
>> org.springframework.jdbc.core.J

Re: [ovirt-users] ERROR: update or delete on table "luns" violates foreign key constraint...

2015-12-22 Thread Roy Golan
On Sun, Dec 20, 2015 at 12:28 PM, Eli Mesika <emes...@redhat.com> wrote:

>
>
> - Original Message -
> > From: "Aleksey Chudov" <aleksey.chu...@gmail.com>
> > To: users@ovirt.org
> > Sent: Friday, December 18, 2015 11:38:21 AM
> > Subject: [ovirt-users] ERROR: update or delete on table "luns" violates
>  foreign key constraint...
> >
> > Hi,
> >
> > I have two-node self hosted engine cluster with iscsi shared storage.
> Every
> > ovirt-engine restart produces the following error in
> > /var/log/ovirt-engine/engine.log. After that engine works without any
> > problems.
> >
> > How to fix it?
>
>
Aleksey what's the engine version?


> CCing Allon M
>
> This seems as a bug
>
> disk_lun_map FK is created without ON DELETE/UPDATE CASCADE
> This makes the FK failing in deleting from the luns table (by calling
> DeleteLun) while the deleted lun in the parent table has references in
> disk_lun_map
>
> Allon, please advice
>
> >
> > 2015-12-18 11:33:00,053 ERROR
> >
> [org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
> > (org.ovirt.thread.pool-8-thread-11) [674068d8] Command
> >
> 'org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand'
> > failed: CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR:
> update
> > or delete on table "luns" violates foreign key constraint
> > "disk_lun_to_lun_fk" on table "disk_lun_map"
> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
> referenced
> > from table "disk_lun_map".
> > Where: SQL statement "DELETE FROM LUNs
> > WHERE LUN_id = v_LUN_id"
> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
> > nested exception is org.postgresql.util.PSQLException: ERROR: update or
> > delete on table "luns" violates foreign key constraint
> "disk_lun_to_lun_fk"
> > on table "disk_lun_map"
> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
> referenced
> > from table "disk_lun_map".
> > Where: SQL statement "DELETE FROM LUNs
> > WHERE LUN_id = v_LUN_id"
> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement
> > 2015-12-18 11:33:00,053 ERROR
> >
> [org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
> > (org.ovirt.thread.pool-8-thread-11) [674068d8] Exception:
> > org.springframework.dao.DataIntegrityViolationException:
> > CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: update or
> > delete on table "luns" violates foreign key constraint
> "disk_lun_to_lun_fk"
> > on table "disk_lun_map"
> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
> referenced
> > from table "disk_lun_map".
> > Where: SQL statement "DELETE FROM LUNs
> > WHERE LUN_id = v_LUN_id"
> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
> > nested exception is org.postgresql.util.PSQLException: ERROR: update or
> > delete on table "luns" violates foreign key constraint
> "disk_lun_to_lun_fk"
> > on table "disk_lun_map"
> > Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
> referenced
> > from table "disk_lun_map".
> > Where: SQL statement "DELETE FROM LUNs
> > WHERE LUN_id = v_LUN_id"
> > PL/pgSQL function deletelun(character varying) line 10 at SQL statement
> > at
> >
> org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:245)
> > [spring-jdbc.jar:3.1.1.RELEASE]
> > at
> >
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
> > [spring-jdbc.jar:3.1.1.RELEASE]
> > at
> org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030)
> > [spring-jdbc.jar:3.1.1.RELEASE]
> > at
> org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064)
> > [spring-jdbc.jar:3.1.1.RELEASE]
> > at
> >
> org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388)
> > [spring-jdbc.jar:3.1.1.RELEASE]
> > at
> >
> org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351)
> > [spring-jdbc.jar:3.1.1.RELEASE]
> > at
> >
> org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181)
&

Re: [ovirt-users] ERROR: update or delete on table "luns" violates foreign key constraint...

2015-12-20 Thread Eli Mesika


- Original Message -
> From: "Aleksey Chudov" <aleksey.chu...@gmail.com>
> To: users@ovirt.org
> Sent: Friday, December 18, 2015 11:38:21 AM
> Subject: [ovirt-users] ERROR: update or delete on table "luns" violates   
> foreign key constraint...
> 
> Hi,
> 
> I have two-node self hosted engine cluster with iscsi shared storage. Every
> ovirt-engine restart produces the following error in
> /var/log/ovirt-engine/engine.log. After that engine works without any
> problems.
> 
> How to fix it?

CCing Allon M

This seems as a bug 

disk_lun_map FK is created without ON DELETE/UPDATE CASCADE
This makes the FK failing in deleting from the luns table (by calling 
DeleteLun) while the deleted lun in the parent table has references in 
disk_lun_map

Allon, please advice 

> 
> 2015-12-18 11:33:00,053 ERROR
> [org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
> (org.ovirt.thread.pool-8-thread-11) [674068d8] Command
> 'org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand'
> failed: CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: update
> or delete on table "luns" violates foreign key constraint
> "disk_lun_to_lun_fk" on table "disk_lun_map"
> Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still referenced
> from table "disk_lun_map".
> Where: SQL statement "DELETE FROM LUNs
> WHERE LUN_id = v_LUN_id"
> PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
> nested exception is org.postgresql.util.PSQLException: ERROR: update or
> delete on table "luns" violates foreign key constraint "disk_lun_to_lun_fk"
> on table "disk_lun_map"
> Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still referenced
> from table "disk_lun_map".
> Where: SQL statement "DELETE FROM LUNs
> WHERE LUN_id = v_LUN_id"
> PL/pgSQL function deletelun(character varying) line 10 at SQL statement
> 2015-12-18 11:33:00,053 ERROR
> [org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
> (org.ovirt.thread.pool-8-thread-11) [674068d8] Exception:
> org.springframework.dao.DataIntegrityViolationException:
> CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: update or
> delete on table "luns" violates foreign key constraint "disk_lun_to_lun_fk"
> on table "disk_lun_map"
> Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still referenced
> from table "disk_lun_map".
> Where: SQL statement "DELETE FROM LUNs
> WHERE LUN_id = v_LUN_id"
> PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
> nested exception is org.postgresql.util.PSQLException: ERROR: update or
> delete on table "luns" violates foreign key constraint "disk_lun_to_lun_fk"
> on table "disk_lun_map"
> Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still referenced
> from table "disk_lun_map".
> Where: SQL statement "DELETE FROM LUNs
> WHERE LUN_id = v_LUN_id"
> PL/pgSQL function deletelun(character varying) line 10 at SQL statement
> at
> org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:245)
> [spring-jdbc.jar:3.1.1.RELEASE]
> at
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
> [spring-jdbc.jar:3.1.1.RELEASE]
> at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030)
> [spring-jdbc.jar:3.1.1.RELEASE]
> at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064)
> [spring-jdbc.jar:3.1.1.RELEASE]
> at
> org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388)
> [spring-jdbc.jar:3.1.1.RELEASE]
> at
> org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351)
> [spring-jdbc.jar:3.1.1.RELEASE]
> at
> org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181)
> [spring-jdbc.jar:3.1.1.RELEASE]
> at
> org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:147)
> [dal.jar:]
> at
> org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:142)
> [dal.jar:]
> at
> org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:80)
> [dal.jar:]
> at org.ovirt.engine.core.dao.LunDaoImpl.remove(LunDaoImpl.java:127)
> [dal.jar:]
> at org.ovirt.engine.core.dao.LunDaoImpl.remove(LunDaoImpl.java:18) [dal.jar:]
&g

[ovirt-users] ERROR: update or delete on table "luns" violates foreign key constraint...

2015-12-18 Thread Aleksey Chudov
Hi,

I have two-node self hosted engine cluster with iscsi shared storage. Every
ovirt-engine restart produces the following error in
/var/log/ovirt-engine/engine.log. After that engine works without any
problems.

How to fix it?

2015-12-18 11:33:00,053 ERROR
[org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
(org.ovirt.thread.pool-8-thread-11) [674068d8] Command
'org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand'
failed: CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: update
or delete on table "luns" violates foreign key constraint
"disk_lun_to_lun_fk" on table "disk_lun_map"
  Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
referenced from table "disk_lun_map".
  Where: SQL statement "DELETE FROM LUNs
   WHERE LUN_id = v_LUN_id"
PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
nested exception is org.postgresql.util.PSQLException: ERROR: update or
delete on table "luns" violates foreign key constraint "disk_lun_to_lun_fk"
on table "disk_lun_map"
  Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
referenced from table "disk_lun_map".
  Where: SQL statement "DELETE FROM LUNs
   WHERE LUN_id = v_LUN_id"
PL/pgSQL function deletelun(character varying) line 10 at SQL statement
2015-12-18 11:33:00,053 ERROR
[org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand]
(org.ovirt.thread.pool-8-thread-11) [674068d8] Exception:
org.springframework.dao.DataIntegrityViolationException:
CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: update or
delete on table "luns" violates foreign key constraint "disk_lun_to_lun_fk"
on table "disk_lun_map"
  Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
referenced from table "disk_lun_map".
  Where: SQL statement "DELETE FROM LUNs
   WHERE LUN_id = v_LUN_id"
PL/pgSQL function deletelun(character varying) line 10 at SQL statement;
nested exception is org.postgresql.util.PSQLException: ERROR: update or
delete on table "luns" violates foreign key constraint "disk_lun_to_lun_fk"
on table "disk_lun_map"
  Detail: Key (lun_id)=(36001405821da830526f48d0a961767c8) is still
referenced from table "disk_lun_map".
  Where: SQL statement "DELETE FROM LUNs
   WHERE LUN_id = v_LUN_id"
PL/pgSQL function deletelun(character varying) line 10 at SQL statement
at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:245)
[spring-jdbc.jar:3.1.1.RELEASE]
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
[spring-jdbc.jar:3.1.1.RELEASE]
at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030)
[spring-jdbc.jar:3.1.1.RELEASE]
at
org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064)
[spring-jdbc.jar:3.1.1.RELEASE]
at
org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388)
[spring-jdbc.jar:3.1.1.RELEASE]
at
org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351)
[spring-jdbc.jar:3.1.1.RELEASE]
at
org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181)
[spring-jdbc.jar:3.1.1.RELEASE]
at
org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:147)
[dal.jar:]
at
org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:142)
[dal.jar:]
at
org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:80)
[dal.jar:]
at org.ovirt.engine.core.dao.LunDaoImpl.remove(LunDaoImpl.java:127)
[dal.jar:]
at org.ovirt.engine.core.dao.LunDaoImpl.remove(LunDaoImpl.java:18)
[dal.jar:]
at
org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand.refreshLunsInfo(SyncLunsInfoForBlockStorageDomainCommand.java:94)
[bll.jar:]
at
org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand$1.runInTransaction(SyncLunsInfoForBlockStorageDomainCommand.java:51)
[bll.jar:]
at
org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand$1.runInTransaction(SyncLunsInfoForBlockStorageDomainCommand.java:48)
[bll.jar:]
at
org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:210)
[utils.jar:]
at
org.ovirt.engine.core.bll.storage.SyncLunsInfoForBlockStorageDomainCommand.executeCommand(SyncLunsInfoForBlockStorageDomainCommand.java:48)
[bll.jar:]
at
org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1215)
[bll.jar:]
at
org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1359)
[bll.jar:]
at