Bug 871029 - [rhevm] bad SQL statement message during creation Live-Snapshot with max chars length (please add validation on backend\UI)
[rhevm] bad SQL statement message during creation Live-Snapshot with max char...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
x86_64 Linux
unspecified Severity high
: ---
: 3.2.0
Assigned To: Arik
vvyazmin@redhat.com
virt
:
: 871026 (view as bug list)
Depends On:
Blocks: 915537
  Show dependency treegraph
 
Reported: 2012-10-29 08:55 EDT by vvyazmin@redhat.com
Modified: 2014-01-01 03:44 EST (History)
11 users (show)

See Also:
Fixed In Version: sf1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
## Logs vdsm (241.79 KB, application/x-gzip)
2012-10-29 08:55 EDT, vvyazmin@redhat.com
no flags Details

  None (edit)
Description vvyazmin@redhat.com 2012-10-29 08:55:28 EDT
Created attachment 634988 [details]
## Logs vdsm

Severity: High
Summary: Insufficient SQL statement message, during creation Live-Snapshot with max chars length

Description of problem: Insufficient SQL statement message, during creation Live-Snapshot with max chars length


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

RHEVM: rhevm-3.1.0-22.el6ev.noarch
VDSM: vdsm-4.9.6-39.0.el6_3.x86_64
LIBVIRT: libvirt-0.9.10-21.el6_3.5.x86_64
QEMU & KVM: qemu-kvm-rhev-0.12.1.2-2.295.el6_3.2.x86_64
SANLOCK: sanlock-2.3-4.el6_3.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create Live-Snapshot with max chars length
  
Actual results:
SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(4000)

Expected results:
Validation at backend and frontend system for max chars length

Additional info:

/var/log/ovirt-engine/engine.log

2012-10-29 10:32:44,855 INFO  [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (pool-4-thread-42) [783ae7f6] Running command: CreateAllSnapshotsFromVmCommand internal
: false. Entities affected :  ID: 67ca9c19-fd90-4b2f-8389-f1f86e969c98 Type: VM
2012-10-29 10:32:44,896 ERROR [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (pool-4-thread-42) [783ae7f6] Command org.ovirt.engine.core.bll.CreateAllSnapshotsFromV
mCommand throw exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call insertsnapshot(?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: value t
oo long for type character varying(4000)
  Where: SQL statement "INSERT INTO snapshots( snapshot_id, status, vm_id, snapshot_type, description, creation_date, app_list, vm_configuration) VALUES(  $1 ,  $2 ,  $3 ,  $4 ,
  $5 ,  $6 ,  $7 ,  $8 )"
PL/pgSQL function "insertsnapshot" line 2 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(4000)
  Where: SQL statement "INSERT INTO snapshots( snapshot_id, status, vm_id, snapshot_type, description, creation_date, app_list, vm_configuration) VALUES(  $1 ,  $2 ,  $3 ,  $4 ,
  $5 ,  $6 ,  $7 ,  $8 )"
PL/pgSQL function "insertsnapshot" line 2 at SQL statement
        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1
.RELEASE]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1
.RELEASE]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1
.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:124) [engine-dal.jar:]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:37) [engine-dal.jar:]
        at org.ovirt.engine.core.dao.DefaultGenericDaoDbFacade.save(DefaultGenericDaoDbFacade.java:93) [engine-dal.jar:]
        at org.ovirt.engine.core.bll.snapshots.SnapshotsManager.addSnapshot(SnapshotsManager.java:133) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.snapshots.SnapshotsManager.addSnapshot(SnapshotsManager.java:96) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.ExecuteVmCommand(CreateAllSnapshotsFromVmCommand.java:92) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:78) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:825) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:916) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1300) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:204) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:142) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:109) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:931) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:285) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.MultipleActionsRunner.executeValidatedCommands(MultipleActionsRunner.java:182) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.MultipleActionsRunner.RunCommands(MultipleActionsRunner.java:162) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.MultipleActionsRunner$1.run(MultipleActionsRunner.java:84) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:64) [engine-utils.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09-icedtea]
        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]
Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(4000)
  Where: SQL statement "INSERT INTO snapshots( snapshot_id, status, vm_id, snapshot_type, description, creation_date, app_list, vm_configuration) VALUES(  $1 ,  $2 ,  $3 ,  $4 ,  $5 ,  $6 ,  $7 ,  $8 )"
PL/pgSQL function "insertsnapshot" line 2 at SQL statement
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:360)
        at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:297)
        at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404)
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1066) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1014) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        ... 29 more

2012-10-29 10:32:44,917 ERROR [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (pool-4-thread-42) [783ae7f6] Transaction rolled-back for command: org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.
2012-10-29 10:32:44,919 INFO  [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (pool-4-thread-42) [783ae7f6] Lock freed to object EngineLock [exclusiveLocks= key: 67ca9c19-fd90-4b2f-8389-f1f86e969c98 value: VM
, sharedLocks= ]
2012-10-29 10:34:35,193 INFO  [org.ovirt.engine.core.bll.DbUserCacheManager] (QuartzScheduler_Worker-95) DbUserCacheManager::refreshAllUserData() - entered
2012-10-29 10:35:00,000 INFO  [org.ovirt.engine.core.bll.AutoRecoveryManager] (QuartzScheduler_Worker-11) Autorecovering hosts is disabled, skipping
Comment 1 Allon Mureinik 2012-10-29 09:27:58 EDT
The descriptions is too long.

Need to add validation to the Snapshots Business Entity, and have it fail there before attempting to insert to the DB.

Devel-ack given for zstream solution.
Comment 2 Allon Mureinik 2012-10-29 10:15:53 EDT
*** Bug 871026 has been marked as a duplicate of this bug. ***
Comment 3 Arik 2012-11-04 09:03:08 EST
http://gerrit.ovirt.org/9011
Comment 4 Andrew Cathrow 2012-12-05 07:59:12 EST
moving to 3.2 only
Comment 6 Leonid Natapov 2013-01-30 08:33:45 EST
sf4. fixed. validation for max chars was added to snapshot entity.
Comment 7 Itamar Heim 2013-06-11 05:50:04 EDT
3.2 has been released
Comment 8 Itamar Heim 2013-06-11 05:50:13 EDT
3.2 has been released
Comment 9 Itamar Heim 2013-06-11 05:58:02 EDT
3.2 has been released

Note You need to log in before you can comment on or make changes to this bug.