Bug 873595 - engine: NPE when previewing a snapshot created with no disks after adding a disk
engine: NPE when previewing a snapshot created with no disks after adding a disk
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
x86_64 Linux
high Severity high
: ---
: 3.2.0
Assigned To: Liron Aravot
Dafna Ron
storage
: Regression
Depends On:
Blocks: 915537
  Show dependency treegraph
 
Reported: 2012-11-06 04:35 EST by Dafna Ron
Modified: 2016-02-10 11:57 EST (History)
9 users (show)

See Also:
Fixed In Version: sf3
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: Storage
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
log (92.26 KB, application/x-xz)
2012-11-06 04:35 EST, Dafna Ron
no flags Details

  None (edit)
Description Dafna Ron 2012-11-06 04:35:34 EST
Created attachment 639223 [details]
log

Description of problem:

we get NPE when we preview a snapshot created from a vm with no disks after adding a disk to the vm
although UI shows that the snapshot is previewed its not actually previewed 
undo will have no effect
commit will cause a second NPE

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

si24

How reproducible:

100%

Steps to Reproduce:
1. create a vm with no disk
2. create a snapshot
3. create a disk to the vm
4. preview snapshot

  
Actual results:

we get NPE and UI shows: Error while executing action Preview Snapshot: Internal oVirt Engine Error

Expected results:

we should not get NPE

Additional info: full log attached 

2012-11-06 11:22:50,278 INFO  [org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand] (ajp-/127.0.0.1:8702-11) [26d40812] Running command: TryBackToAllSnapshotsOfVmCommand internal: false. Entities affected :  ID: 93ff1170-52dc-42c
7-991c-ce9bc3b93f95 Type: VM
2012-11-06 11:22:50,755 ERROR [org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand] (ajp-/127.0.0.1:8702-11) [26d40812] Command org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand throw exception: java.lang.NullPointerExce
ption
        at org.ovirt.engine.core.utils.ovf.OvfWriter.BuildDisk(OvfWriter.java:152) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.ovf.OvfManager.BuildOvf(OvfManager.java:92) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.ovf.OvfManager.ExportVm(OvfManager.java:24) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm(VmCommand.java:182) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm(VmCommand.java:156) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.restoreVmConfigFromSnapshot(TryBackToAllSnapshotsOfVmCommand.java:109) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.ExecuteVmCommand(TryBackToAllSnapshotsOfVmCommand.java:175) [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:875) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:972) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1371) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:168) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:107) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:990) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:291) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:350) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.RunAction(Backend.java:299) [engine-bll.jar:]
        at sun.reflect.GeneratedMethodAccessor276.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.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.ovirt.engine.core.utils.ThreadLocalSessionCleanerInterceptor.injectWebContextToThreadLocal(ThreadLocalSessionCleanerInterceptor.java:11) [engine-utils.jar:]
        at sun.reflect.GeneratedMethodAccessor22.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.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:123) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
Comment 4 Liron Aravot 2012-11-07 10:16:14 EST
Why is it marked as regression? when did it work for snapshots without disks?
Comment 5 Dafna Ron 2012-11-07 11:02:56 EST
since we moved to a disk entity and allowed creating a snapshot for a vm without a disk
Comment 6 Liron Aravot 2012-11-08 04:05:07 EST
I've meant to the mentioned scenario, preview ever after vm had disks ever worked for previous snapshots without disks?
Comment 7 Dafna Ron 2012-11-08 04:09:47 EST
(In reply to comment #6)
> I've meant to the mentioned scenario, preview ever after vm had disks ever
> worked for previous snapshots without disks?

yes
Comment 8 Liron Aravot 2012-11-08 12:21:47 EST
http://gerrit.ovirt.org/#/c/9128/
Comment 9 mkublin 2012-11-14 08:14:57 EST
The commit was reverted, because of causing performance regression at transaction manager.

Change of revert: 
http://gerrit.ovirt.org/#/c/9240/
Comment 10 Ayal Baron 2012-12-25 09:42:10 EST
Reintroduced upstream, change id: I5c9fd926e61e860f4af9ff460c6657cf81b1fc85
Comment 11 Dafna Ron 2013-01-07 11:58:08 EST
preview works but undo has a java.lang.IndexOutOfB
oundsException
verifying this bug for sf3 and opening a new bug for undo
Comment 12 Itamar Heim 2013-06-11 05:07:47 EDT
3.2 has been released
Comment 13 Itamar Heim 2013-06-11 05:07:49 EDT
3.2 has been released
Comment 14 Itamar Heim 2013-06-11 05:07:50 EDT
3.2 has been released
Comment 15 Itamar Heim 2013-06-11 05:36:24 EDT
3.2 has been released

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