Bug 1565173

Summary: [downstream clone - 4.1.11] Adding Storage domain with more than 50 character LUN ID succeeds but Storage domain removal fails
Product: Red Hat Enterprise Virtualization Manager Reporter: RHV bug bot <rhv-bugzilla-bot>
Component: ovirt-engineAssignee: Idan Shaby <ishaby>
Status: CLOSED ERRATA QA Contact: Elad <ebenahar>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.1.6CC: amureini, ebenahar, lsurette, ratamir, rbalakri, Rhev-m-bugs, srevivo, ykaul, ylavi
Target Milestone: ovirt-4.1.11Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1539914 Environment:
Last Closed: 2018-04-24 15:30:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1539914    
Bug Blocks:    

Description RHV bug bot 2018-04-09 14:32:19 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1539914 +++
======================================================================

Description of problem:

Adding Storage domain with more than 50 character LUN ID succeeds but Storage domain removal fails

Version-Release number of selected component (if applicable):

RHV 4.1

How reproducible:
100%

Actual results:

No errors received when Adding Storage domain with more than 50 character LUN ID. But Storage domain removal fails with same more than 50 character LUN ID fails with PSQLException: ERROR

Expected results:

If 50 character is a limit then Addition of Storage domain should also be blocked if a LUN ID has more than 50 Characters.

Additional info: 

Below errors are received in engine.log when trying to remove the Storage domain with more than 50 character LUN ID


2018-01-24 11:12:33,549+03 ERROR [org.ovirt.engine.core.bll.storage.domain.RemoveStorageDomainCommand] (default task-45) [Correlation-ID] Command 'org.ovirt.engine.core.bll.storage.domain.RemoveStorageDomainCommand' 
failed: CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: value too long for type character varying(50)
  Where: PL/pgSQL function deletelun(character varying) line 7 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(50)
  Where: PL/pgSQL function deletelun(character varying) line 7 at SQL statement
2018-01-24 11:12:33,549+03 ERROR [org.ovirt.engine.core.bll.storage.domain.RemoveStorageDomainCommand] (default task-45) [Correlation-ID] Exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call deletelun(?)}]; ERROR: value too long for type character varying(50)
  Where: PL/pgSQL function deletelun(character varying) line 7 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(50)
  Where: PL/pgSQL function deletelun(character varying) line 7 at SQL statement
        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:102) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1094) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1130) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:405) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:365) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:198) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:135) [dal.jar:]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:130) [dal.jar:]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:76) [dal.jar:]
        at org.ovirt.engine.core.dao.LunDaoImpl.remove(LunDaoImpl.java:128) [dal.jar:]
        at org.ovirt.engine.core.dao.LunDaoImpl.remove(LunDaoImpl.java:15) [dal.jar:]
        at org.ovirt.engine.core.bll.storage.connection.StorageHelperBase.removeLunFromStorageDomain(StorageHelperBase.java:154) [bll.jar:]
        at org.ovirt.engine.core.bll.storage.connection.StorageHelperBase.removeStorageDomainLuns(StorageHelperBase.java:145) [bll.jar:]
        at org.ovirt.engine.core.bll.storage.connection.ISCSIStorageHelper.storageDomainRemoved(ISCSIStorageHelper.java:265) [bll.jar:]
        at org.ovirt.engine.core.bll.storage.domain.RemoveStorageDomainCommand.lambda$executeCommand$0(RemoveStorageDomainCommand.java:75) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [utils.jar:]
        at org.ovirt.engine.core.bll.storage.domain.RemoveStorageDomainCommand.executeCommand(RemoveStorageDomainCommand.java:74) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1251) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1391) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:2055) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:164) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:103) [utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1451) [bll.jar:]

Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(50)
  Where: PL/pgSQL function deletelun(character varying) line 7 at SQL statement

        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:410)
        at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:303)
        at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:442)
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1133) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1130) [spring-jdbc.jar:4.2.4.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1078) [spring-jdbc.jar:4.2.4.RELEASE]
        ... 147 more

2018-01-24 11:12:33,565+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-45) [Correlation-ID] EVENT_ID: USER_REMOVE_STORAGE_DOMAIN_FAILED(961), Correlation ID: Correlation-ID, Job ID: job-id, Call Stack: null, Custom ID: null, Custom Event ID: -1, Message: Failed to remove Storage Domain main. (User: admin@internal-authz)

(Originally by Koutuk Shukla)

Comment 7 Elad 2018-04-23 14:45:19 UTC
Cannot test the scenario since it's about LUN id and not the LUN name. 
With the hardware we have in RHV QE (XtremIO, Netapp and targetcli) there is no way (that I could find) to do so.


Moving to VERIFIED based on my review of the change done in the patch attached to this bug and it would be great if the customer could test this in his environment.


Used:
rhevm-4.1.11.2-0.1.el7.noarch
vdsm-4.19.51-1.el7ev.x86_64

Comment 10 errata-xmlrpc 2018-04-24 15:30:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1219

Comment 11 Franta Kust 2019-05-16 13:03:54 UTC
BZ<2>Jira Resync