How to make Akka.NET's ClusterClient work? - akka.net

I'm trying out ClusterClient as per the docs.
However my client test app keeps getting the following error:
Error while creating actor instance of type Akka.Cluster.Tools.Client.ClusterClient with 1 args: (Akka.Cluster.Tools.Client.ClusterClientSettings)
Cause: [akka://TestSystem/user/$a#705838478]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.TypeLoadException: Error while creating actor instance of type Akka.Cluster.Tools.Client.ClusterClient with 1 args: (Akka.Cluster.Tools.Client.ClusterClientSettings) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: failure-detector.heartbeat-interval must be > 0s
at Akka.Remote.DeadlineFailureDetector..ctor(TimeSpan acceptableHeartbeatPause, TimeSpan heartbeatInterval, Clock clock)
at Akka.Remote.DeadlineFailureDetector..ctor(TimeSpan acceptableHeartbeatPause, Clock clock)
at Akka.Cluster.Tools.Client.ClusterClient..ctor(ClusterClientSettings settings)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Akka.Actor.Props.ActivatorProducer.Produce()
at Akka.Actor.Props.NewActor()
--- End of inner exception stack trace ---
at Akka.Actor.Props.NewActor()
at Akka.Actor.ActorCell.CreateNewActorInstance()
at Akka.Actor.ActorCell.<>c__DisplayClass118_0.<NewActor>b__0()
at Akka.Actor.ActorCell.UseThreadContext(Action action)
at Akka.Actor.ActorCell.NewActor()
at Akka.Actor.ActorCell.Create(Exception failure)
--- End of inner exception stack trace ---
at Akka.Actor.ActorCell.Create(Exception failure)
at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)
The minimal code I'm using to get this error:
using (var system = ActorSystem.Create("TestSystem")) {
system.Settings.InjectTopLevelFallback(ClusterClientReceptionist.DefaultConfig());
var settings = ClusterClientSettings.Create(system);
var client = system.ActorOf(ClusterClient.Props(settings));
Console.Write("Press any key to exit...");
Console.ReadKey();
}
The HOCON config for the client contains:
akka {
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
}
remote {
helios.tcp {
port = 0
hostname = localhost
}
}
cluster {
client {
initial-contacts: ["akka.tcp://TestSystem#localhost:8082/user/receptionist"]
}
}
}
Also checked the settings variable, seemed to be populated and looks ok to me:
Tried several random stuff to actually fulfill the error message:
failure-detector.heartbeat-interval must be > 0s
including various permutation of HOCON entries, but to no avail.
Anything else I missed out?
Update #1
Modified HOCON to initialize Akka.Remote.
Still received what looks like the same error message.
But now it is stating:
failure-detector.heartbeat-interval must be > 0s
Previously it was stating:
failure-detector.acceptable-heartbeat-pause must be >= 0s

Managed to make it working now.
The cause of the issue: I was using Akka.Cluster.Tools latest release version 1.0.6
The fix: Upgraded to the latest beta version 1.1.2.30-beta
p/s: I wished the docs could have specified the minimum NuGet version required to make it work.

Related

How to avoid IE Navigation error which says the RPC server is unavailable?

I have a service which is installed on my server. It suddenly stops with the following error log:
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target, Object[] args, String[] namedParameters)
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at vbIranStock.VBNetLib.vbScript4.Parsing(Object& objIE, Object& MainHTML, String[]& logid, String& logpath, String& Servicepath, Boolean& doPrint) in vbScript4.vb:line 119
at vbIranStock.VBNetLib.vbScript4.VbsRun4(Boolean doPrint) in vbScript4.vb:line 50
at WindowsServiceVB.Service1.MyProgram() in Service1.vb:line 106
at WindowsServiceVB.Service1.ScheduleService() in Service1.vb:line 73
When I refer to the specified Visual Basic code line, I see following codes:
119: objIE.Navigate("https://www.example.ir" + lblUrl)
I checked following RPC related services which all are running and are not stopped:
Remote Process Call
Remote Process Call Locator
DeCom Server Process Launcher
RPC Endpoint Mapper
Remote Access Connection Manager
Remote Access Auto Connection Manager
Remote Registry
Besides I checked firewall and added inbound and outbound rules to allow my service connection.
But again I have this error. Please help me to stop getting the error.

Connecting to SQL 2014 via PowerShell

This has me stumped.
.NET version 4.7
Powershell 5.1
I am trying to use the : new-object System.Data.SqlClient.SqlConnection statement
to connect to a MS-SQL server.
The code connects when run as Administrator but fails when run as another user that is a member of Local Administrators group.
The user has (I think) all required SQL permissions and no SQL hardening has been done. It is sysadmin on the server both with a Windows account and a SQL account.
Using
try { new-object System.Data.SqlClient.SqlConnection }
catch { write-host $_.Exception.ToString() }
to simply catch the exception.
It returns Requested registry access is not allowed
Using ProcMon there is absolutely no difference in the registry calls what so ever between the two users except that under administrator 3 threads exit and under the user only 1.
I am not convinced it is an actual registry permission as I gave the account explicit permissions on both HKLM and HKCU in the lab.
If anyone has seen this and/or can recommend a fix please hit me up.
(The script has to run as the user account because it is called from within SQL and therefore invoked under the service account context of the SQL Server Agent)
Here is the exception:
try { new-object System.Data.SqlClient.SqlConnection }
catch { write-host $_.Exception.ToString() }
System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "0" argument(s): "The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception." ---> System
.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Data.SqlClien
t.SqlConnectionFactory' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. ---> System.Security.Se
curityException: **Requested registry access is not allowed.**
at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at System.Diagnostics.PerformanceCounterLib.FindCustomCategory(String category, PerformanceCounterCategoryType& categoryType)
at System.Diagnostics.PerformanceCounterLib.IsCustomCategory(String machine, String category)
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
at System.Data.ProviderBase.DbConnectionPoolCounters.Counter..ctor(String categoryName, String instanceName, String counterName, PerformanceCounterType counterType)
at System.Data.ProviderBase.DbConnectionPoolCounters..ctor(String categoryName, String categoryHelp)
at System.Data.SqlClient.SqlPerformanceCounters..ctor()
at System.Data.SqlClient.SqlPerformanceCounters..cctor()
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnectionFactory..cctor()
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnection..cctor()
--- End of inner exception stack trace ---
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
--- End of inner exception stack trace ---
at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)
PS SQLSERVER:>

