NetworkConfiguration cause web roles to recycle - azure

Adding NetworkConfiguration to ServiceConfiguration cause our web roles to recycle:
-Busy (Waiting for role to start... System startup tasks are running
-Restarting (Role has encountered an error and has stopped. System startup task failed with exit code -532462766
Without NetworkConfiguration everything runs ok. We need roles visibility to a SQL VM in the same azure virtual network (http://msdn.microsoft.com/en-us/library/azure/jj823135.aspx).
<NetworkConfiguration>
<Dns>
<DnsServers>
<DnsServer name="TestDNS" IPAddress="10.1.0.4" />
</DnsServers>
</Dns>
<VirtualNetworkSite name="TestNetWork" />
<AddressAssignments>
<InstanceAddress roleName="Role1">
<Subnets>
<Subnet name="TestSubnet" />
</Subnets>
</InstanceAddress>
<InstanceAddress roleName="Role2">
<Subnets>
<Subnet name="TestSubnet" />
</Subnets>
</InstanceAddress>
<InstanceAddress roleName="Role3">
<Subnets>
<Subnet name="TestSubnet" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>

Problem solved.
We have set an Affinity Group, and the Cloud Service within.
If you depend on a other service outside the Affinity Group (for ex storage, virtual network, cache, etc) the roles won't start.

Related

Error on JMS Connection using spring integration

We are using a jms message driven adapter with an error-channel to transfer messages from a MQServer :
<int:publish-subscribe-channel id="processChannel1" />
<int:logging-channel-adapter channel="processChannel1" logger-name="log_channel" level="ERROR" expression="payload" />
<int:service-activator input-channel="processChannel1" ref="channelUtils" output-channel="error1" method="treatment" />
<bean id="myListener" class="org.springframework.jms.listener.DefaultMessageListenerContainer" >
<property name="autoStartup" value="false" />
<property name="connectionFactory" ref="connectionFactoryCaching" />
<property name="destination" ref="jmsQueue" />
<property name="maxMessagesPerTask" value="1" />
<property name="receiveTimeout" value="1" />
<property name="backOff" ref="fixedBackOff" />
<property name="sessionTransacted" value="true"/>
<property name="errorHandler" ref="connectionJmsHandler"/>
</bean>
<int-jms:message-driven-channel-adapter id="jmsIn" container="myListener" channel="channelMQ_RMQ" error-channel="processChannel1"/>
When there is an error on the connection , the error-channel is not called because it is not a "message error".
The bean connectionJmsHandler is also not called...
Following log message as ERROR :
2021-03-16 16:47:05.050 [myListener-5669] ERROR o.s.j.l.DefaultMessageListenerContainer - Could not refresh JMS Connection for destination 'queue://QM1/QUEUE.IN.3?CCSID=819&persistence=2&targetClient=1&priority=0' - retrying using FixedBackOff{interval=5000, currentAttempts=0, maxAttempts=1}. Cause: JMSWMQ0018: Failed to connect to queue manager 'QM1' with connection mode 'Client' and host name '10.118.121.78(8081)'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').
2021-03-16 16:47:10.055 [myListener-5669] ERROR o.s.j.l.DefaultMessageListenerContainer - Could not refresh JMS Connection for destination 'queue://QM1/QUEUE.IN.3?CCSID=819&persistence=2&targetClient=1&priority=0' - retrying using FixedBackOff{interval=5000, currentAttempts=1, maxAttempts=1}. Cause: JMSWMQ0018: Failed to connect to queue manager 'QM1' with connection mode 'Client' and host name '10.118.121.78(8081)'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').
2021-03-16 16:47:10.055 [myListener-5669] ERROR o.s.j.l.DefaultMessageListenerContainer - Stopping container for destination 'queue://QM1/QUEUE.IN.3?CCSID=819&persistence=2&targetClient=1&priority=0': back-off policy does not allow for further attempts.
Is there a way to call a specific treatment when having this kind of errors on JMS connection?
Thanks for your help
Regards,
Eric
You can add an ExceptionListener to the DefaultMessageListenerContainer and handle connection exceptions there.

Wix installer fails to create application pools in IIS 10

We are having trouble creating our app pools using wix. This problem happens only on server 2016 or iis version >10.
This is the error with verbose log turned on.
Its complaining about path not found or trying to access a path that has not been created or does not have permissions. The installer fails with rollback.
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe" -norestart -s W3SVC/1/ROOT/INFO-SUITE
CAQuietExec: Microsoft (R) ASP.NET RegIIS version 4.0.30319.0
CAQuietExec: Administration utility to install and uninstall ASP.NET on the local machine.
CAQuietExec: Copyright (C) Microsoft Corporation. All rights reserved.
CAQuietExec: Start registering ASP.NET (4.0.30319.0) recursively at W3SVC/1/ROOT/MyApplication.
CAQuietExec: Installation stopped because the specified path (W3SVC/1/ROOT/MyApplication) is invalid.
CAQuietExec: Error 0x80070001: Command line returned an error.
CAQuietExec: Error 0x80070001: CAQuietExec Failed
This is the wix xml which creates the app pool.The same installer msi works on windows 8. The IISMajorVersion is 10 according to the log. I also ran dsim enable feature IIS-ASPNET45 to make sure Asp.net is registered. I also checked the registry. THis is only when the wix creates the app pools. We don't have a problem when its an upgrade or we manaully create the app pools.
<Fragment>
<PropertyRef Id="IISMAJORVERSION" />
<Component Id="Component.WebServer.WebServices.IISSite.v10" Guid="F73DACBB-EF8B-4C8E-8B6A-6610670D991F" Directory="WEBSERVICES_INSTALLLOCATION">
<Condition><![CDATA[IISMAJORVERSION >= 10]]> </Condition>
<CreateFolder />
<iis:WebAppPool Id="WebAppPool.WebServices.IISSite.v10"
Name="[WEBSERVICESSERVERINFO_IISAPPNAME]"
ManagedRuntimeVersion="v4.0"
ManagedPipelineMode="integrated"
Identity="networkService"
IdleTimeout="0" />
<iis:WebVirtualDir Id="WebVirtualDir.WebServices.IISSite.v10"
Directory="WEBSERVICES_INSTALLLOCATION"
Alias="[WEBSERVICESSERVERINFO_IISAPPNAME]"
WebSite="WebSite">
<iis:WebDirProperties Id="WebDirProperties.WebServices.IISSite.v10"
Execute="yes"
Script="yes"
Read="yes"
WindowsAuthentication="yes"
AnonymousAccess="yes"
IIsControlledPassword="yes" />
<iis:WebApplication Id="WebApplication.WebServices.IISSite.v10"
Name="[WEBSERVICESSERVERINFO_IISAPPNAME]"
WebAppPool="WebAppPool.WebServices.IISSite.v10" />
</iis:WebVirtualDir>
</Component>
</Fragment>
<ComponentGroupRef Id="ComponentGroup.WebServer.WebServices.Files" />
<ComponentRef Id="Component.WebServer.WebServices.SetWebConfig" />
<ComponentRef Id="Component.WebServer.WebServices.Certificates" />
<ComponentRef Id="Component.WebServer.WebServices.IISSite.v10" />
I took care of my own problem. The condition had to be = "10"]]> instead of = 10]]>

