Bug 1322923 - java.lang.IllegalArgumentException: No type specified for option: 'encrypt_options' in /api/capabilities
Summary: java.lang.IllegalArgumentException: No type specified for option: 'encrypt_op...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.6.4
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ovirt-4.0.0-alpha
: 4.0.0
Assignee: Juan Hernández
QA Contact: Gonza
URL:
Whiteboard:
Depends On:
Blocks: 1323450
TreeView+ depends on / blocked
 
Reported: 2016-03-31 16:45 UTC by Itamar Heim
Modified: 2016-08-23 20:34 UTC (History)
10 users (show)

Fixed In Version: ovirt 4.0.0 alpha1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1323450 (view as bug list)
Environment:
Last Closed: 2016-08-23 20:34:06 UTC
oVirt Team: Infra
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:1743 0 normal SHIPPED_LIVE Red Hat Virtualization Manager 4.0 GA Enhancement (ovirt-engine) 2016-09-02 21:54:01 UTC
oVirt gerrit 55571 0 master MERGED restapi: Tolerate invalid fencing options 2016-04-03 09:33:29 UTC
oVirt gerrit 55572 0 ovirt-engine-3.6 MERGED restapi: Tolerate invalid fencing options 2016-04-03 11:04:28 UTC
oVirt gerrit 55602 0 ovirt-engine-3.6.5 MERGED restapi: Tolerate invalid fencing options 2016-04-04 08:57:10 UTC

Description Itamar Heim 2016-03-31 16:45:39 UTC
using RHEV in Version 3.6.4-0.1.el6
trying to fetch /ovirt-engine/api/capabilities i get:

JBWEB000065: HTTP Status 500 - java.lang.IllegalArgumentException: No type specified for option: 'encrypt_options'

JBWEB000309: type JBWEB000066: Exception report

JBWEB000068: message java.lang.IllegalArgumentException: No type specified for option: 'encrypt_options'

JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.

JBWEB000070: exception

org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalArgumentException: No type specified for option: 'encrypt_options'
	org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:367)
	org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:235)
	org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:211)
	org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:576)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:543)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:128)
	org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	org.ovirt.engine.api.common.invocation.CurrentFilter.doFilter(CurrentFilter.java:66)
	org.ovirt.engine.api.common.invocation.CurrentFilter.doFilter(CurrentFilter.java:48)
	org.ovirt.engine.core.aaa.filters.RestApiSessionMgmtFilter.doFilter(RestApiSessionMgmtFilter.java:81)
	org.ovirt.engine.core.aaa.filters.EnforceAuthFilter.doFilter(EnforceAuthFilter.java:39)
	org.ovirt.engine.core.aaa.filters.LoginFilter.doFilter(LoginFilter.java:75)
	org.ovirt.engine.core.aaa.filters.NegotiationFilter.doFilter(NegotiationFilter.java:113)
	org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:90)
	org.ovirt.engine.core.aaa.filters.SessionValidationFilter.doFilter(SessionValidationFilter.java:77)
	org.ovirt.engine.core.aaa.filters.EngineSessionTokenAuthenticationFilter.doFilter(EngineSessionTokenAuthenticationFilter.java:31)
	org.ovirt.engine.core.aaa.filters.RestApiSessionValidationFilter.doFilter(RestApiSessionValidationFilter.java:35)
	org.ovirt.engine.api.common.security.CSRFProtectionFilter.doFilter(CSRFProtectionFilter.java:111)
	org.ovirt.engine.api.common.security.CSRFProtectionFilter.doFilter(CSRFProtectionFilter.java:102)
	org.ovirt.engine.api.common.security.CORSSupportFilter.doFilter(CORSSupportFilter.java:183)

JBWEB000071: root cause

