Bug 1382368 - Adding VM via rhevm-shell to not set up DC fails with NPE
Summary: Adding VM via rhevm-shell to not set up DC fails with NPE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 3.6.7
Hardware: All
OS: All
unspecified
medium vote
Target Milestone: ---
: ---
Assignee: Michal Skrivanek
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-06 13:32 UTC by Lukas Svaty
Modified: 2016-11-03 14:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 14:16:44 UTC
oVirt Team: Virt
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description Lukas Svaty 2016-10-06 13:32:10 UTC
Description of problem:
Have new engine, no hosts, no storages, thus DC is down.
Try to add Vm via rhevm-shell.


Version-Release number of selected component (if applicable):
rhevm-3.6.9.2-0.1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. [oVirt shell (connected)]# add vm --cluster-name Default --name test02 --template-name  Blank
  ==================================== ERROR =================================
  status: 500
  reason: Internal Server Error
  detail: java.lang.NullPointerException
  ============================================================================


Actual results:
NPE

Expected results:
Should check if DC is up and disable actions within.

Additional info:
2016-10-06 15:01:55,742 INFO  [org.ovirt.engine.core.bll.aaa.LoginUserCommand] (ajp-/127.0.0.1:8702-9) [] Running command: LoginUserCommand internal: false.
2016-10-06 15:01:55,766 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ajp-/127.0.0.1:8702-9) [] Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: User admin@internal logged in.
2016-10-06 15:01:55,971 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (ajp-/127.0.0.1:8702-9) [] An exception has occured while trying to create a command object for command 'AddVmFromScratch': WELD-000049 Unable to invoke [method] @PostConstruct protected final org.ovirt.engine.core.bll.CommandBase.postConstruct() on org.ovirt.engine.core.bll.AddVmFromScratchCommand@6b65aae2
2016-10-06 15:01:55,990 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-9) [] Operation Failed: java.lang.NullPointerException
2016-10-06 15:01:55,990 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-9) [] Exception: javax.ejb.EJBException: java.lang.NullPointerException

Comment 1 Juan Hernández 2016-10-07 12:45:06 UTC
The relevant lines from server.log seem to be the following:

  Caused by: java.lang.NullPointerException
    at org.ovirt.engine.core.bll.Backend.evaluateCorrelationId(Backend.java:494) [bll.jar:]
    at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:477) [bll.jar:]
    at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:466) [bll.jar:]
    at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:419) [bll.jar:]

Apparently in this situation creation of the command instance fails, and returns null.

Comment 2 Tomas Jelinek 2016-10-11 06:54:55 UTC
does it reproduce also on 4.0 engine?

Comment 3 Lukas Svaty 2016-10-24 12:16:06 UTC
working for 4.0

[oVirt shell (connected)]# add vm --cluster-name Clean --name test --template-name  Blank
* Found bundle for host ******: 0x26fa460
* Connection 0 seems to be dead!
* Closing connection 0
* About to connect() to ******** port 443 (#1)
* Trying ***.***.***.***...
* Connected to ******** (***.***.***.***) port 443 (#1)
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=********,O=********,C=US
* start date: Sep 15 08:48:56 2016 GMT
* expire date: Aug 21 08:48:56 2021 GMT
* common name: ********
* issuer: CN=********.32711,O=$PROD,C=US
* Server auth using Basic with user 'admin@internal'
> POST /ovirt-engine/api/vms HTTP/1.1
> Authorization: Basic YWRtaW5AaW50ZXJuYWw6MTIzNDU2
> User-Agent: PycURL/7.29.0
> Host: ********
> Cookie: JSESSIONID=y1vdQvRuVGMeNbMYNJFiZXsDHanzI99x3vNCt57c.********
> Version: 3
> Content-Type: application/xml
> Accept: application/xml
> Filter: False
> Prefer: persistent-auth
> Content-Length: 147
> <vm>
>     <name>test</name>
>     <cluster>
>         <name>Clean</name>
>     </cluster>
>     <template>
>         <name>Blank</name>
>     </template>
> </vm>
* upload completely sent off: 147 out of 147 bytes
< HTTP/1.1 400 Bad Request
< Date: Mon, 24 Oct 2016 12:10:39 GMT
< Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips
< Content-Type: application/xml
< Content-Length: 265
< Connection: close
< 
< <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< <fault>
<     <reason>Operation Failed</reason>
<     <detail>[Cannot add VM: Storage Domain cannot be accessed.
< -Please check that at least one Host is operational and Data Center state is up.]</detail>
< </fault>
* Closing connection 1
  ==================================== ERROR =================================
  status: 400
  reason: Bad Request
  detail: Cannot add VM: Storage Domain cannot be accessed.
-Please check that at least one Host is operational and Data Center state is up.
  ============================================================================

Comment 4 Tomas Jelinek 2016-11-03 14:16:44 UTC
great, works on 4.0, closing


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