Why does Mule application behave strangely in Linux server?

I work with Mule and I have some problem.
My mainflow.xml:
<?xml version="1.0" encoding="UTF-8"?><mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:management="http://www.mulesoft.org/schema/mule/management"
version="CE-3.3.0"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/management http://www.mulesoft.org/schema/mule/management/current/mule-management.xsd">
<!-- For show MX4J -->
<management:jmx-default-config port="1098"
registerMx4jAdapter="true">
</management:jmx-default-config>
<management:jmx-mx4j-adaptor jmxAdaptorUrl="http://localhost:9999"
login="admin" password="admin">
</management:jmx-mx4j-adaptor>
<management:jmx-server enableStatistics="true">
<management:connector-server
url="service:jmx:rmi:///jndi/rmi://localhost:1099/server" rebind="false" />
</management:jmx-server>
<management:rmi-server createRegistry="true" />
<!-- For get statistics -->
<notifications>
<notification event="EXCEPTION" />
<notification event="ENDPOINT-MESSAGE" />
<notification-listener ref="endpointNotificationLogger" />
<notification-listener ref="statesModuleExceptionNotificationListener" />
</notifications>
<spring:beans>
<!-- For show MX4J -->
<spring:bean id="exporter"
class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
<spring:property name="beans">
<spring:map>
<spring:entry key="bean:name=MBean1"
value-ref="MBean1" />
<spring:entry key="bean:name=MBean2"
value-ref="MBean2" />
</spring:map>
</spring:property>
</spring:bean>
<spring:bean id="MBean1" name="MBean1"
class="MBean1"></spring:bean>
<spring:bean id="MBean2" name="MBean2"
class="MBean2"></spring:bean>
<!-- For get statistics -->
<spring:bean name="endpointNotificationLogger"
class="MyEndpointNotificationListener" />
<spring:bean name="myExceptionNotificationListener"
class="MyExceptionNotificationListener" />
<spring:bean id="MyBean" name="MyBean"
class="MyBean">
</spring:bean>
</spring:beans>
<!-- <file:connector name="input" autoDelete="true" doc:name="File" />-->
<file:connector name="inputFileConnector" autoDelete="true" doc:name="File" >
<service-overrides messageReceiver="myFileMessageReceiver"/>
</file:connector>
<flow name="UnpackHandler" doc:name="UnpackHandler">
...
</flow>
<flow name="XmlToCsvTransformHandler" doc:name="XmlToCsvTransformHandler">
...
</flow>
Everything works OK in Tomcat. But after that I commit changes to SVN, checkout everything, package without changes and deploy app in Tomcat my application do not work!
The latest text in logs of Tomcat for my application:
DEBUG 18.12.2014 15:12:08 997 - DisposableBeanAdapter.invokeCustomDestroyMethod - Invoking destroy method 'dispose' on bean with name '_muleSystemModel'
INFO 18.12.2014 15:12:08 997 - ModelLifecycleManager.fireDisposePhase - Disposing model: _muleSystemModel
And there are no any logs about errors...
When application works OK, after this lines I see
DEBUG 18.12.2014 10:59:53 765 - MuleXmlBuilderContextListener.initialize - Mule config file(s): WEB-INF/classes/mainflow.xml
If I have this error and delete from mainflow.xml parts for mx4j and notifications everything works again:
<?xml version="1.0" encoding="UTF-8"?><mule xmlns="http://www.mulesoft.org/schema/mule/core" mlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd ">
</spring:beans>
<file:connector name="input" autoDelete="true" doc:name="File" />
<flow name="UnpackHandler" doc:name="UnpackHandler">
...
</flow>
<flow name="XmlToCsvTransformHandler" doc:name="XmlToCsvTransformHandler">
...
</flow>
After I write parts for mx4j and notifications step by step, do not paste all text of file what I take from SVN, it works again! So there is no difference between mainflow.xml when application works and doesn't work.
This behavior is in Linux server. In the Windows server and in my local machine everything is OK. I thought about differences between slashes, but I don't write slashes...
Why application behaves so strangely?
With the information you provide I can only guess that you have some logic in the notifications that hangs them if something on which they are dependedant is not already initializated somehow.
The fact that later it does work would somehow indicate this. I can suggest you to use in the beans the attribute depends-on to make sure it's initialized after your bean dependencies in case there are.