java.lang.IllegalArgumentException: No type specified for option: 'encrypt_options'
	org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseOption(FenceOptionsParser.java:105)
	org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseOptions(FenceOptionsParser.java:79)
	org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseAgent(FenceOptionsParser.java:68)
	org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse(FenceOptionsParser.java:24)
	org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.getPowerManagers(BackendCapabilitiesResource.java:647)
	org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.generateVersionCaps(BackendCapabilitiesResource.java:245)
	org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.list(BackendCapabilitiesResource.java:219)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)
	org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168)
	org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)
	org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)
	org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216)
	org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:561)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:543)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:128)
	org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	org.ovirt.engine.api.common.invocation.CurrentFilter.doFilter(CurrentFilter.java:66)
	org.ovirt.engine.api.common.invocation.CurrentFilter.doFilter(CurrentFilter.java:48)
	org.ovirt.engine.core.aaa.filters.RestApiSessionMgmtFilter.doFilter(RestApiSessionMgmtFilter.java:81)
	org.ovirt.engine.core.aaa.filters.EnforceAuthFilter.doFilter(EnforceAuthFilter.java:39)
	org.ovirt.engine.core.aaa.filters.LoginFilter.doFilter(LoginFilter.java:75)
	org.ovirt.engine.core.aaa.filters.NegotiationFilter.doFilter(NegotiationFilter.java:113)
	org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:90)
	org.ovirt.engine.core.aaa.filters.SessionValidationFilter.doFilter(SessionValidationFilter.java:77)
	org.ovirt.engine.core.aaa.filters.EngineSessionTokenAuthenticationFilter.doFilter(EngineSessionTokenAuthenticationFilter.java:31)
	org.ovirt.engine.core.aaa.filters.RestApiSessionValidationFilter.doFilter(RestApiSessionValidationFilter.java:35)
	org.ovirt.engine.api.common.security.CSRFProtectionFilter.doFilter(CSRFProtectionFilter.java:111)
	org.ovirt.engine.api.common.security.CSRFProtectionFilter.doFilter(CSRFProtectionFilter.java:102)
	org.ovirt.engine.api.common.security.CORSSupportFilter.doFilter(CORSSupportFilter.java:183)

Comment 1 Juan Hernández 2016-04-01 09:51:52 UTC
The only way this can happen is if the "encrypt_options=bool" pair is missing from the VdsFenceOptionTypes configuration value. Please check if this is the case, with the following SQL query:

  select * from vdc_options where option_name='VdsFenceOptionTypes'

The result should be the following:

  encrypt_options=bool,secure=bool,port=int,slot=int

If it isn't, then update the database:

  update vdc_options set option_value='secure=bool,port=int,slot=int' where option_name='VdsFenceOptionTypes'

Then restart the engine and it should work correctly.

In theory this value is automatically added during updates:

  https://github.com/oVirt/ovirt-engine/blob/ovirt-engine-3.6/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql#L601

Any chances that this has been manually modified after the upgrade?

Anyhow, a missing parameter like this should not cause a complete failure of the capabilities resource, we will fix that.

Comment 3 Juan Hernández 2016-04-01 11:00:15 UTC
Oved, please request the 3.6.z flag.

Comment 4 Juan Hernández 2016-04-01 12:01:31 UTC
The SQL statement to update the database in comment 1 is wrong, it should obviously include the missing pair:

  update vdc_options set option_value='encrypt_options=bool,secure=bool,port=int,slot=int' where option_name='VdsFenceOptionTypes'

Comment 6 Juan Hernández 2016-04-04 09:05:18 UTC
Note that in order to test and verify this you will need to force an error in the configuration. To do so manually perform the following update in the database:

  update vdc_options set option_value='secure=bool,port=int,slot=int' where option_name='VdsFenceOptionTypes'

Then restart the engine, and once it is running again request the API capabilities resource:

  GET /ovirt-engine/api/capabilities

That used to fail but should succeed now, and the following error message should appear in engine.log:

  ERROR: No type specified for fencing option "encrypt_options".

Comment 7 Gonza 2016-06-24 08:54:56 UTC
Verified with:
rhevm-4.0.0.6-0.1.el7ev.noarch

Comment 9 errata-xmlrpc 2016-08-23 20:34:06 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.

https://rhn.redhat.com/errata/RHEA-2016-1743.html


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