Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ArgumentException: Invalid ServiceBus connection string #101

Open
FedericoBinda opened this issue Oct 15, 2018 · 3 comments
Open

Comments

@FedericoBinda
Copy link

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
Copy link
Contributor

@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
Copy link
Author

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

@FedericoBinda
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants