Created attachment 1075691 [details] logs from engine Description of problem: Updating an existing per host storage connection via storageconnectionextensions with a target that exist in the DB under another per host storage connection for the same host fails with 'Internal Engine Error' Version-Release number of selected component (if applicable): rhevm-3.6.0-0.16.master.el6.noarch rhevm-restapi-3.6.0-0.16.master.el6.noarch How reproducible: Always Steps to Reproduce: 1. Add a storage connection per host via REST API. For example: Under: https://engine-add/api/hosts/%host_id%/storageconnectionextensions POST (Content-Type: application/xml): <storage_connection_extension> <target>iqn1.leon.com</target> <username>bla</username> <password>bla</password> </storage_connection_extension> 2. Add another storage connection per host for the same host with another target: Under: https://engine-add/api/hosts/%host_id%/storageconnectionextensions POST (Content-Type: application/xml): <storage_connection_extension> <target>iqn2.leon.com</target> <username>bla</username> <password>bla</password> </storage_connection_extension> 3. Update one of the connections with the same target as written in the other connection Actual results: <fault> <reason>Operation Failed</reason> <detail>[Internal Engine Error]</detail> </fault> 2015-09-22 07:25:37,566 INFO [org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionExtensionCommand] (ajp-/127.0.0.1:8702-3) [7f0e82c1] Running command: UpdateStorageServerCon nectionExtensionCommand internal: false. Entities affected : ID: aaa00000-0000-0000-0000-123456789aaa Type: SystemAction group CREATE_STORAGE_DOMAIN with role type ADMIN 2015-09-22 07:25:37,588 ERROR [org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionExtensionCommand] (ajp-/127.0.0.1:8702-3) [7f0e82c1] Command 'org.ovirt.engine.core.bll.stor age.UpdateStorageServerConnectionExtensionCommand' failed: CallableStatementCallback; SQL [{call updatestorageserverconnectionextension(?, ?, ?, ?, ?)}]; ERROR: duplicate key value viola tes unique constraint "storage_server_connection_extension_vds_id_iqn" Where: SQL statement "UPDATE storage_server_connection_extension SET vds_id = $1 , iqn = $2 , user_name = $3 , password = $4 WHERE id = $5 " PL/pgSQL function "updatestorageserverconnectionextension" line 2 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique cons traint "storage_server_connection_extension_vds_id_iqn" Where: SQL statement "UPDATE storage_server_connection_extension SET vds_id = $1 , iqn = $2 , user_name = $3 , password = $4 WHERE id = $5 " PL/pgSQL function "updatestorageserverconnectionextension" line 2 at SQL statement 2015-09-22 07:25:37,588 ERROR [org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionExtensionCommand] (ajp-/127.0.0.1:8702-3) [7f0e82c1] Exception: org.springframework.dao.Dupl icateKeyException: CallableStatementCallback; SQL [{call updatestorageserverconnectionextension(?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "storage_server_co nnection_extension_vds_id_iqn" Where: SQL statement "UPDATE storage_server_connection_extension SET vds_id = $1 , iqn = $2 , user_name = $3 , password = $4 WHERE id = $5 " PL/pgSQL function "updatestorageserverconnectionextension" line 2 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique cons traint "storage_server_connection_extension_vds_id_iqn" Where: SQL statement "UPDATE storage_server_connection_extension SET vds_id = $1 , iqn = $2 , user_name = $3 , password = $4 WHERE id = $5 " PL/pgSQL function "updatestorageserverconnectionextension" line 2 at SQL statement at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241) [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] Expected results: The operation should fail nicely Additional info: logs from engine
A connection extension is identified by the combination of host and iqn. Updating either of them doesn't make sense, and should be blocked by a CDA (regardless of whether there's already such a definition or not).
In oVirt testing is done on single release by default. Therefore I'm removing the 4.0 flag. If you think this bug must be tested in 4.0 as well, please re-add the flag. Please note we might not have testing resources to handle the 4.0 clone.
Updating an existing storage connection under storageconnectionextensions, with a target name which already exists under another connection is blocked on CDA with a correct message: Body: <storage_connection_extension> <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c01</target> <username>elad</username> <password>123123123123</password> </storage_connection_extension> Response: <fault> <reason>Operation Failed</reason> <detail> [Cannot edit Storage Connection Extension. Connection extension already exists for the host green-vdsb and the target iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c01.] </detail> </fault> Engine.log: 2015-12-02 09:57:01,959 WARN [org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionExtensionCommand] (ajp-/127.0.0.1:8702-12) [700dd14f] CanDoAction of action 'UpdateStorageServerConnectionExtension' failed for user admin@internal. Reasons: VAR__TYPE__STORAGE__CONNECTION__EXTENSION,VAR__ACTION__UPDATE,ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_ALREADY_EXISTS,$target iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c01,$vdsName green-vdsb
Following comment #3, verified using: rhevm-3.6.1-0.2.el6.noarch rhevm-restapi-3.6.1-0.2.el6.noarch
According to verification status and target milestone this issue should be fixed in oVirt 3.6.1. Closing current release.