Bug 1064771 - NPE when starting webservice endpoint on IPv6 address with square brackets during start [NEEDINFO]
Summary: NPE when starting webservice endpoint on IPv6 address with square brackets d...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web Services
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: DR3
: EAP 6.3.0
Assignee: Brian Stansberry
QA Contact: Rostislav Svoboda
Russell Dickenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-13 09:40 UTC by Miroslav Novak
Modified: 2024-01-15 06:32 UTC (History)
17 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-06-28 15:43:42 UTC
Type: Bug
Embargoed:
sureshkumarzba: needinfo?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFLY-3077 0 Minor Closed Convert command line IPv6 URL literals to address literals 2018-07-16 15:55:17 UTC

Description Miroslav Novak 2014-02-13 09:40:27 UTC
There is regression (against EAP 6.2.0.GA and EAP 6.2.1.GA) when server is bound to IPv6 address with square brackets like:

~/tmp/jboss-eap-6.2/bin $ sh standalone.sh -c standalone-full-ha.xml -b [fe80::3e97:eff:fe96:48c8]

log:
...
10:38:09,647 INFO  [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on [fe80::3e97:eff:fe96:48c8]:4447
10:38:09,667 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.ws.endpoint-config.Recording-Endpoint-Config: org.jboss.msc.service.StartException in service jboss.ws.endpoint-config.Recording-Endpoint-Config: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_35]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]
Caused by: java.lang.NullPointerException
	at org.jboss.as.webservices.service.ConfigService.start(ConfigService.java:67)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	... 3 more

10:38:09,684 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.ws.client-config.Standard-Client-Config: org.jboss.msc.service.StartException in service jboss.ws.client-config.Standard-Client-Config: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_35]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]
Caused by: java.lang.NullPointerException
	at org.jboss.as.webservices.service.ConfigService.start(ConfigService.java:62)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	... 3 more

10:38:09,668 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.ws.endpoint-config.Standard-Endpoint-Config: org.jboss.msc.service.StartException in service jboss.ws.endpoint-config.Standard-Endpoint-Config: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_35]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]
Caused by: java.lang.NullPointerException
	at org.jboss.as.webservices.service.ConfigService.start(ConfigService.java:67)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	... 3 more

10:38:09,736 DEBUG [org.apache.catalina.core] (MSC service thread 1-3) JBWEB001136: Starting service jboss.web

...

10:38:10,957 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.ws.endpoint-config.Recording-Endpoint-Config: org.jboss.msc.service.StartException in service jboss.ws.endpoint-config.Recording-Endpoint-Config: Failed to start service
      service jboss.ws.client-config.Standard-Client-Config: org.jboss.msc.service.StartException in service jboss.ws.client-config.Standard-Client-Config: Failed to start service
      service jboss.ws.endpoint-config.Standard-Endpoint-Config: org.jboss.msc.service.StartException in service jboss.ws.endpoint-config.Standard-Endpoint-Config: Failed to start service

10:38:10,996 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://fe80::3e97:eff:fe96:48c8:9990/management
10:38:10,996 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://fe80::3e97:eff:fe96:48c8:9990
10:38:10,997 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.3.0.Alpha1 (AS 7.4.0.Final-redhat-0) started (with errors) in 3420ms - Started 151 of 281 services (5 services failed or missing dependencies, 124 services are passive or on-demand)

Comment 1 Miroslav Novak 2014-02-28 08:35:56 UTC
Regression keyword did not set blocker ? so setting it.

Comment 2 Alessio Soldano 2014-03-05 16:54:01 UTC
Regression or not, to me "-b [fe80::3e97:eff:fe96:48c8]" is wrong, as you're supposed to provide a host address, not a URL. You should use "-b fe80::3e97:eff:fe96:48c8", which I believe would simply work.

The reason for the failure is not found in the stacktrace and is an OperationFailedException from org.jboss.as.webservices.dmr.AddressValidator when the <wsdl-host> element is read from the model (note, the validator was added recently). The default value in the model for that element is ${jboss.bind.address:127.0.0.1}, which takes the value passed with the command line -b option.

To improve error reporting, the AS core should properly better handle OperationFailedException. No WS issue here AFAICS.

Comment 3 Brian Stansberry 2014-03-05 17:06:35 UTC
(In reply to Alessio Soldano from comment #2)
> 
> To improve error reporting, the AS core should properly better handle
> OperationFailedException. No WS issue here AFAICS.

Please explain what is going wrong. Is some OperationStepHandler doing some validation after it has already installed some services, with the result that the handler doesn't install some other services?

I agree that "-b [fe80::3e97:eff:fe96:48c8]" is wrong.

Comment 4 Alessio Soldano 2014-03-05 17:23:04 UTC
Actually looking better at the log, I see the following line, which was not reported here and which basically tells that the WS subsystem could not be added and started:

18:19:37,525 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 48) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "webservices")]) - failure description: "JBWS022117: Invalid address provided: [::1]"

Brian, the actual exception is the following, if you're interested:

