question

Brad-6603 avatar image
0 Votes"
Brad-6603 asked Brad-6603 commented

Cluster MSMQ Error - Invalid queue path name

Hi,

I'm trying to make one of our in-house apps highly available using WCF. The app uses IIS, SQL, Win Services & MSMQ. I've had no issues configuring the Windows Failover Cluster for the windows services and SQL etc, but I'm stuck on MSMQ. The two nodes are in Azure.

Note that MSMQ is used for the Windows Services using PRIVATE$ queues. My goal for clustering MSMQ is should any queues get backlogged, and a failover occurs, the data is not lost.

I've configured the MSMQ Role in the Cluster just fine. Due to lack of documentation, I followed the setup for Clustering in Azure for SQL. I created a new frontend IP on the Azure ILB using a floating IP with HA ports then setup the probe as below. All good so far....

 # MSMQ Azure LB Probe Configuration#####
    
 $ClusterNetworkName = "Cluster Network 1"
 $IPResourceName = "IP Address 10.1.0.10" 
 $ILBIP = "10.1.0.10"
 [int]$ProbePort = 39999
    
 Import-Module FailoverClusters
    
 Get-ClusterResource $IPResourceName | Set-ClusterParameter -Multiple @{"Address"="$ILBIP";"ProbePort"=$ProbePort;"SubnetMask"="255.255.255.255";"Network"="$ClusterNetworkName";"EnableDhcp"=0}
    
    
 Get-ClusterResource $IPResourceName | Get-ClusterParameter

Since I'm using HA Ports, I verified the front end ip by RDPing to the IP and I could. I also see from the azure LB hitting on the above probe port too in Wireshark.

I can also right click on the MSMQ Role and select Manage MSMQ and Computer Management loads and I see the Clustered MSMQ which is empty, as it should be.

I create a queue and give Everyone full permissions on the clustered MSMQ, then I run the below code to test.


Add-Type -AssemblyName System.Messaging
$MyQueuePath = 'MSMQ\private$\test'
$MyQueue = if([System.Messaging.MessageQueue]::Exists($MyQueuePath)) {

 New-Object System.Messaging.MessageQueue $MyQueuePath

} else {


 [System.Messaging.MessageQueue]::Create($MyQueuePath)

}

$myQueuePath.Send("Test Text", "test")

But here is where I get Invalid Path. Ive tried using FormatName, FQDN etc with no luck.

Any ideas?

Thanks in advance,

Brad

windows-server-clustering
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

jiayaozhu-MSFT avatar image
0 Votes"
jiayaozhu-MSFT answered Brad-6603 commented

Hi,

Thanks for your patience!

Based on your description, there is something odd on your configuration, and I am not sure if this is because of your Azure platform. The scripts and console do have something difference from what I know from Windows OS platform. In this case, I would suggest you to contact our Microsoft Customer Support and Services directly. Our senior engineers can not only offer you advanced technical support but can give you real-time troubleshooting remotely. In this sense, they can get a deeper insight over your environment and current configuration, which can hardly be realized in our forum (we cannot do log analyzing and real-time remote operation). In addition, if the issue has been proved as system flaw, the consulting fee would be refund. You may find phone number for your region accordingly from the link below.

Global Customer Service phone numbers:
https://support.microsoft.com/en-us/help/13948/global-customer-service-phone-numbers

You can also try to re-create your MSMQ role, while I can only find articles for creating MSMQ role on a Windows SQL cluster. I am not sure if it is also applied for Azure platform. Besides, if you find the re-creation is not helpful, you may still have to call our senior engineers.

Thanks for your support and understanding! And I find that your issue is quite valuable for the public. So would you please help me Accept Answer, an accepted blog can be put on top of the forum, then the public can get access to the blog more easily.

BR,
Joan


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

My suspicions are confirmed. I'm getting strange errors.

It seems that we have some code on a website which is adding a message to a queue and is using "FormatName:Direct=OS:.\PRIVATE$\Queuename" and is failing also even with the environment variable. Annoying!

Ill accept the answer for now and Ill reach out to MS Support and hopefully get this resolved. I will add any resolution for the community.

Thanks again Joan.

0 Votes 0 ·
jiayaozhu-MSFT avatar image
0 Votes"
jiayaozhu-MSFT answered

Hi,

Thanks for posting on our forum!

After my research, I found a similar issue with yours, you can firstly follow the guidance in this blog to do a general troubleshoot:
https://stackoverflow.com/questions/4144493/creating-a-private-msmq-queue-in-a-microsoft-cluster-via-a-script/11268755

Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

Second, check if the provider you use applies the same queue syntax with that of ordinary msmq. Using a clean msmq provider and the syntax work alright.

Finally, try using the actual machine name instead of "." syntax.

Thanks for your support!

BR,
Joan


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Brad-6603 avatar image
0 Votes"
Brad-6603 answered Brad-6603 commented

Thanks for the reply.

I found that link myself and tested a while ago. That allows me to open Computer Management to view the queues created in the MSMQ Cluster but I can do that anyway by right clicking 'Manage Messaging Queue' within WFC.

Where I'm stuck is that I want to point my windows services to ClusterMSMQ\PRIVATE$\Queuename rather than .\PRIVATE$\Queuename. The queues for the windows services are stipulated in the registry as .\PRIVATE$\Queuename. I know its not the Windows Service since I get the same error when testing manually with PS. This leads me to think Ive configured MSMQ incorrectly somehow. The DNS and PTRs are fine too.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Thanks for your reply!

Basically, you should use the actual machine name instead of "." syntax in your script. And to test if your MSMQ role has been configured correctly, I think you can try to send and receive messages through MSMQ role. If the operation is successfully, then your configuration can be correct.

Besides, I actually think that your issue is correlated with role configuration as well, especially with how you configure the IP address the role will use to send and receive message. Here is an article for you to check if your configuration is correct:
https://social.msdn.microsoft.com/Forums/en-US/96f81a80-134c-4476-acdb-2f6b7a0fb94d/msmq-messages-not-seen-when-accessed-with-cluster-host?forum=msmq

Secondly, if you think you have some problems with configuration, then I think the quickest way is to re-create the role. You can conduct the recreation after you do the first two troubleshootings I have mentioned.

Thanks for your support! Hope to hear your positive feedback.

BR,
Joan

0 Votes 0 ·

Thanks Joan.

I managed to get MSMQ working by setting the CLUSTER_NETWORK_NAME user variable and setting it to the name of the MSMQ Cluster which is MSMQ.

I wasnt able to select Use Network Name as Computer Name as it wasnt present. I did this for both nodes.

However this feels like a bit of a hack. For example when I create new folders and have to select my machine to choose a local user, the computer name is now MSMQ. I fear I may run into odd issues in the future with this configured.

Thanks,

Brad

0 Votes 0 ·