Eshoponcontainers: when running through F5 from visual studio 2019 getting HttpRequestException: Response status code does not indicate success: 503 (Service Unavailable).

Created on 13 Mar 2020  Â·  7Comments  Â·  Source: dotnet-architecture/eShopOnContainers

HttpRequestException: Response status code does not indicate success: 503 (Service Unavailable).
System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
System.Net.Http.HttpClient.GetStringAsyncCore(Task getTask)
Microsoft.eShopOnContainers.WebMVC.Services.CatalogService.GetCatalogItems(int page, int take, Nullable brand, Nullable type) in D:Visual studio 2019 ProjectseShopOnContainers-devsrcWebWebMVCServicesCatalogService.cs
Microsoft.eShopOnContainers.WebMVC.Controllers.CatalogController.Index(Nullable BrandFilterApplied, Nullable TypesFilterApplied, Nullable page, string errorMsg) in D:Visual studio 2019 ProjectseShopOnContainers-devsrcWebWebMVCControllersCatalogController.cs
Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
System.Threading.Tasks.ValueTask.get_Result()
System.Runtime.CompilerServices.ValueTaskAwaiter.GetResult()
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

All 7 comments

Set docker memory to 6gigs. Make sure all containers deleted. then run.. That helped for me

Getting exception from below code block

private static void InvokeSeeder(Action seeder, TContext context, IServiceProvider services)
where TContext : DbContext
{
context.Database.Migrate();
seeder(context, services);
}
}


Microsoft.Data.SqlClient.SqlException
HResult=0x80131904
Message=A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)
Source=Core Microsoft SqlClient Data Provider
StackTrace:
at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool, SqlAuthenticationProviderManager sqlAuthProviderManager)
at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at Microsoft.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.<Exists>b__0(DateTime giveUp) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_02.b__0(DbContext c, TState s)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationTState,TResult
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteTState,TResult
at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.ExecuteTState,TResult
at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.ExecuteTState,TResult in D:Visual studio 2019 ProjectseShopOnContainers-devsrcBuildingBlocksWebHostCustomizationWebHost.CustomizationWebHostExtensions.cs:line 75
at Microsoft.AspNetCore.Hosting.IWebHostExtensions.<>c__DisplayClass1_11.<MigrateDbContext>b__2() in D:\Visual studio 2019 Projects\eShopOnContainers-dev\src\BuildingBlocks\WebHostCustomization\WebHost.Customization\WebHostExtensions.cs:line 54 at Polly.Policy.<>c__DisplayClass108_0.<Execute>b__0(Context ctx, CancellationToken ct) at Polly.Policy.<>c__DisplayClass138_0.<Implementation>b__0(Context ctx, CancellationToken token) at Polly.Retry.RetryEngine.Implementation[TResult](Func3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates1 shouldRetryResultPredicates, Action4 onRetry, Int32 permittedRetryCount, IEnumerable1 sleepDurationsEnumerable, Func4 sleepDurationProvider)

how did this got resolved?

Thanks,

Yes It got resolved.

Devendra Sahu

From: neoAnkit [mailto:[email protected]]
Sent: Friday, March 20, 2020 2:37 PM
To: dotnet-architecture/eShopOnContainers eShopOnContainers@noreply.github.com
Cc: Devendra Sahu Devendra.Sahu@xeeva.com; State change state_change@noreply.github.com
Subject: Re: [dotnet-architecture/eShopOnContainers] when running through F5 from visual studio 2019 getting HttpRequestException: Response status code does not indicate success: 503 (Service Unavailable). (#1267)

WARNING: This E-Mail is from an outside source. Practice Caution!


how did this got resolved?

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHubhttps://github.com/dotnet-architecture/eShopOnContainers/issues/1267#issuecomment-601597672, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALINB34TSIWALWINYZTMBQTRIMW3NANCNFSM4LHC367A.

How?

By your previous suggestion , and also I waited to completed heath check done.

Thanks

From: neoAnkit [mailto:[email protected]]
Sent: Friday, March 20, 2020 2:58 PM
To: dotnet-architecture/eShopOnContainers eShopOnContainers@noreply.github.com
Cc: Devendra Sahu Devendra.Sahu@xeeva.com; State change state_change@noreply.github.com
Subject: Re: [dotnet-architecture/eShopOnContainers] when running through F5 from visual studio 2019 getting HttpRequestException: Response status code does not indicate success: 503 (Service Unavailable). (#1267)

WARNING: This E-Mail is from an outside source. Practice Caution!


How?

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHubhttps://github.com/dotnet-architecture/eShopOnContainers/issues/1267#issuecomment-601605782, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALINB33EGX66F5KTW5D6LULRIMZJTANCNFSM4LHC367A.

I found that refreshing the page after 15-20 seconds resolves the issue.

Was this page helpful?
0 / 5 - 0 ratings