mbraceproject / MBrace.StarterKit

A collection of demos and tutorials for MBrace
http://mbrace.io
57 stars 34 forks source link

System.ArgumentException: Invalid ServiceBus connection string #101

Open FedericoBinda opened 5 years ago

FedericoBinda commented 5 years ago

Hi

Whenever I try to parse a ServiceBus connection string I get an error that says the string is not valid. I do not understand why.

Here is what I do: 1) Create a deployment using mbrace-arm (https://github.com/isaacabraham/mbrace-arm) 2) Go to my azure portal, select Resource Groups -> MyCluster -> Deployments -> azuredeploy -> Outputs 3) Copy the connection strings for the bus and the storage 4) paste the strings into the following MBrace template:

let serviceBusConnection = " ... enter ServiceBusConnectionString here ..."  
let storageConnection = "... enter StorageConnectionString here ... "
let config = Configuration(storageConnection, serviceBusConnection)
let cluster = AzureCluster.Connect(config, logger = ConsoleLogger(true), logLevel = LogLevel.Info)
isaacabraham commented 5 years ago

@FedericoBinda what does the service bus connection string look like? There are a few, it's probably that you're using the wrong one. This might help. https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-how-to-use-topics-subscriptions

FedericoBinda commented 5 years ago

It looks like this Endpoint=sb://mbmsge6hshiqyqneru.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<sequence of characters>

FedericoBinda commented 5 years ago

Some more information: 1 - I tried the service bus quickstart from here using the same connection string that I use in MBrace and it worked. Therefore I am pretty sure that the connection string is correct and that the service bus works correctly. 2 - I am running MBrace on MacOS with mono 3 - Finally, here is the full error text after the System.ArgumentException:

Parameter name: connectionString ---> System.TypeInitializationException: The type initializer for 'TimerManager' threw an exception. ---> System.EntryPointNotFoundException: CreateWaitableTimer
  at (wrapper managed-to-native) Microsoft.ServiceBus.Common.Interop.UnsafeNativeMethods.CreateWaitableTimer(intptr,bool,string)
  at Microsoft.ServiceBus.Common.IOThreadTimer+WaitableTimer+TimerHelper.CreateWaitableTimer () [0x00000] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.Common.IOThreadTimer+WaitableTimer..ctor () [0x00006] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at (wrapper remoting-invoke-with-check) Microsoft.ServiceBus.Common.IOThreadTimer+WaitableTimer..ctor()
  at Microsoft.ServiceBus.Common.IOThreadTimer+TimerGroup..ctor () [0x00006] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.Common.IOThreadTimer+TimerManager..ctor () [0x00018] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.Common.IOThreadTimer+TimerManager..cctor () [0x00000] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
   --- End of inner exception stack trace ---
  at Microsoft.ServiceBus.Common.IOThreadTimer..ctor (System.Action`1[T] callback, System.Object callbackState, System.Boolean isTypicallyCanceledShortlyAfterBeingSet, System.Int32 maxSkewInMilliseconds) [0x0002f] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.Common.IOThreadTimer..ctor (System.Action`1[T] callback, System.Object callbackState, System.Boolean isTypicallyCanceledShortlyAfterBeingSet) [0x00000] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.RetryPolicy..ctor () [0x00011] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.RetryExponential..ctor (System.TimeSpan minBackoff, System.TimeSpan maxBackoff, System.TimeSpan deltaBackoff, System.TimeSpan terminationTimeBuffer, System.Int32 maxRetryCount, System.Boolean throwOnClientChecks) [0x00000] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.RetryExponential..ctor (System.TimeSpan minBackoff, System.TimeSpan maxBackoff, System.Int32 maxRetryCount) [0x00000] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.RetryPolicy.get_Default () [0x00000] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.NamespaceManagerSettings..ctor () [0x00011] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.NamespaceManager..ctor (System.Collections.Generic.IEnumerable`1[T] addresses, Microsoft.ServiceBus.TokenProvidertokenProvider) [0x0001d] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.Messaging.Configuration.KeyValueConfigurationManager.CreateNamespaceManager () [0x0013f] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at Microsoft.ServiceBus.NamespaceManager.CreateFromConnectionString (System.String connectionString) [0x00016] in <a6f0cb5caf3745748d3c8c6f685cf7b6>:0
  at MBrace.Azure.Runtime.AzureServiceBusAccount.tryParse (System.String connectionString) [0x00002] in <59f868bbae64fda6a7450383bb68f859>:0
   --- End of inner exception stack trace ---
  at MBrace.Azure.Runtime.AzureServiceBusAccount.FromConnectionString (System.String connectionString) [0x00080] in <59f868bbae64fda6a7450383bb68f859>:0
  at MBrace.Azure.Configuration.parseServiceBus (System.String conn) [0x00001] in <59f868bbae64fda6a7450383bb68f859>:0
  at MBrace.Azure.Configuration..ctor (System.String storageConnectionString, System.String serviceBusConnectionString) [0x00034] in <59f868bbae64fda6a7450383bb68f859>:0
  at <StartupCode$FSI_0003>.$FSI_0003.main@ () [0x00017] in <cc4a5b9c41bc4efc97efc73f550f842a>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003b] in <14f1e720d53a4a6a8800252bec102319>:0