Bug 1047536 - [GSS] (6.2.x) management audit settings: syslog protocol is lowercase while uppercase is expected
Summary: [GSS] (6.2.x) management audit settings: syslog protocol is lowercase while u...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Domain Management
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.2.1
Assignee: Tom Fonteyne
QA Contact: Petr Kremensky
URL:
Whiteboard:
Depends On: 1047519
Blocks: eap62-cp01-blockers 1049824
TreeView+ depends on / blocked
 
Reported: 2013-12-31 15:24 UTC by Tom Fonteyne
Modified: 2018-12-04 16:47 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A bug in the management audit settings caused server instances to fail when a syslog handler was added to the domain controller. It was found that org.jboss.as.domain.management.audit defined the UDP protocol using lowercase letters ('udp') while the enum used uppercase ('UDP'). The issue has been resolved by defining the protocol in org.jboss.as.domain.management.audit with uppercase letters.
Clone Of: 1047519
: 1049824 (view as bug list)
Environment:
Last Closed: 2014-02-24 20:14:51 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2696 Major Closed management audit settings: syslog protocol is lowercase while uppercase is expected 2018-12-27 16:28:20 UTC

Description Tom Fonteyne 2013-12-31 15:24:44 UTC
+++ This bug was initially created as a clone of Bug #1047519 +++

backport of https://issues.jboss.org/browse/WFLY-2696
to 6.x, for inclusion in 6.2.1 release

Description of problem:

Add a syslog handler to the audit settings of the management service of the domain controller, then start an instance. It fails to start with:

JBAS014612: Operation ("register-server") failed - address: ([]): java.lang.IllegalArgumentException: No enum const class org.jboss.as.controller.audit.SyslogAuditLogHandler$Transport.udp
at java.lang.Enum.valueOf(Enum.java:214)


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


How reproducible:


Steps to Reproduce:


clean install using domain mode.

batch
/host=master/core-service=management/access=audit/syslog-handler=mysyslog:add(formatter=json-formatter)
/host=master/core-service=management/access=audit/syslog-handler=mysyslog/protocol=udp:add(host=localhost,port=514)
run-batch

/host=master/core-service=management/access=audit/logger=audit-log/handler=mysyslog:add()

and subsequently try to start an instance. This generates:

17:30:25,066 ERROR [org.jboss.as.controller.management-operation] (server-registration-threads - 1) JBAS014612: Operation ("register-server") failed - address: ([]): java.lang.IllegalArgumentException: No enum const class org.jboss.as.controller.audit.SyslogAuditLogHandler$Transport.udp
at java.lang.Enum.valueOf(Enum.java:214) [rt.jar:1.6.0_24]
at org.jboss.as.controller.audit.SyslogAuditLogHandler$Transport.valueOf(SyslogAuditLogHandler.java:315) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.domain.management.audit.SyslogAuditLogProtocolResourceDefinition.createProtocolAddOperation(SyslogAuditLogProtocolResourceDefinition.java:128) [jboss-as-domain-management-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.domain.management.audit.SyslogAuditLogProtocolResourceDefinition.createServerAddOperations(SyslogAuditLogProtocolResourceDefinition.java:107) [jboss-as-domain-management-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.domain.management.audit.SyslogAuditLogHandlerResourceDefinition.createServerAddOperations(SyslogAuditLogHandlerResourceDefinition.java:105) [jboss-as-domain-management-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.host.controller.ManagedServerOperationsFactory.addAuditLog(ManagedServerOperationsFactory.java:444)
at org.jboss.as.host.controller.ManagedServerOperationsFactory.getBootUpdates(ManagedServerOperationsFactory.java:227)
at org.jboss.as.host.controller.ManagedServerOperationsFactory.createBootUpdates(ManagedServerOperationsFactory.java:153)
at org.jboss.as.host.controller.mgmt.ServerToHostProtocolHandler$ServerRegistrationStepHandler.execute(ServerToHostProtocolHandler.java:219)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:607) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:485) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:282) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:277) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.controller.ModelControllerImpl.executeReadOnlyOperation(ModelControllerImpl.java:164) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.controller.AbstractControllerService.executeReadOnlyOperation(AbstractControllerService.java:303) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.host.controller.DomainModelControllerService.access$700(DomainModelControllerService.java:140)
at org.jboss.as.host.controller.DomainModelControllerService$3.joinActiveOperation(DomainModelControllerService.java:515)
at org.jboss.as.host.controller.mgmt.ServerToHostProtocolHandler$ServerRegistrationRequestHandler$1.execute(ServerToHostProtocolHandler.java:180)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:283) [jboss-as-protocol-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:504) [jboss-as-protocol-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) [rt.jar:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.6.0_24]
at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar:2.1.1.Final-redhat-1]

The issue is simple:

package org.jboss.as.domain.management.audit;

public abstract class SyslogAuditLogProtocolResourceDefinition extends SimpleResourceDefinition {
...

public static ModelNode createProtocolAddOperation(final PathAddress protocolAddress, final ModelNode protocol){
ModelNode protocolAdd = Util.createAddOperation(protocolAddress);
protocolAdd.get(HOST.getName()).set(protocol.get(HOST.getName()));
protocolAdd.get(PORT.getName()).set(protocol.get(PORT.getName()));

SyslogAuditLogHandler.Transport transport = SyslogAuditLogHandler.Transport.valueOf(protocolAddress.getLastElement().getValue());

with:

protocolAddress = (org.jboss.as.controller.PathAddress) [
("core-service" => "management"),
("access" => "audit"),
("syslog-handler" => "mysyslog"),
("protocol" => "udp")
]

so "udp" is used... but the enum:

public enum Transport
{ UDP, TCP, TLS }

has an uppercase UDP.

The same issue happens in

public static void createServerAddOperations(final List<ModelNode> addOps, final PathAddress protocolAddress, final ModelNode protocol) {
addOps.add(createProtocolAddOperation(protocolAddress, protocol));

final SyslogAuditLogHandler.Transport transport = SyslogAuditLogHandler.Transport.valueOf(protocolAddress.getLastElement().getValue());

Solution: make uppercase:

SyslogAuditLogHandler.Transport.valueOf(protocolAddress.getLastElement().getValue().toUpperCase());

--- Additional comment from Tom Fonteyne on 2013-12-31 09:10:23 EST ---

pull request send:

https://github.com/jbossas/jboss-eap/pull/743

Comment 1 Tom Fonteyne 2013-12-31 15:35:20 UTC
ignore pull request above, came from cloning the bug.

pull request for 6.2.x:

https://github.com/jbossas/jboss-eap/pull/744

Comment 2 Tom Fonteyne 2014-01-07 13:18:02 UTC
new (and final) pull request send:

https://github.com/jbossas/jboss-eap/pull/757

Comment 3 Scott Mumford 2014-01-20 01:08:01 UTC
Marking for inclusion in 6.2.1 release notes documentation.

Comment 4 Scott Mumford 2014-01-23 00:14:17 UTC
Added draft release note.

Comment 5 Nikoleta Hlavickova 2014-01-27 09:26:23 UTC
Verified with 6.2.1.CP.CR1-patch.

Comment 6 Nikoleta Hlavickova 2014-01-30 12:16:34 UTC
Fixed a typo in Doc Text 'UPD' -> 'UDP'

Comment 7 Lucas Costi 2014-01-30 23:35:46 UTC
Resetting flag for 6.2.1 release notes.


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