You are here

Cannot connect in Client-Server mode to localhost

29 posts / 0 new
Last post
pbromberg
Cannot connect in Client-Server mode to localhost

The desktop mode for the samples works fine with (local) as the server, but regardless of what I've tried, I cannot seem to connect to localhost with the default settings - from the same machine. I need to be able to run Eloquera as a windows service and at least connect from the same machine. I've looked at virtually every other comment on this subject and tried everything, but it's still "cannot connect".
Any tips?

dmytro
dmytro's picture

First of all, did you install Eloquera Database or did you use NuGet or zip package?
You need to install Eloquera Database that will register and run service (you can check this via Services window)

pbromberg

I installed the database and the service is running. I understand that the nuget package is only for desktop mode. BTW this is the x64 version. Here's the config file:

<?xml version="1.0"?>
<Eloquera xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Cache CommitSequenceMaxLength="2000" ShallowReadThreshold="1000" ShallowReadAhead="1000" ReadAhead="20" SaturationThreshold="10000" MemoryFootPrint="1000" CleanerPeriod="100" CleanerBatchSize="2000" IndexCleanerPeriod="100" IndexCleanerBatchSize="100" IndexCacheSize="10000" WriteThru="false" />
<Server ServerPort="43962" IPAddress="192.168.0.2" DatabasePath="C:\Program Files\Eloquera\Eloquera Server 4.0\Database" SNMPAddress="net.tcp://localhost:8523/SNMP" AutoRecovery="false" NotificationsEnabled="false" StoredProceduresPath="" Secure="false" AllowGroups="Everyone" AllowUsers="" VarSectorSize="40" IndexNodeSize="64" InMemoryAllowed="false" />
<SmartRuntime Smart="true" TypeUpdateAllowed="true" />
<UserLogin Enabled="false" PasswordHash="l+on1aCwDrcZ5bGlv+fyyIlYkbuFIOxZFlFwIGKlms0CCwoGn9TZvM0E3Uksjwx64+/yv8nsaUajWLz1kyKG7A==" />
</Eloquera>

(I originally was trying without IPAddress specified)

dmytro
dmytro's picture

Are you trying to connect to 192.168.0.2 or to localhost (which is 127.0.0.1)?
check with "netstat -an" what addresses are you listening
use "telnet [ip address] 43962" to verify connection

pbromberg

The 192.168.0.2 was just an experiment after I could not connect on localhost. 127.0.0.1 is listening. telnet 127.0.0.1 43962 give no error. This is Windows 7 x64. I even tried the 32 bit version, same issue. Firewall is disabled.

Jay
Jay's picture

Have you removed the IPAddress="192.168.0.2" attribute from the configuration completely? Or have you set its value to 127.0.0.1? And have you restarted the Eloquera DB service after changing the configuration?

pbromberg

I have removed the IPAddress attribute and restarted the service. Using the SimpleExample with
DB db = new DB("server=localhost;password=;options=none;");
I get:
The connection to the server localhost on the port 43962 cannot be established.
No connection could be made because the target machine actively refused it 127.0.0.1:43962
Here's a list if it will help:
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1026 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1027 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1028 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1029 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1030 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5357 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1114 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1114 127.0.0.1:1134 ESTABLISHED
TCP 127.0.0.1:1134 127.0.0.1:1114 ESTABLISHED
TCP 127.0.0.1:1434 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5354 0.0.0.0:0 LISTENING
TCP 192.168.0.2:139 0.0.0.0:0 LISTENING
TCP 192.168.0.2:1043 64.4.34.214:1863 ESTABLISHED
TCP 192.168.0.2:16230 207.46.105.159:80 ESTABLISHED
TCP 192.168.0.3:139 0.0.0.0:0 LISTENING
TCP 192.168.56.1:139 0.0.0.0:0 LISTENING
TCP [::]:80 [::]:0 LISTENING
TCP [::]:135 [::]:0 LISTENING
TCP [::]:445 [::]:0 LISTENING
TCP [::]:1025 [::]:0 LISTENING
TCP [::]:1026 [::]:0 LISTENING
TCP [::]:1027 [::]:0 LISTENING
TCP [::]:1028 [::]:0 LISTENING
TCP [::]:1029 [::]:0 LISTENING
TCP [::]:1030 [::]:0 LISTENING
TCP [::]:1433 [::]:0 LISTENING
TCP [::]:3389 [::]:0 LISTENING
TCP [::]:5357 [::]:0 LISTENING
TCP [::1]:1434 [::]:0 LISTENING

dmytro
dmytro's picture

I don't see that you have anything listening on 43962
do you have Eloquera Database service running?
when you run netstat -an you should see something listening on 43962

pbromberg