WSO2 API Manager 1.6.0 - API Authentication Failure

-Updated with pics of request header and params.
Can anyone tell me why WSo2 API Manager does not authenticate?
I have set up two WSo2 API Manager 1.6.0 instances. One that is distributed and a stand alone instance. I also have created a version of the CDYNE sample API that requires authorization and another version that does not. It does not appear that the API is published correctly because it does not matter what level I set the api security to when creating the api.
Here is the api on the gateway:
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="Creator1--APIPhoneVerify" context="/APIPhoneVerify" version="2.0.0" version-type="url">
<resource methods="POST GET OPTIONS DELETE PUT" url-mapping="/CheckPhoneNumber">
<inSequence>
<property name="POST_TO_URI" value="true" scope="axis2"/>
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
<then>
<send>
<endpoint name="Creator1--APIPhoneVerify_APIproductionEndpoint_0">
<http uri-template="http://ws.cdyne.com/phoneverify/phoneverify.asmx">
<timeout>
<duration>30000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<errorCodes>-1</errorCodes>
<initialDuration>0</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<errorCodes>-1</errorCodes>
</markForSuspension>
</http>
</endpoint>
</send>
</then>
<else>
<send>
<endpoint name="Creator1--APIPhoneVerify_APIsandboxEndpoint_0">
<http uri-template="http://ws.cdyne.com/phoneverify/phoneverify.asmx">
<timeout>
<duration>30000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<errorCodes>-1</errorCodes>
<initialDuration>0</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<errorCodes>-1</errorCodes>
</markForSuspension>
</http>
</endpoint>
</send>
</else>
</filter>
</inSequence>
<outSequence>
<send/>
</outSequence>
</resource>
<handlers>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler">
<property name="id" value="A"/>
<property name="policyKey" value="gov:/apimgt/applicationdata/tiers.xml"/>
</handler>
<handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageHandler"/>
<handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtGoogleAnalyticsTrackingHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler"/>
</handlers>
</api>
When I use the 'try it' feature it appears that the key is not passed and I get an error.
Here is the key:
Here is the response:
Here is the wso2carbon.log:
TID: [0] [AM] [2014-02-05 14:25:02,513] ERROR {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} - API authentication failure {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler}
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access failure for API: /APIPhoneVerify, version: 2.0.0 with key: null
at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.java:139)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenticationHandler.java:92)
at org.apache.synapse.rest.API.process(API.java:285)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:336)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:168)
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:744)
TID: [0] [AM] [2014-02-05 14:25:02,516] INFO {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils} - Massage Info: Transaction id=115815524651347724395990 Message direction=OUT Server name=7.40.2.26:9765 Timestamp=1391631902516 Service name=__SynapseService Operation Name=mediate {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils}
I then tried from an external source in case it was a 'tryit' problem. In this case the key was at least passed.
Here is the request and reply:
Here is the wso2carbon.log:
TID: [0] [AM] [2014-02-05 14:26:24,053] ERROR {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} - API authentication failure {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler}
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access failure for API: /APIPhoneVerify, version: 2.0.0 with key: CgtcOiDinAKo4hKbtDV_fr6JIVAa
at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.java:139)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenticationHandler.java:92)
at org.apache.synapse.rest.API.process(API.java:285)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:336)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:168)
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:744)
TID: [0] [AM] [2014-02-05 14:26:24,056] INFO {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils} - Massage Info: Transaction id=115823714657361932967093 Message direction=OUT Server name=7.40.2.26:9765 Timestamp=1391631984056 Service name=__SynapseService Operation Name=mediate {org.wso2.carbon.bam.message.tracer.handler.util.HandlerUtils}
Can you please try this API
http://api.openweathermap.org/data/2.5/weather
with parameter q=London
The final request should look like the following
http://localhost:8280/yourAPI/1.0?q=London
I have added 2 versions of the same api. 1.6.0 (which doesn't work) and 1.6.1 (which does work).
The error message regarding API authenication failure led me to believe it was a auth problem.
However, since your worked with the /* url pattern I tried that, instead of a pattern of /CheckPhoneNumber and it worked. I guess having a url pattern of /CheckPhoneNumber and updating the swagger doc to have the definition include /CheckPhoneNumber are NOT the same thing.

Unhealthy WorkerRole on Windows Azure

I have terrible problem with WorkerRole instance on Windows Azure. I have a Windows Azure projct that contains WebRole and WorkerRole.
The problem is, the WorkerRole instance is Unhealthy. The Error on a server:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-02-18T21:29:18.000Z" />
<EventRecordID>864</EventRecordID>
<Channel>Application</Channel>
<Computer>RD00155D3A4A2E</Computer>
<Security />
</System>
<EventData>
<Data>WaHostBootstrapper.exe</Data>
<Data>6.0.6002.18488</Data>
<Data>505cf7da</Data>
<Data>ntdll.dll</Data>
<Data>6.0.6002.18520</Data>
<Data>4e811810</Data>
<Data>c0000374</Data>
<Data>00000000000acb47</Data>
<Data>ae8</Data>
<Data>01ce0e1ef01200d9</Data>
</EventData>
</Event>
Faulting application WaHostBootstrapper.exe
Can somebody help me ?
p.s Project works perfect on local machine.
If it works on your machine but failed on the cloud it might because you miss some assemblies or dependency component.
You can enable the IntelliTrace when deploying so that later you can download the debug file and this might includes the actual exception/error for your worker role. http://msdn.microsoft.com/en-us/library/windowsazure/ff683671.aspx

Resources