Sitecore 8.1 : sitecore_fxm_web_index - Root item could not be found

We are using Sitecore 8.1 powered by Lucene index and xDB disabled.
We noticed that the CMS CA is quiet slow. While looking at logs noticed a number of error logged below:
ManagedPoolThread #4 2015:12:18 10:17:05 ERROR [Index=sitecore_fxm_web_index, Crawler=SitecoreItemCrawler, Database=web] Root item could not be found: /sitecore/system/Marketing Control Panel/fxm/.
ManagedPoolThread #15 2015:12:18 10:17:08 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Reflection.MethodInstance.Invoke()
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters)
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Jobs.Job.ThreadEntry(Object state)
Nested Exception
Exception: System.InvalidOperationException
Message: [Index=sitecore_fxm_web_index, Crawler=SitecoreItemCrawler, Database=web] Root item could not be found: /sitecore/system/Marketing Control Panel/fxm/.
Source: Sitecore.ContentSearch
at Sitecore.ContentSearch.SitecoreItemCrawler.get_RootItem()
at Sitecore.ContentSearch.SitecoreItemCrawler.IsAncestorOf(Item item)
at Sitecore.ContentSearch.SitecoreItemCrawler.IsExcludedFromIndex(IIndexableUniqueId indexableUniqueId, Boolean checkLocation)
at Sitecore.ContentSearch.SitecoreItemCrawler.Update(IProviderUpdateContext context, IIndexableUniqueId indexableUniqueId, IndexEntryOperationContext operationContext, IndexingOptions indexingOptions)
at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable`1 indexableInfo, IndexingOptions indexingOptions)
at Sitecore.ContentSearch.AbstractSearchIndex.Update(IEnumerable`1 indexableInfo)
Could someone please suggest why sitecore is looking for Web forms for marketing index which we don't need it?
Thanks
Sitecore looks for sitecore_fxm_web_index index. It's not a WFFM index - it's Federated Experience Manager Index. This is an integral part of Sitecore 8.1.
Here you can read more about Federated Experience Manager.
Looks like you're missing root item of this index, which is /sitecore/system/Marketing Control Panel/fxm/. I guess you're migration process from Sitecore 7 (which you mentioned in other question) to Sitecore 8.1 was not 100% successful.

System.Assembly.Load() Error

So I'm trying to load a Windows Forms application with Assembly.Load() and it's throwing this error when the bytes are trying to run:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.
at System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(Boolean defaultValue)
at CrypterTestFile.My.MyApplication.Main(String[] Args)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Test.Module1.Main() in C:\Users\Jeffrey\AppData\Local\Temporary Projects\Test\Module1.vb:line 15
Here's my code:
Dim entryPoint As MethodInfo = Assembly.Load(IO.File.ReadAllBytes(OFD.FileName)).EntryPoint
If entryPoint.GetParameters().Length = 0 Then
entryPoint.Invoke(Nothing, Nothing)
Else
entryPoint.Invoke(Nothing, New Object() {New String() {"0"}})
'Error is being thrown ^
End If
I'm not sure why this is happening, but it's just a simple Windows Forms application that has a label in the center of it.

Service Reference return value size issue

I have a Web Service method which returns a list of objects List<T>
When the the length of the list is 9000 objects or so, the service returns this list well, but when the length is like 12000 or more objects, the service returns an error:
The underlying connection was closed: The connection was closed unexpectedly.
`System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.FSharp.Core.FailureException: System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
at System.Net.HttpWebRequest.GetResponse()
at .$Type.httprequest.webRespBase#162#162(DelegatingHttpReq x#162, Unit _unit)
at .$Type.httprequest.webRespBase#162#162(DelegatingHttpReq x#162, Unit _unit)
at Storm.Types.WebHttp.DelegatingHttpReq.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at ServiceLogic.LoadRestriccionCanalPlano(String CodRuta, String CodTipoRuta)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Storm.UI.Forms.FormMainOps.clo#651.Invoke(Object[] methodParams#41)
at .$Type.bgworker.run#51#57_2.Invoke(DoWorkEventArgs dArgs)
at .$Type.bgworker.run#51#57_1.Invoke(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)`
I've tried changing the maxBufferSize maxBufferPoolSize maxReceivedMessageSize maxStringContentLength maxArrayLength etc in the binding configuration on the Web.config, but it still not working.
Any other ideas?
I've already found a solution in this post
The underlying connection was closed: The connection was closed unexpectedly