org.jboss.as.controller.OperationFailedException: JBWS022117: Invalid address provided: [::1] [ "JBWS022117: Invalid address provided: [::1]" ]
 	at org.jboss.as.webservices.dmr.AddressValidator.validateParameter(AddressValidator.java:48)
 	at org.jboss.as.controller.operations.validation.NillableOrExpressionParameterValidator.validateParameter(NillableOrExpressionParameterValidator.java:75)
 	at org.jboss.as.controller.AttributeDefinition.resolveValue(AttributeDefinition.java:363)
 	at org.jboss.as.controller.AttributeDefinition.resolveModelAttribute(AttributeDefinition.java:321)
 	at org.jboss.as.controller.AttributeDefinition.resolveModelAttribute(AttributeDefinition.java:295)
 	at org.jboss.as.webservices.dmr.WSSubsystemAdd.createServerConfig(WSSubsystemAdd.java:108)
 	at org.jboss.as.webservices.dmr.WSSubsystemAdd.performBoottime(WSSubsystemAdd.java:90)
 	at org.jboss.as.controller.AbstractBoottimeAddStepHandler.performRuntime(AbstractBoottimeAddStepHandler.java:69)
 	at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:76)
 	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:601)
[...]

Comment 5 Alessio Soldano 2014-03-05 17:24:29 UTC
I had to add a stacktrace print in ws subsystem to print the exception above.
The NPE is a consequence of the WS subsystem not having started.

Comment 6 Brian Stansberry 2014-03-05 18:22:02 UTC
I think WSSubsystemAdd should defer the following until after the createServiceConfig() call:

context.addStep(new AbstractDeploymentChainStep() {
            protected void execute(DeploymentProcessorTarget processorTarget) {
                // add the DUP for dealing with WS deployments
                WSDeploymentActivator.activate(processorTarget, appclient);
            }
        }, OperationContext.Stage.RUNTIME);

Basically, do all the validation stuff before doing anything that will change state.

It would be nicer if the validation failure automatically resulted in everything subsequent (e.g. execution of the step that adds those DUPs) not happening. That would be the case if this were a normal op from the CLI or console -- unless the caller added the rollback-on-runtime-failure=true header, the OFE would result in the stop of execution and rollback. But in boot we don't rollback automatically and abort, so weirder problems can happen. (IMO we should provide a config option to roll back / abort at boot.)


A separate issue is nothing appearing in the logs. I thought I'd improved that in 6.2 such that OFEs are logged at boot. (Post boot they are not as they are considered client mistakes that get reported to the client.) But even trying this with WF master I don't see the OFE in the logs.

Comment 7 Alessio Soldano 2014-03-05 18:28:17 UTC
I don't think the move of the code block mentioned above is really related to the NPE. The reason for the NPE is that a service which would have been installed by the WSSubsystemAdd is actually not installed. The thread that eventually ends up into the NPE is processing the EndpointConfigAdd, which is a step handler processing a child of webservices subsystem.

Comment 8 Rostislav Svoboda 2014-03-06 13:10:16 UTC
I agree too that "-b [fe80::3e97:eff:fe96:48c8]" is wrong, we filled it because it is regression to things we could do/use. Not saying it was the right thing:)

Are we going to change this BZ to something like "Improve logging and perform validation before changing the state to prevent hiding the root cause" ?

Comment 9 Brian Stansberry 2014-03-07 03:13:55 UTC
Turns out the logging is fine; the root cause is the first error in the log:

21:10:59,039 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 60) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "webservices")]) - failure description: "JBWS022117: Invalid address provided: [::1]"

Comment 11 Brian Stansberry 2014-03-07 03:37:37 UTC
I changed the command line parsing to strip the [].

Comment 12 Miroslav Novak 2014-03-17 11:48:15 UTC
Thanks for investigation and fix! I cannot hit any problems with EAP 6.3.0.DR4. Setting as verified.

Comment 13 Miroslav Novak 2014-03-18 11:57:36 UTC
We've noticed that when property jboss.bind.address is set:
./standalone.sh -c standalone.xml -Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true -Djboss.bind.address=[::1] -Djboss.bind.address.management=[::1]

then it fails with the same error. Would it be possible to fix it for this use? It seems that [] is not stripped from properties: jboss.bind.address, jboss.bind.address.management, jboss.bind.address.unsecure,

Comment 14 Alessio Soldano 2014-03-20 09:54:17 UTC
Just my 2 cents: if we're going to be lenient on this and getting host addresses from ipv6 urls having brackets, we should at least try to educate users e.g. by printing a WARN telling them they should have not provided urls, but host addresses and in any case we're interpreting what they meant..

Comment 16 Miroslav Novak 2014-03-21 10:51:10 UTC
Thanks Brian! I'll set this bz as verified and add comment to related jira - https://issues.jboss.org/browse/WFLY-3077.

Comment 17 sureshkumar 2018-07-06 09:27:21 UTC Comment hidden (spam)
Comment 18 Aimore 2020-11-16 05:55:22 UTC Comment hidden (spam)
Comment 19 Aimore 2020-12-04 05:42:07 UTC Comment hidden (spam)
Comment 20 Stark416 2021-03-30 07:12:49 UTC Comment hidden (spam)
Comment 21 Sai Yoga Ashram Rishikesh 2021-05-10 06:50:31 UTC Comment hidden (spam)
Comment 22 Gadget Review 2021-08-17 04:35:42 UTC Comment hidden (spam)
Comment 23 Moca Blues 2021-09-11 07:05:37 UTC Comment hidden (spam)
Comment 24 Anime Indo 2021-11-22 23:50:12 UTC Comment hidden (spam)
Comment 25 polatrik 2022-06-16 13:27:40 UTC Comment hidden (spam)
Comment 26 Jake Brian 2023-05-15 09:23:37 UTC Comment hidden (spam)
Comment 27 Animeindo 2023-06-11 09:47:54 UTC Comment hidden (spam)
Comment 28 alaxander 2023-12-29 09:29:01 UTC Comment hidden (spam)
Comment 29 Tugu Jogja 2024-01-15 06:32:11 UTC Comment hidden (spam)

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