Nservicebus: License reminder logs errors on Azure

Created on 18 Sep 2016  路  16Comments  路  Source: Particular/NServiceBus

Saw this in the web job logs

[09/18/2016 08:47:22 > dceefa: INFO] 2016-09-18 08:47:22.799 ERROR NServiceBus.Features.LicenseReminder Failed to initialize the license
[09/18/2016 08:47:22 > dceefa: INFO] System.IO.IOException: The specified registry key does not exist.
[09/18/2016 08:47:22 > dceefa: INFO]    at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
[09/18/2016 08:47:22 > dceefa: INFO]    at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
[09/18/2016 08:47:22 > dceefa: INFO]    at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
[09/18/2016 08:47:22 > dceefa: INFO]    at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
[09/18/2016 08:47:22 > dceefa: INFO]    at Particular.Licensing.TrialStartDateStore.GetTrialStartDate()
[09/18/2016 08:47:22 > dceefa: INFO]    at NServiceBus.LicenseManager.GetTrialLicense()
[09/18/2016 08:47:22 > dceefa: INFO]    at NServiceBus.LicenseManager.InitializeLicense(String licenseText)
[09/18/2016 08:47:22 > dceefa: INFO]    at NServiceBus.Features.LicenseReminder.Setup(FeatureConfigurationContext context)

Everything works as expected but it seems wrong for us to log it?

Bug

All 16 comments

Why? We could use another log level. But since it is just an info I see no harm

This is our license code trying to detect various locations to see if there is a valid license/trial. Logging that as an ex seem vierd to me. We should just say: No valid license found - Locations searched X,Y,Z

cc @Particular/azure-service-bus-maintainers @Particular/azure-storage-queues-maintainers thoughts?

Ok I now get your point. I agree ideally we should not log the exception message but a more meaningful message like you described.

I'd say that it's Azure specific. :+1: for not using an exception and using a more descriptive statement.

Reading the error message properly (LOL) I now see that we fail to create the regkey that stores the trial start date if we can't find an existing key

https://github.com/Particular/NServiceBus/blob/release-6.0.0/src/NServiceBus.Core/App_Packages/Particular.Licensing/TrialStartDateStore.cs#L17

How should we play this given that this is azure => registry wiped on each time the instance is moved?

Just ignore? (I don't see what we can do here?)

cc @yvesgoeleven @SeanFeldman

@andreasohlund yes, cloudservices are stateless, any state (including registry keys) will be wiped. You won't have admin priviliges to create reg keys either, so you'll have to store it somewhere else

@yvesgoeleven for CSes probably not so accurate as you could bootstrap with startup tasks to have the registry. Webjobs and webapps is a different story, there we can't have access to the registry.

so you'll have to store it somewhere else

Any ideas where this might be? (a file somewhere?)

@andreasohlund isn't license file can be either embedded in the config file or found at a well defined location?

isn't license file can be either embedded in the config file or found at a well defined location?

Yes but this is the trial license , aka the date we store to give users a 14 day trial without any license file?

it looks like there should be a follow up issue based on the proposed options?

Would it make sense to have a trial license as part of the core package?

from the conversation it somehow looks like the logs are just some of the symptoms while there is a more important detail about licensing in cloudservices? Doesn't this actually mean that licensing doesn't work correctly?

Doesn't this actually mean that licensing doesn't work correctly?

Seems so, as long as the cloud service recycles at least once per 14 days users can run forever since they get a new trial each recycle.

@Particular/azure-service-bus-maintainers @Particular/azure-storage-queues-maintainers thoughts?

@andreasohlund correct :)

Fixed in v7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timbussmann picture timbussmann  路  7Comments

timbussmann picture timbussmann  路  8Comments

SeanFeldman picture SeanFeldman  路  9Comments

WojcikMike picture WojcikMike  路  5Comments

weralabaj picture weralabaj  路  9Comments