Bug 917719 - engine: CreateAllSnapshotsFromVm threw an exception during vdsm restart
Summary: engine: CreateAllSnapshotsFromVm threw an exception during vdsm restart
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.2.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: 3.2.0
Assignee: Maor
QA Contact: Dafna Ron
URL:
Whiteboard: storage
Depends On:
Blocks: 948448
TreeView+ depends on / blocked
 
Reported: 2013-03-04 16:04 UTC by Dafna Ron
Modified: 2022-07-09 06:09 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When attempting to update a snapshot which did not exist, the createAllSnapshotCommand execution encountered a rollback, deleting the new snapshot and causing an SQL exception. Now, when a non-existent snapshot is updated, VDSM fails the action. A snapshot can only be updated when it is already created in the database.
Clone Of:
Environment:
Last Closed: 2013-06-10 21:35:21 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
logs (521.36 KB, application/x-gzip)
2013-03-04 16:04 UTC, Dafna Ron
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-47193 0 None None None 2022-07-09 06:09:51 UTC
Red Hat Product Errata RHSA-2013:0888 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Virtualization Manager 3.2 update 2013-06-11 00:55:41 UTC
oVirt gerrit 12731 0 None None None Never

Description Dafna Ron 2013-03-04 16:04:10 UTC
Created attachment 705058 [details]
logs

Description of problem:

reateAllSnapshotsFromVm threw an exception when we restart vdsm during create live snapshot

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

sf9

How reproducible:

100% 

Steps to Reproduce:
1. create a vm and run it
2. once vm is up, create a live snapshot
3. restart vdsm after the create snapshot dialogue is closed and before the disks get locked. 
  
Actual results:

reateAllSnapshotsFromVm threw an exception

Expected results:

we should not have an exception

Additional info:logs

2013-03-04 05:56:39,678 ERROR [org.ovirt.engine.core.bll.SPMAsyncTask] (QuartzScheduler_Worker-71) BaseAsyncTask::LogEndTaskFailure: Task dd23737f-0d73-43d6-8359-40cf90f2af39 (Parent Command CreateAllSnapshotsFromVm, Parameters Type org
.ovirt.engine.core.common.asynctasks.AsyncTaskParameters) ended with failure:
-- Result: success
-- Message: Asynchronous Task unknown error,
-- Exception: [null]
2013-03-04 05:56:39,678 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (QuartzScheduler_Worker-71) EntityAsyncTask::EndActionIfNecessary: All tasks of entity 0acdee33-e734-4366-ab58-892d080e0ba7 has ended -> executing EndAction
2013-03-04 05:56:39,678 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (QuartzScheduler_Worker-71) EntityAsyncTask::EndAction: Ending action for 2 tasks (entity ID: 0acdee33-e734-4366-ab58-892d080e0ba7): calling EndAction for action 
type CreateAllSnapshotsFromVm.
2013-03-04 05:56:39,678 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-3-thread-47) EntityAsyncTask::EndCommandAction [within thread] context: Attempting to EndAction CreateAllSnapshotsFromVm, executionIndex: 0
2013-03-04 05:56:39,692 ERROR [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (pool-3-thread-47) Ending command with failure: org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand
2013-03-04 05:56:39,702 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-3-thread-47) transaction rolled back
2013-03-04 05:56:39,704 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-3-thread-47) transaction rolled back
2013-03-04 05:56:39,721 ERROR [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-3-thread-47) EntityAsyncTask::EndCommandAction [within thread]: EndAction for action type CreateAllSnapshotsFromVm threw an exception: org.springframework.d
ao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call updatesnapshotid(?, ?)}]; ERROR: null value in column "snapshot_id" violates not-null constraint
  Where: SQL statement "UPDATE snapshots SET snapshot_id =  $1  WHERE snapshot_id =  $2 "
PL/pgSQL function "updatesnapshotid" line 2 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: null value in column "snapshot_id" violates not-null constraint
  Where: SQL statement "UPDATE snapshots SET snapshot_id =  $1  WHERE snapshot_id =  $2 "
PL/pgSQL function "updatesnapshotid" line 2 at SQL statement
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:245) [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.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.SnapshotDaoDbFacadeImpl.updateId(SnapshotDaoDbFacadeImpl.java:61) [engine-dal.jar:]
        at org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.revertToActiveSnapshot(CreateAllSnapshotsFromVmCommand.java:258) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand$1.runInTransaction(CreateAllSnapshotsFromVmCommand.java:181) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand$1.runInTransaction(CreateAllSnapshotsFromVmCommand.java:166) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.endVmCommand(CreateAllSnapshotsFromVmCommand.java:166) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.VmCommand.endWithFailure(VmCommand.java:229) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.internalEndWithFailure(CommandBase.java:573) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endActionInTransactionScope(CommandBase.java:485) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1511) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:141) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:110) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endAction(CommandBase.java:429) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.endAction(Backend.java:379) [engine-bll.jar:]
        at sun.reflect.GeneratedMethodAccessor254.invoke(Unknown Source) [:1.7.0_09-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]
        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09-icedtea]
        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee.jar:7.1.3.Final-redhat-4]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation.jar:1.1.1.Final-redhat-2]
        at org.ovirt.engine.core.utils.ThreadLocalSessionCleanerInterceptor.injectWebContextToThreadLocal(ThreadLocalSessionCleanerInterceptor.java:11) [engine-utils.jar:]
        at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source) [:1.7.0_09-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]

Comment 1 Maor 2013-03-05 16:20:03 UTC
Merged with change id Ia96cd0958dcdb34d590a160b422b3b2562149344

Comment 3 Dafna Ron 2013-03-13 08:37:12 UTC
verified on sf10

Comment 4 Cheryn Tan 2013-04-03 06:51:38 UTC
This bug is currently attached to errata RHEA-2013:14491. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.

* Consequence: What happens when the bug presents.

* Fix: What was done to fix the bug.

* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes

Thanks in advance.

Comment 5 errata-xmlrpc 2013-06-10 21:35:21 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.

http://rhn.redhat.com/errata/RHSA-2013-0888.html


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