Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
[IDENTITY-3614] HTTP GET method does not work for a service, after throttling is enabled and the server is restarted Created: 18/Mar/13 Updated: 12/Oct/15 Resolved: 11/Oct/15 Status: Project: Component/s: Affects Version/s: Fix Version/s: Resolved WSO2 Identity Server ws-security 5.0.0-GA Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Environment: Patch Chamara Ariyarathne Fixed None Not Specified Attachments: Issue Links: None Priority: Assignee: Votes: Highest Gayan Gunawardana 0 Not Specified Not Specified Ubuntu 12.04, Java 1.7, local pack org.wso2.carbon.security.mgt_4.2.2.diff Incorporates is part CARBONof 14740 Improve Carbon UI framework to load Resolved U... Moderate Estimated Complexity: Test cases added: Not-applicable Description Executed a HTTP GET for the Version service in a raw pack: $ curl -v http://127.0.0.1:8280/services/Version About to connect() to 127.0.0.1 port 8280 (#0) Trying 127.0.0.1... connected > GET /services/Version HTTP/1.1 > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 > Host: 127.0.0.1:8280 > Accept: / > < HTTP/1.1 200 OK < Date: Mon, 18 Mar 2013 06:54:32 GMT < Server: WSO2-PassThrough-HTTP < Transfer-Encoding: chunked < Connection #0 to host 127.0.0.1 left intact Closing connection #0 <ns:getVersionResponse xmlns:ns="http://version.services.core.carbon.wso2.org"><return>WSO2 Enter Service Bus-4.6.0</return></ns:getVersionResponse> Then changed throttling for the service and it also worked. But after a server restart, the HTTP GET fails when called with curl in the above way: $ curl -v http://127.0.0.1:8280/services/Version About to connect() to 127.0.0.1 port 8280 (#0) Trying 127.0.0.1... connected > GET /services/Version HTTP/1.1 > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 > Host: 127.0.0.1:8280 > Accept: / > < HTTP/1.1 500 Internal Server Error < Date: Mon, 18 Mar 2013 06:55:06 GMT < Server: WSO2-PassThrough-HTTP < Transfer-Encoding: chunked < Connection #0 to host 127.0.0.1 left intact Closing connection #0 The error in the backend is: [2013-03-18 06:55:06,473] ERROR - AxisEngine Http binding is disabled for this service. org.apache.axis2.AxisFault: Http binding is disabled for this service. at org.apache.axis2.engine.DispatchPhase.validateBindings(DispatchPhase.java:279) at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:111) at org.apache.axis2.engine.Phase.invoke(Phase.java:329) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167) at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingMethod(ServerWorker.java:2 at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:196) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) [2013-03-18 06:55:06,475] ERROR - ServerWorker Error processing GET request for : /services/Version org.apache.axis2.AxisFault: Http binding is disabled for this service. at org.apache.axis2.engine.DispatchPhase.validateBindings(DispatchPhase.java:279) at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:111) at org.apache.axis2.engine.Phase.invoke(Phase.java:329) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167) at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingMethod(ServerWorker.java:2 at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:196) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) [2013-03-18 06:55:06,494] WARN - PassThroughHttpListener System may be unstable: HTTP ListeningIORea encountered a runtime exception : HTTP response may not be null. java.lang.IllegalArgumentException: HTTP response may not be null. at org.apache.http.impl.DefaultConnectionReuseStrategy.keepAlive(DefaultConnectionReuseStrategy.java:72) at org.apache.synapse.transport.passthru.SourceResponse.write(SourceResponse.java:157) at org.apache.synapse.transport.passthru.SourceHandler.outputReady(SourceHandler.java:238) at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java at org.apache.http.impl.nio.DefaultServerIOEventDispatch.outputReady(DefaultServerIOEventDispatch.java:16 at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:179) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:344) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:318) at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278) at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104) at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.jav at java.lang.Thread.run(Thread.java:722) [2013-03-18 06:55:06,495] WARN - SourceHandler Illegal incoming connection state: RESPONSE_DONE . Po two send backs are happening for the same request [2013-03-18 06:55:06,495] WARN - SourceHandler Trying to write response body while the handler is in an inconsistent state RESPONSE_DONE But at this time the HTTP POST through SOAP works (when tried with the SOAP-UI) Request: POST http://chamara-TECRA-M11:8280/services/Version.VersionHttpSoap11Endpoint HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "urn:getVersion" <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ver="http://version.services.core.carbon.wso2.org"> <soapenv:Header/> <soapenv:Body> <ver:getVersion/> </soapenv:Body> </soapenv:Envelope> Response: HTTP/1.1 200 OK Date: Mon, 18 Mar 2013 06:55:59 GMT Server: WSO2-PassThrough-HTTP Transfer-Encoding: chunked Connection: Keep-Alive <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getVersionResponse xmlns:ns="http://version.services.core.carbon.wso2.org"><return>WSO2 Enterprise Service Bus4.6.0</return></ns:getVersionResponse></soapenv:Body></soapenv:Envelope> Comments Comment by Chamara Ariyarathne [ 18/Mar/13 ] Acutally this occurs for HTTP POST too when invoked with curl. $ curl -v -X POST http://127.0.0.1:8280/services/Version -H "Content-Type: application/xml" [email protected] Version.xml is $ cat Version.xml <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ver="http://version.serv <soapenv:Header/> <soapenv:Body> <ver:getVersion/> </soapenv:Body> </soapenv:Envelope> Comment by Ravi Undupitiya [ 28/Apr/13 ] I reproduced this behaviour. However, using the following command I was able to get POST working after throt SOAPAction header, so this suggests it may have something to do with the content type?? Comment by Ravi Undupitiya [ 09/May/13 ] When throttling is enabled the HTTP Binding for the service is removed (hence why GET requests do not work) is changed back to true. Please note that we do not receive the PTT exception on the latest 4.7.0 pack. The two exceptions described may Comment by Ravi Undupitiya [ 09/May/13 ] When we enable throttling, the following is added to the Version service WSDL: <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.or <wsp:ExactlyOne> <wsp:All/> </wsp:ExactlyOne> </wsp:Policy> The presence of this makes the security component call applySecurityComponents() and disableRESTCalls() wh Comment by Ravi Undupitiya [ 09/May/13 ] The issue regarding Policy name space is the same seen at . Comment by Vinod Philominraj [ 15/May/13 ] I was also trying setup a simple json -> esb -> json as proxy service. And for that proxy service i was trying to en <soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> <soapenv:Text xml:lang="en-US">Http binding is disabled for this service.</soapenv:Text> </soapenv:Reason> The original proxy information is as follows: <proxy xmlns="http://ws.apache.org/ns/synapse" name="jsonproxy" transports="https,http" statistics="enable" t <target> <outSequence> <send/> </outSequence> <endpoint> <address uri="http://localhost:9080/getJSON"/> </endpoint> </target> <policy key="conf:/repository/axis2/service-groups/jsonproxy/services/jsonproxy/policies/WSO2CachingPolicy <description></description> </proxy> And I do a service request using rest client using this URL: http://localhost:8280/services/jsonproxy WSO2CachingPolicy information from registry is as follows: <wsp:Policy wsu:Id="WSO2CachingPolicy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmln xmlns:wsch="http://www.wso2.org/ns/2007/06/commons/caching"><wsp:Policy><wsp:All><wsch:XMLIdentif :MaxMessageSize></wsp:All></wsp:Policy></wsch:CachingAssertion></wsp:Policy> Any workaround is available for this and the version of WSO2 ESB is 4.6.0. Comment by Ravi Undupitiya [ 15/May/13 ] Hi Vinod, As a work around you can change the disableREST parameter for the service after the server is up. Comment by Ravi Undupitiya [ 04/Jun/13 ] Closing this issue as it is a duplicate of Comment by Ananda Manoj Kumara [ 18/Sep/15 ] Further looking into the issue I noticed that during applySecurityParameters() operation on SecurityDeployment because the initial service metafile generated after applying the throttling policy doesn't contain this property. Bu if (!SecurityConstants.USERNAME_TOKEN_SCENARIO_ID.equals(secScenario.getScenarioId())) { Parameter param2 = new Parameter(); param2.setName("disableREST"); // TODO Find the constant param2.s Comment by Johann Nallathamby [ 11/Oct/15 ] Following fix was done only in support branch because QoS modules have now been removed from platform. In Modified: projects/carbon/turing/platform/trunk/components/security/org.wso2.carbon.securi =================================================================== --- projects/carbon/turing/platform/trunk/components/security/org.wso2.carbon.security.mgt +++ projects/carbon/turing/platform/trunk/components/security/org.wso2.carbon.security.mgt @@ -251,10 +251,10 @@ securityScenario.setWsuId(policyId); securityScenario.setGeneralPolicy(false); securityScenario.setSummary(SecurityConstants.CUSTOM_ scenario = securityScenario; if(!("RMPolicy".equals(policyId) || "WSO2CachingPolic || "WSO2ServiceThrottlingPolicy".equals(polic SecurityScenarioDatabase.put(policyId, securitySc + SecurityScenarioDatabase.put(policyId, securitySc + scenario = securityScenario; } } } else { Generated at Sat May 13 19:45:23 IST 2017 using JIRA 7.2.2#72004sha1:9d5132893cc8c728a3601a9034a1f8547ef5c7be.