Description of problem: ovirtsdk.api.API.disks.add fails due to a server side java.lang.NullPointerException I simply get: Traceback (most recent call last): File "test_1215623.py", line 41, in <module> engine_api.disks.add(disk) File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/brokers.py", line 10650, in add headers={"Correlation-Id":correlation_id, "Expect":expect} File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 75, in add return self.request('POST', url, body, headers) File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 115, in request persistent_auth=self.__persistent_auth File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 79, in do_request persistent_auth) File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 154, in __do_request raise errors.RequestError(response_code, response_reason, response_body) ovirtsdk.infrastructure.errors.RequestError: status: 500 reason: Internal detail: HTTP Status 500 I cannot find anything under engine.log but under server.log I can find: 2015-05-20 17:22:14,659 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/ovirt-engine/api].[org.ovirt.engine.api.restapi.BackendApplication]] (ajp--127.0.0.1-8702-5) Servlet.service() for servlet org.ovirt.engine.api.restapi.BackendApplication threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException at ... ... ... Caused by: java.lang.NullPointerException at org.ovirt.engine.api.restapi.resource.BackendDisksResource.getStorageDomainById(BackendDisksResource.java:66) [restapi-jaxrs.jar:] at org.ovirt.engine.api.restapi.resource.BackendDisksResource.add(BackendDisksResource.java:38) [restapi-jaxrs.jar:] ... The attached snippet is enough to trigger it. The same snippet is working against 3.5.z Version-Release number of selected component (if applicable): ovirt-engine 3.6.0 How reproducible: 100% Steps to Reproduce: 1. customize and run the attached snippet 2. 3. Actual results: It generates a ovirtsdk.infrastructure.errors.RequestError: status: 500 reason: Internal detail: HTTP Status 500 client side and a java.lang.NullPointerException serverside Expected results: It works as in 3.5.z Additional info: It blocks hosted-engine on iSCSI and on FC
It's probably related to https://bugzilla.redhat.com/show_bug.cgi?id=1147860
Created attachment 1027781 [details] test snippet test_1223482.py
This is a duplicate of bug 1220824, and has already been fixed: restapi: avoid npe on vm disk creation without domain https://gerrit.ovirt.org/40826 *** This bug has been marked as a duplicate of bug 1220824 ***
I tried it with ovirt-engine.noarch 3.6.0-0.0.master.20150528052151.git92dca0e.el7.centos which should include patch 40826 for BZ#1220824 but the issue is still there. On hosted-engine side I'm still getting: 2015-05-29 16:06:14 DEBUG otopi.plugins.ovirt_hosted_engine_setup.engine.add_disk add_disk._closeup:199 Cannot add the Hosted Engine VM Disk to the engine Traceback (most recent call last): File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/ovirt-hosted-engine-setup/engine/add_disk.py", line 195, in _closeup engine_api.disks.add(disk) File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/brokers.py", line 10651, in add headers={"Correlation-Id":correlation_id, "Expect":expect} File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 75, in add return self.request('POST', url, body, headers) File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 115, in request persistent_auth=self.__persistent_auth File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 79, in do_request persistent_auth) File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 154, in __do_request raise errors.RequestError(response_code, response_reason, response_body) RequestError: ^M status: 500^M reason: Internal^M detail: HTTP Status 500 2015-05-29 16:06:14 ERROR otopi.plugins.ovirt_hosted_engine_setup.engine.add_disk add_disk._closeup:202 Cannot add the Hosted Engine VM Disk to the engine 2015-05-29 16:06:14 DEBUG otopi.context context._executeMethod:155 method exception Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/otopi/context.py", line 145, in _executeMethod method['method']() File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/ovirt-hosted-engine-setup/engine/add_disk.py", line 205, in _closeup _('Cannot add the Hosted Engine VM Disk to the engine') RuntimeError: Cannot add the Hosted Engine VM Disk to the engine The cause is that hosted-engine storage domain is not managed by the engine and probably we couldn't have it for 3.6. Please see: https://bugzilla.redhat.com/show_bug.cgi?id=1215158 But deploying hosted-engine-setup on iSCSI (and now also on FC), we still have to add the LUN were we deployed the engine VM as a direct LUN to prevent any other usages of that LUN which could destroy the engine itself. Please see: https://bugzilla.redhat.com/show_bug.cgi?id=1157243 https://bugzilla.redhat.com/show_bug.cgi?id=1157238 I'm attaching other logs.
Created attachment 1032183 [details] Host and engineVM logs
There's too many comments here for me to understand what's going on. Simone, can you provide simple steps to reproduce? Thanks!
Hi Allon, I already attached a test snippet to reproduce it. By the way we had a new patch on 1220824 (still on post) which cold be enough to solve this one.
*** This bug has been marked as a duplicate of bug 1220824 ***