Particular / ServiceControl

Backend for ServiceInsight and ServicePulse
https://docs.particular.net/servicecontrol/
Other
54 stars 47 forks source link

Service Unavailable on service #390

Closed cbrown11 closed 10 years ago

cbrown11 commented 10 years ago

Since moving to 1.3 from Beta we are getting this error "Service Unavailable on service". When we try and connect to the api. It works ok with the localhost (http://localhost:33333/api/) but the not the hostname.

Have tried all Netsh and cant see anything in the logs.

Netsh http add urlacl url=http://*:33333/api user=everyone listen=yes

Any other suggestions?

Did get this working locally but then tried removing everything and reinstalling. Now the localhost is not even working.

gbiellem commented 10 years ago

Hi @cbrown11

Sounds like you need to set the hostname in the config as well. It's covered in this doco

cbrown11 commented 10 years ago

Thanks @gbiellem

Though already tried this, and think this was the cause of the localhost not working. As worked with localhost when hostname was not provided. But saw the note that both port and hostname are required.

Originally and worked with localhost was

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<configuration>
  <appSettings>
    <add key="ServiceControl/Name" value="Particular.ServiceControl.Debug" />    
    <add key="ServiceBus/AuditQueue" value="name.debug.crpt.qir.audit" />
    <add key="ServiceBus/ErrorQueue" value="name.debug.crpt.qir.error" />
    <add key="ServiceControl/Port" value="33333" />
    <add key="ServiceControl/ExposeRavenDB" value="true" />
  </appSettings>
</configuration>

Tried * and hostname and didnt work. And now localhost is not working. Even after changing back and resinstalling

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<configuration>
  <appSettings>
    <add key="ServiceControl/Name" value="Particular.ServiceControl.Debug" />    
    <add key="ServiceBus/AuditQueue" value="name.debug.crpt.qir.audit" />
    <add key="ServiceBus/ErrorQueue" value="name.debug.crpt.qir.error" />
    <add key="ServiceControl/Hostname" value="*" />
    <add key="ServiceControl/Port" value="33333" />
    <add key="ServiceControl/ExposeRavenDB" value="true" />
  </appSettings>
</configuration>

Install by :

$serviceDescription =   "Particular Software ServiceControl for NServiceBus on $environment"
$serviceDisplay =   "Particular.ServiceControl.$environment"

ServiceControl.exe /install /serviceName:$serviceName /displayName:$serviceDisplay /description:$serviceDescription

and also run

netsh http delete urlacl url=http://*:33333/api
netsh http add urlacl url=http://*:33333/api user=everyone listen=yes
cbrown11 commented 10 years ago

Can't connect to it all now. Though installed and running.

This is what i see in the log file:

2014-10-13 09:24:57.8766|1|Warn|NServiceBus.Configure|Invocation of NServiceBus.INeedInitialization completed in 8.33 s - Details:
ServiceControl.Infrastructure.RavenDB.RavenBootstrapper - 8.1446 s
NServiceBus.EnsureLoadMessageHandlersWasCalled - 0.0658 s
NServiceBus.Licensing.LicenseInitializer - 0.0436 s
Particular.ServiceControl.Licensing.LicenseDetector - 0.0356 s
ServiceControl.Infrastructure.SignalR.Configure - 0.0113 s
NServiceBus.Unicast.Transport.Config.Bootstrapper - 0.0047 s
NServiceBus.Unicast.Queuing.QueuesCreator - 0.0042 s
NServiceBus.Unicast.Config.StartupRunners - 0.0028 s
NServiceBus.Config.SatelliteConfigurer - 0.0021 s
ServiceControl.EventLog.EventLogMappings - 0.0020 s
ServiceControl.Operations.ImportRegistration - 0.0019 s
NServiceBus.Pipeline.PipelineOverrideConfigurer - 0.0018 s
NServiceBus.Scheduling.Configuration.SchedulerConfiguration - 0.0016 s
ServiceControl.CustomChecks.CustomChecksComputationInitializer - 0.0012 s
ServiceControl.HeartbeatMonitoring.HeartbeatStatusInitializer - 0.0011 s
ServiceControl.EndpointControl.Handlers.KnownEndpointsCache - 0.0009 s
ServiceControl.BusinessMonitoring.EndpointSLAMonitoring - 0.0009 s
NServiceBus.Unicast.Monitoring.ProcessingStatistics - 0.0008 s
ServiceControl.Operations.LicenseStatusKeeper - 0.0008 s
NServiceBus.Encryption.Bootstrapper - 0.0007 s
NServiceBus.Unicast.BackwardCompatibility.SetIsSagaMessageHeaderForV3XMessages - 0.0007 s
NServiceBus.Gateway.HeaderManagement.GatewayHeaderManager - 0.0007 s
NServiceBus.Bootstrapper - 0.0006 s
NServiceBus.Unicast.Monitoring.VersionMutator - 0.0006 s
NServiceBus.Unicast.BackwardCompatibility.MutateMessageContentTypeOfIncomingTransportMessages - 0.0006 s
NServiceBus.Unicast.Monitoring.CausationMutator - 0.0006 s
ServiceControl.MessageFailures.MessageFailuresComputation - 0.0004 s
NServiceBus.Audit.InitMessageAuditer - 0.0004 s
NServiceBus.Sagas.AutoCorrelateSagaOnReplyMutator - 0.0002 s
NServiceBus.Sagas.OriginatingSagaHeaderMutator - 0.0001 s

2014-10-13 09:24:58.3916|1|Warn|NServiceBus.RavenDB.Persistence.RavenUserInstaller|Failed to add user to raven. Processing will continue
System.MissingMethodException: Method not found: '!!0 Raven.Abstractions.Extensions.JsonExtensions.JsonDeserialization(Raven.Json.Linq.RavenJObject)'.
   at NServiceBus.RavenDB.Persistence.RavenUserInstaller.AddUserToDatabase(String identity, DocumentStore documentStore)
   at NServiceBus.RavenDB.Persistence.RavenUserInstaller.Install(String identity) in y:\BuildAgent\work\9a11e8d269f40709\src\NServiceBus.RavenDB\RavenUserInstaller.cs:line 43

Running RavenDB 2.0.3.2375.

cbrown11 commented 10 years ago

I managed to get my localhost working again by changing the port to 33334, (though not on 33333). And managed to get the localhost and my machine working, but not together - (*).

The following configuration does not seem to work:

<add key="ServiceControl/Hostname" value="*" />

As still get the error with the above configuration:

Service Unavailable on service
cbrown11 commented 10 years ago

Tried this on a server and get the same issue above. Including not working on the default port 33333 (any other port is ok).

can view the ravendb if on port 33333 though.

Had no issue on the beta version. So strange why this is happening for 1.3.

gbiellem commented 10 years ago

Hi @cbrown11

I retested ServiceControl 1.2.3 and I have it responding on localhost, the hostname and via IP address on post 33333 when i use the following configs:

ServiceControl.exe.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <appSettings>
        <add key="ServiceControl/HostName" value="*" />
        <add key="ServiceControl/Port" value="33333" />
    </appSettings>
</configuration>
URLACL
Reserved URL            : http://*:33333/api/
    User: \Everyone
        Listen: Yes
        Delegate: No
        SDDL: D:(A;;GX;;;WD)

The only way I could stop it working as you've described was by having multiple URLACLs that overlap. For instance if I have the following I get a 503 when I try to get to http://localhost:33333/api/ but the service works via IP address and hostname:

Reserved URL            : http://*:33333/api/
    User: \Everyone
        Listen: Yes
        Delegate: No
        SDDL: D:(A;;GX;;;WD)

Reserved URL            : http://localhost:33333/api/
    User: \Everyone
        Listen: Yes
        Delegate: No
        SDDL: D:(A;;GX;;;WD)

Can you try running this command from PowerShell and see if you have any additional URLACLs ?

netsh http show urlacl  | select-string 33333/api/
cbrown11 commented 10 years ago

Thanks @gbiellem

I had:

http://localhost:33333/api/
http://+:33333/api/
http://*:33333/api/
http://<hostname>:33333/api/

Removed all except http://*:33333/api/ and this now works as expected.

Though I had multiple URLACLs for the different port (33334) and was not having the same issue:

http://localhost:33334/api/ http://:33334/api/

gbiellem commented 10 years ago

@cbrown11 - Glad I could help.

I think your 33334 URL is working because that last entry looks invalid - No wildcard or hostname between the : and the port number so I'm guessing it's being ignored.