I get your drift. The "C:\Program Files\Eloquera\Eloquera Server 4.0\Lib\Eloquera.Server.exe" service is up and it is running in Services manager. I can start or stop the service at will. I can see it in Task Manager. Beats me!

dmytro
dmytro's picture

shutdown service, and from cmd manually start "C:\Program Files\Eloquera\Eloquera Server 4.0\Lib\Eloquera.Server.exe"
you will get console, tell me if you see there anything

Jay
Jay's picture

Well, it is rather unusual. Can you please check the event log (Applications log) for any messages from the Eloquera DB?

pbromberg

The only thing I get is when start or stop the service:
OnShutdown::Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Eloquera.LogicalTable.Program.OnShutdown()

But the service starts normally with nothing in the Application Event Log.

dmytro
dmytro's picture

Is this exception that you observe when you start "C:\Program Files\Eloquera\Eloquera Server 4.0\Lib\Eloquera.Server.exe" from cmd?

pbromberg

I am starting or stopping the Eloquera service from the Services Control Panel applet, not from the command line. The Application Log error only occurs when the service is stopped. I don't care about running it as an executable - I need to run it as a service in client-server mode.

dmytro
dmytro's picture

Please follow exact instruction to troubleshoot, otherwise you might wasting our time

pbromberg

Interestingly, if i execute Eloquera.Server.exe from the command line, it runs and then netstat -an shows that it is indeed now listening on 127.0.0.1:43962 -- but if I start the service like you would start or stop any service from the services applet, netstat -an shows no listening on that port. What gives?

dmytro
dmytro's picture

Can you uninstall, and install database again and then check with netstat -an.
When you uninstall, please make sure that you close services applet.

pbromberg

I've already done that, and I even removed all registry entries (some were left after uninstall) but yes, I'll do it again.

pbromberg

OK, I've unistalled, the service was first stopped and Services Applet closed. Reinstalled and netstat -an does not show anything listening on 43962 at all, neither TCP or UDP. Also, I enabled Windows Firewall before installing, and still have the same issue. My installation of Windows 7 x64 is pretty "plain vanilla" so I bet if I'm having this, some other people are too, you just might not be hearing about it. I want to write an article about this on our site at www.eggheadcafe.com. At least I'll be able to report that online help is excellent!

dmytro
dmytro's picture

All releases are being tested on clean VMs, given amount of commercial customers that use Windows 7 x64 we should have heard about this, no doubt.
I guess something is with 'NT AUTHORITY\NETWORK SERVICE' in your system, there could be antivirus.. anything from third party that blocks.
can you try on another machine?

pbromberg

I tried it on an x64 notebook and had the same issue. The only thing I'm running is Microsoft Security Essentials, which is pretty common. I just added the executable to the excluded files and processes in there, so I'll report on what I find. Probably tomorrow. Thanks for your help so far.

dmytro
dmytro's picture

You might get OnShutdown::Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Eloquera.LogicalTable.Program.OnShutdown() because system initialization on start failed for some reasons.
and you should be able to see message in the events log.

start service from command line
Net start [name_of_service]

For instance you should see in the logs events about service restart as well as any errors (e.g. windows logs -> application)

pbromberg

We're getting somewhere:

OnStart::Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\3c04ttdm.tmp'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()
at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)

dmytro
dmytro's picture

Up to what part do you have folders 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\ ?
(AppData could be hidden, therefore walk via cmd)

pbromberg

I have all of C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp and there are files and folders in it.
I added the everyone account to the folder and gave it Full Permissions. So far, it looks like netstat -an is showing it listening. Also, i changed the service to run under the local System account. Seems like everything is working fine now. Excellent work! Thank you.

dmytro
dmytro's picture

Did you change C:\Windows\ServiceProfiles\LocalService?
you should check permissions of C:\Windows\ServiceProfiles\NetworkService
it should have in Security tab, Group and user names a "NETWORK SERVICE", which is in Advanced should show
Allow NETWORK SERVICE Full Control This folder, subfolders...

pbromberg

Here's the article: http://goo.gl/rXhXV Thanks so much for your expert help!

mathieu.rivest

This is quite frustrating. I do get this same error (No connection could be made because the target machine actively refused it) with the Enterprise Edition installed on windows 7 x64. I believe the port 192.162.2.10 is linked to IIS somehow. Could that cause any problems? I can run the client version (4.60) fine, but not the enterprise edition (5.0 preview).

This is what I have listening to port 43962 after I start the service (nothing is used if the service is not started):

TCP 192.168.2.10:43962 0.0.0.0:0 LISTENING

What can I do?

dmytro
dmytro's picture

Could you please describe your configuration in more details.
Can you connect to the node using Emcee? Have you configured user to access database?
Default access, as in 4.x, won't work. There should be explicit rights granted.

Copyright © 2008-2013 Eloquera Corp. All rights reserved.