locked
AppFabric 1.1 caching service crashes with System.UriFormatException: Invalid URI: The hostname could not be parsed.

    Question

  • I have an installation of AppFabric 1.1 x64 cache on a single machine (domain-registered, Windows 7 Enterprise), cluster with just 1 machine, configuration stored in SQL. Previously version 1.0 was installed and working fine, which I uninstalled before installing 1.1. Now starting the cluster times out with the following error in event log:

    {System.UriFormatException: Invalid URI: The hostname could not be parsed.

       at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)

       at Microsoft.ApplicationServer.Caching.ServiceConfigurationManager.InitializeThisHostData()

       at Microsoft.ApplicationServer.Caching.ServiceConfigurationManager.InitializeDataFromGlobalConfig()

       at Microsoft.ApplicationServer.Caching.VelocityWindowsService.StartService(Boolean deleteTKT)

       at Microsoft.ApplicationServer.Caching.VelocityWindowsService.StartServiceCallback(Object context)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

       at System.Threading.ThreadPoolWorkQueue.Dispatch()

       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()}. Check debug log for more information

    PS C:\Windows\system32> get-cachehostconfig $env:COMPUTERNAME 22233

    HostName        : SN2SCH010103028

    ClusterPort     : 22234

    CachePort       : 22233

    ArbitrationPort : 22235

    ReplicationPort : 22236

    Size            : 12286 MB

    ServiceName     : AppFabricCachingService

    HighWatermark   : 99%

    LowWatermark    : 90%

    IsLeadHost      : True

    PS C:\Windows\system32> Get-CacheHost

    HostName : CachePort  Service Name            Service Status Version Info

    --------------------  ------------            -------------- ------------

    SN2SCH010103028:22233 AppFabricCachingService DOWN           3 [3,3][1,3]

    Monday, April 30, 2012 12:02 AM

All replies

  • Are you in a domain environment? If so, could you try replacing SN2SCH010103028 with a fully qualified domain name?

    -Arijit

    Monday, April 30, 2012 9:33 AM
  • Thanks, that seemed to work. Could you explain what could be causing the problem here? Non-fully qualified name was working with version 1.0. Also, I see these warnings in the log:

    {c2f6cd6000000000000000000000000} failed to refresh lookup table, exception: {Microsoft.Fabric.Common.OperationCompletedException: Operation completed with an exception ---> Microsoft.Fabric.Federation.RoutingException: The target node explicitly aborted the operation

       --- End of inner exception stack trace ---

       at Microsoft.Fabric.Common.OperationContext.End()

       at Microsoft.Fabric.Federation.FederationSite.EndRoutedSendReceive(IAsyncResult ar)

       at Microsoft.Fabric.Data.ReliableServiceManager.EndRefreshLookupTable(IAsyncResult ar)}

    I'm going to try setting up a cluster of three servers and I'll post back here if I encounter any issues.

    Tuesday, May 01, 2012 12:31 AM
  • Looks like the System.Uri.CreateThis(...) failed when given a URI containing your host name. I'd hazard a guess that something was causing a name resolution issue when given your host name. Do you have an entry with you machine name in your %systemroot%\system32\drivers\etc\hosts file?

    Do you get these warnings when using the machine name or FQDN?

    Regards,
    Arijit

    • Proposed as answer by SquareWheel Wednesday, January 02, 2013 4:48 AM
    Tuesday, May 01, 2012 5:11 PM
  • Thanks for looking into this.

    1. The service starts with the warnings when using FQDN. The service doesn't even start when using machine name.

    3. Can these warnings be ignored? What do they mean?

        a. Basically, is it OK to just use the FQDN or will that cause other issues in future. Note that when using UI to configure AppFabric, there's no way to specify host name, so we have to use powershell for specifying FQDN

    2. Yes, there's an entry in hosts file for the machine name, but there is only one entry so what's could be causing the conflict?

        a. Also, this was working with 1.0 without using FQDN

    4. I don't see System.Uri.CreateThis method, I assume it's an internal method. What does it do?

    Thanks,

    Arun

    Tuesday, May 01, 2012 5:30 PM
  • My recommendation would be to remove the entries from your 'hosts' file and not use the FQDN, since the .Net API Uri.CreateThis does not appear to support hosts file entries with the local machine name. The System.Uri.CreateThis method was in the stack trace you mentioned.

    -Arijit

    Tuesday, May 01, 2012 5:37 PM