Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Service Based Architecture - No Hosts Available

Posted on by Microsoft Employee

I've been trying to get the Service Based Architecture running on my development machine after the RTM of Dynamics GP 2015 shipped and I think I've gotten most of the way there, but I keep getting an error ithat says, "No hosts were available to process the request for tenant 'DefaultTenant'." I can't seem to find any more detail on why that would be the case in any of the other logs. Isn't it supposed to spin up a new host if one can't be found? Where would that process be logged?

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture - No Hosts Available

    I tried to put together my own description on how to get all of this running in a blog post: blog.interdynartis.com/using-the-dynamics-gp-service-based-architecture

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture - No Hosts Available

    OK, I think I have this running. I didn't realize there was a slight delay after applying the changes in the configuration manager, so I thought that it was only adding the SQL user name and password that mattered, but it turns out that I needed GPInstance to be set to DEFAULT also. When I set that in there and left it, everything started working.

    I appreciate all the help!

  • Chris Rudolph Profile Picture
    Chris Rudolph 20 on at
    RE: Service Based Architecture - No Hosts Available

    Your trace doesn't suggest an exception. It genuinely doesn't think there is a host. Can you rerun the original /diagnostics endpoint check? I know you shared the RoutingTable section earlier (which looked fine), but an issue here is the only reason this could be happening.

    The routes are checked & refreshed often - are there any other error lines in the log for other reasons? Intermittent issues with the services talking to each other?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture - No Hosts Available

    Note: I just realized I posted the diagnostic detail from an attempt I made to try a different request, just to see if I got a different error, but the trace is exactly the same when I issue a ping request (except the request URL is different, obviously).

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture - No Hosts Available

    Yeah, I guess I should have said I looked there, but the diagnostic detail was essentially the same as before.

    Here's the actual error:

    2014-12-16_13:39:02.352 (E) --> RequestException :: Details:[CorrelationId:[680db9d43eda4e3880e3db0216007696], HttpCode:[500], ErrorType:[NoHostsAvailable], Source:[GPService], ExInfo:[Microsoft.Dynamics.GP.Svc.Foundation.ErrorHandling.RequestException: No hosts were available to process the request for tenant 'Test'.
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.ForwardingStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.TenantInformationStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.AuthenticationStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.CorsStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.ErrorHandlingStep.<Invoke>d__0.MoveNext()]]


    And here is all the output there is (from GPService_Verbose.log):

    2014-12-16_13:39:02.351 (V) --> ReportRequestFullUrl :: CorrelationId:[680db9d43eda4e3880e3db0216007696], Url:[https://phaag:48654/GPService/Tenants(Test)/Companies(Fabrikam,%20Inc.)/Items]
    2014-12-16_13:39:02.351 (V) --> ReportRequestUriWithoutHostInfo :: CorrelationId:[680db9d43eda4e3880e3db0216007696], PartialUrl:[/GPService/Tenants(Test)/Companies(Fabrikam,%20Inc.)/Items]
    2014-12-16_13:39:02.351 (V) --> ReportRequestUriWithoutHostAndTenantInfo :: CorrelationId:[680db9d43eda4e3880e3db0216007696], PartialUrl:[/Companies(Fabrikam,%20Inc.)/Items]
    2014-12-16_13:39:02.351 (I) --> RequestStart :: CorrelationId:[680db9d43eda4e3880e3db0216007696], Uri:[/GPService/Tenants(Test)/Companies(Fabrikam,%20Inc.)/Items], Method:[GET]
    2014-12-16_13:39:02.351 (I) --> CorsCheckSkipped :: CorrelationId:[680db9d43eda4e3880e3db0216007696], Reason:[No 'Origin' header present]
    2014-12-16_13:39:02.351 (I) --> CreateCredentialsStart :: CorrelationId:[680db9d43eda4e3880e3db0216007696], SelectedAuthMode:[Windows]
    2014-12-16_13:39:02.351 (I) --> CreateCredentialsStop :: CorrelationId:[680db9d43eda4e3880e3db0216007696], User:[ARTISINC\phaag], AuthType:[NTLM], PrincipalId:[cb06cdc7-4d15-4c9e-b711-cfb53a665d52], ElapsedMs:[0]
    2014-12-16_13:39:02.351 (I) --> TenantAuthorizationCheck :: CorrelationId:[680db9d43eda4e3880e3db0216007696], User:[ARTISINC\phaag], Tenant:[Test], Authorized:[True], ElapsedMs:[0]
    2014-12-16_13:39:02.352 (E) --> RequestException :: Details:[CorrelationId:[680db9d43eda4e3880e3db0216007696], HttpCode:[500], ErrorType:[NoHostsAvailable], Source:[GPService], ExInfo:[Microsoft.Dynamics.GP.Svc.Foundation.ErrorHandling.RequestException: No hosts were available to process the request for tenant 'Test'.
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.ForwardingStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.TenantInformationStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.AuthenticationStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.CorsStep.<Invoke>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Dynamics.GP.Svc.GPService.Requests.Steps.ErrorHandlingStep.<Invoke>d__0.MoveNext()]]
    2014-12-16_13:39:02.352 (I) --> CompressionApplied :: CorrelationId:[680db9d43eda4e3880e3db0216007696], Original:[332], Compressed:[224]
    2014-12-16_13:39:02.352 (I) --> RequestStop :: CorrelationId:[680db9d43eda4e3880e3db0216007696], Host:[], Code:[500], GPSTime:[1], GPSOverhead:[1], DSTime:[0], DSOverhead:[0], ProcessTime:[0], ProcessOverhead:[0], OpTime:[0]


  • Chris Rudolph Profile Picture
    Chris Rudolph 20 on at
    RE: Service Based Architecture - No Hosts Available

    In the event of an error at forwarding time (host turns out to be unavailable for some reason), the service will fall back to other routes. If a route exists but a 'no hosts' error is still returned, it's likely there was some kind of internal exception while trying to forward the request on to the GP instance for processing.

    If true, additional helpful context should be available in the GPService_Error.log and/or _Info.log files (%ProgramData%\Microsoft Dynamics\GPSvc\Logs\GPService).

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture - No Hosts Available

    Update to this: I changed the SQLUserName and SQLPassword to the SQL username and password I think at some point I had to enter during the install and my RoutingTable value now has a route!

    "RoutingTable": [
        {
          "HostId": "PHAAG",
          "TenantName": "Test",
          "Instance": "DEFAULT",
          "GPVersion": "14",
          "ForwardingBaseAddress": "http://mymachine:48655/DS/DEFAULT_14/",
          "ProcessLoad": 1.0
        }
      ]

    Unfortunately, my ping request (https://mymachine:48654/GPService/Tenants(Test)/Companies(Fabrikam,%20Inc.)/Utility/Ping) still returns "No hosts were available to process the request for tenant 'Test'."

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture - No Hosts Available

    I get the point about a dev environment and what not, but part of this exercise was making sure we could install it in a "real world" scenario and also understand what happens in that same scenario if security is incorrect.

    I must still be missing something, though, because it's still not working. Here's what I did, so let me know if this was in the wrong place:

    1. Navigated to web management console (https:mymachine:8089/WebManagementConsole/).
    2. Clicked on Tenant Manager (I believe this is the Tenants snap-in you were referring to above).
    3. Double-clicked my only tenant to edit it.
    4. Clicked on GP Services in the Application Settings list of applications.
    5. Set the following values (are the correct values for this documented anywhere? the RTM TSInstallAdminGuide.pdf only has values for the Web Client and Web Services):
      • DynamicssetLocation: C:\Dynamics\GP2015\Dynamics.set
      • DexiniLocation: C:\Dynamics\GP2015\Data\Dex.ini
      • SQLUserName: Not really sure what's supposed to be here, but to remove any complication on security, I entered sa.
      • SQLPassword: sa user's password
      • GPVersion: initially, I put nothing, but changed it to 14.
      • GPInstanceName: initially, I put nothing (since it's the default instance and doesn't have a name), but thinking this might be the application instance and just poorly labeled, I also tried entering DEFAULT.
      • RequestLoggingEnabled: true
      • OperationTimeOut: left blank

    There isn't one labeled ApplicationInstance or something like that, so I'm not sure what to try next.

  • Chris Rudolph Profile Picture
    Chris Rudolph 20 on at
    RE: Service Based Architecture - No Hosts Available

    Multiple tenant deployments have their metadata managed through the tenant snapin. It's a separate plugin that is part of the management console.

    The SessionHostTenantAssignment table is specific to the web client and thus won't apply.

    The application instance is the name given to the GP instance at install time. Yours (per the diagnostic input) is DEFAULT.

    So in your case, the answer involves the following steps:

    1. Make sure you've added the service-based architecture application to your tenant via the snapin

    2. Once added, make sure you fill out the required config settings. The application instance is one of these.

    Finally...quick tip. For a development environment, a single tenant install is much easier to deploy & manage. You can still support multiple 'tenants' this way (for testing different versions or sets of dictionaries) by adding them as elements in your local TenantConfiguration.xml file. The only limitation is that you won't be able to setup user -> tenant security mappings. The security aspect isn't a big deal while developing.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture - No Hosts Available

    My install is configured for multiple tenants. How do I add a mapping between my Test tenant and an application instance in that scenario? I didn't see any way to configure that mapping through the web management console, but maybe I'm just missing it. Also, what is an Application Instance? Nothing in the web management console uses that term.

    I noticed that I don't have anything in the SessionHostTenantAssignment table in the configuration database, but inserting a row to link my session host to my tenant didn't fix the issue (even after restarting all services, got the same error and the RoutingTable is still empty in the management diagnostics response).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans