Bug 1476191 - Export template to export domain failed with NPE
Export template to export domain failed with NPE
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage (Show other bugs)
4.2.0
x86_64 Linux
unspecified Severity high (vote)
: ovirt-4.2.0
: 4.2.0
Assigned To: Arik
Kevin Alon Goldblatt
: Automation
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-28 04:47 EDT by Meni Yakove
Modified: 2017-12-20 06:31 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-20 06:31:22 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.2+
ahadas: devel_ack+


Attachments (Terms of Use)
engine.log (392.22 KB, application/zip)
2017-07-28 04:47 EDT, Meni Yakove
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 79965 master MERGED core: prevent NPE when exporting networkless NIC 2017-07-31 03:34 EDT

  None (edit)
Description Meni Yakove 2017-07-28 04:47:51 EDT
Created attachment 1305844 [details]
engine.log

Description of problem:
Export template to export domain failed with NPE

Version-Release number of selected component (if applicable):
ovirt-engine-4.2.0-0.0.master.20170727151851.gitd1d0d67.el7.centos.noarch



Steps to Reproduce:
1.Export template to export domain (import_export network automation test)


Additional info:
2017-07-28 11:36:42,935+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.EE-ManagedThreadFactory-default-Thread-15) [] EVENT_ID: IMPORTEXPORT_
EXPORT_TEMPLATE_FAILED(1,157), Failed to export Template IE_TEMPLATE_36 to export_domain
2017-07-28 11:36:42,937+03 ERROR [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (org.ovirt.thread.EE-ManagedThreadFactory-default-Thread-15) [] [within thread]: endAction for action type ExportVmTemplate threw an exception.: java.lang.NullPointerException
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeXMLContent(XMLStreamWriterImpl.java:1447) [rt.jar:1.8.0_131]
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeAttributeWithPrefix(XMLStreamWriterImpl.java:600) [rt.jar:1.8.0_131]
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeAttribute(XMLStreamWriterImpl.java:578) [rt.jar:1.8.0_131]
        at org.ovirt.engine.core.utils.ovf.xml.XmlTextWriter.writeAttributeString(XmlTextWriter.java:57) [utils.jar:]
        at org.ovirt.engine.core.utils.ovf.OvfWriter.lambda$buildNetwork$0(OvfWriter.java:141) [utils.jar:]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) [rt.jar:1.8.0_131]
        at java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:175) [rt.jar:1.8.0_131]
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [rt.jar:1.8.0_131]
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) [rt.jar:1.8.0_131]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) [rt.jar:1.8.0_131]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [rt.jar:1.8.0_131]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) [rt.jar:1.8.0_131]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) [rt.jar:1.8.0_131]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [rt.jar:1.8.0_131]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) [rt.jar:1.8.0_131]
        at org.ovirt.engine.core.utils.ovf.OvfWriter.buildNetwork(OvfWriter.java:139) [utils.jar:]
        at org.ovirt.engine.core.utils.ovf.IOvfBuilder.build(IOvfBuilder.java:28) [utils.jar:]
        at org.ovirt.engine.core.utils.ovf.OvfManager.exportTemplate(OvfManager.java:67) [bll.jar:]
        at org.ovirt.engine.core.bll.storage.ovfstore.OvfUpdateProcessHelper.generateVmTemplateMetadata(OvfUpdateProcessHelper.java:79) [bll.jar:]
        at org.ovirt.engine.core.bll.storage.ovfstore.OvfUpdateProcessHelper.buildMetadataDictionaryForTemplate(OvfUpdateProcessHelper.java:88) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ExportVmTemplateCommand.incrementDbGeneration(ExportVmTemplateCommand.java:243) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.endVmTemplateRelatedOps(MoveOrCopyTemplateCommand.java:126) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.endMoveOrCopyCommand(MoveOrCopyTemplateCommand.java:118) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.endSuccessfully(MoveOrCopyTemplateCommand.java:141) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.internalEndSuccessfully(CommandBase.java:749) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endActionInTransactionScope(CommandBase.java:707) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:2077) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:137) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:105) [utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endAction(CommandBase.java:572) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.DecoratedCommand.endAction(DecoratedCommand.java:17) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CoCoAsyncTaskHelper.endAction(CoCoAsyncTaskHelper.java:337) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.endAction(CommandCoordinatorImpl.java:340) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandAsyncTask.endCommandAction(CommandAsyncTask.java:154) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandAsyncTask.lambda$endActionIfNecessary$0(CommandAsyncTask.java:106) [bll.jar:]
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:96) [utils.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_131]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_131]
Comment 1 Meni Yakove 2017-07-28 05:03:53 EDT
'/ovirt-engine/api/templates/92938cb8-5676-41f3-b937-cd570e374fe5/export'
<action>
    <async>false</async>
    <exclusive>false</exclusive>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <storage_domain>
        <name>export_domain</name>
    </storage_domain>
</action>
Comment 2 Allon Mureinik 2017-07-29 22:38:41 EDT
Arik, this NPE seems to come from code you introduced in your recent patch df304f76662171b0a7b8ed248593d5f9d322b8ef.

Moving to virt for initial analysis.
Comment 3 Arik 2017-07-30 04:07:59 EDT
Indeed, didn't consider networkless NICs.
Comment 4 Kevin Alon Goldblatt 2017-08-13 15:11:27 EDT
Verfied with the following code:
-------------------------------------------
ovirt-engine-4.2.0-0.0.master.20170723141021.git463826a.el7.centos.noarch
vdsm-4.20.2-60.git06231e5.el7.centos.x86_64

Verified with the following scenario:
-------------------------------------------
1. Export template to export domain - works fine!

Moving to VERIFIED!
Comment 5 Raz Tamir 2017-08-13 15:31:16 EDT
Kevin,
Please test it again with latest version
Comment 6 Kevin Alon Goldblatt 2017-08-17 08:48:43 EDT
Verfied with the following code:
-------------------------------------------
ovirt-engine-4.2.0-0.0.master.20170813134654.gitaee967b.el7.centos.noarch
vdsm-4.20.2-77.gite43f776.el7.centos.x86_64

Verified with the following scenario:
-------------------------------------------
1. Export template to export domain - works fine!

Moving to VERIFIED!
Comment 7 Sandro Bonazzola 2017-12-20 06:31:22 EST
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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

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