Bug 1015585

Summary: Adding a new role mapping and then restarting the server via mgmt interface fails
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ladislav Thon <lthon>
Component: Domain ManagementAssignee: Darran Lofthouse <darran.lofthouse>
Status: CLOSED CURRENTRELEASE QA Contact: Ladislav Thon <lthon>
Severity: urgent Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.0CC: brian.stansberry, emuckenh, myarboro
Target Milestone: ER6   
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:23:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 999622    

Description Ladislav Thon 2013-10-04 14:29:03 UTC
Description of problem:

When you add a new role mapping and then request a server restart via the management interface, your server will crash.

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

EAP 6.2.0.ER4

How reproducible:

Always

Steps to Reproduce:
1. start a new server
   ./bin/standalone.sh
2. run CLI
   ./bin/jboss-cli.sh -c
3. add a new role mapping
   /core-service=management/access=authorization/role-mapping=Operator:add()
4. restart the server
   :reload

Actual results:

The server restarts fine with no error message.

Expected results:

The server "crashes" with an error message:

16:24:48,601 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("add") failed - address: ([
    ("core-service" => "management"),
    ("access" => "authorization"),
    ("role-mapping" => "SuperUser")
]): java.lang.UnsupportedOperationException
	at java.util.Collections$UnmodifiableMap.put(Collections.java:1283) [rt.jar:1.6.0_45]
	at org.jboss.as.controller.access.management.WritableAuthorizerConfiguration.addRoleMappingImmediate(WritableAuthorizerConfiguration.java:163) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.domain.management.access.RoleMappingAdd$1.execute(RoleMappingAdd.java:76) [jboss-as-domain-management-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:624) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:502) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:285) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:280) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:277) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:288) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.server.ServerService.boot(ServerService.java:349) [jboss-as-server-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.server.ServerService.boot(ServerService.java:324) [jboss-as-server-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:250) [jboss-as-controller-7.3.0.Final-redhat-7.jar:7.3.0.Final-redhat-7]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

16:24:48,609 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.remoting.endpoint.management (missing) dependents: [service jboss.remoting.management.channel.registry] 

16:24:48,611 FATAL [org.jboss.as.server] (Controller Boot Thread) JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
16:24:48,617 INFO  [org.jboss.as.controller] (MSC service thread 1-6) JBAS014774: Service status report
JBAS014776:    Newly corrected services:
      service jboss.remoting.endpoint.management (no longer required)

16:24:48,619 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015950: JBoss EAP 6.2.0.Beta1 (AS 7.3.0.Final-redhat-7) stopped in 4ms

Additional info:

Note that it's not even necessary to enable the "rbac" provider. Also note that after the server crashes, it can be started just fine, suggesting that there's probably something wrong in the runtime model.

Comment 1 Ladislav Thon 2013-10-04 14:30:11 UTC
Meh, once again I swapped the "actual" and "expected" results :-(

Comment 6 Ladislav Thon 2013-10-21 10:35:10 UTC
Verified with EAP 6.2.0.ER6.