locked
502 Bad Gateway / failing on passwordsigninasync call RRS feed

Answers

  • User1424416479 posted

    I SOLVED this issue.

    The solution involved removing a user claim (custom Identity user property) value which stored a image (avatar) against the user.

    When I removed that item the Header Size exceeded and Bad Gateway 502 problem went away.

    Moral of this story?

    Keep the user claim data within tolerance of the response header size.

    This issue caused me grief for more than a month.

    I continue to really enjoy coding and these sort of things keep me humble and right on!

    Hope this answer helps someone else.

    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 15, 2019 2:33 PM

All replies

  • User-1764593085 posted

    Hi hkdave95,

    Microsoft.AspNetCore.Identity.SignInResult loSignInResult = await base._oLoginManager.PasswordSignInAsync(loUser.UserName, lsPassword, true, false);

    This is the line that causes the 502 Bad Gateway message.

    Does this line directly gives 502 error or causes an exception which is  handled by other error mechanisms and gives 502? What is the error messages of the exception?

    The outermost layer of the middleware is a try catch. Any IO exception will be caught.

    You could enable logging when you publish to IIS by changing  `stdoutLogEnabled="true"` in web.config file.For more details, refer to Troubleshoot ASP.NET Core on IIS

    Best Regards,

    Xing

    Friday, May 31, 2019 3:08 AM
  • User1424416479 posted

    Hello Xing

    Response much appreciated.

    I put a "return redirect" before the line and subroutine redirects accordingly. I remove the one before and move the redirect after the offending line. The 502 occurs. The error handling in the try catch around the offending statement is not working. the passwordsigninasync is causing failure which cannot be trapped.

    I shall enable logging and post again soon.

    David

    Saturday, June 1, 2019 12:10 PM
  • User475983607 posted

    Hopefully you are using source control and can compare the working source with the current version. 

    If you are not using source control then it seems you might be using a custom SignInManager?  Maybe you extended the Identity APIs?  There could be ab issue with the code which causes an exception and Kestrel to return a 502 to IIS.  This assumes you are using out of process.

    I would try firing up the app using the command line.  This means you have to install the SDK on your server.  Often you get a pretty distinctive error message in the console and can go from there.

    Saturday, June 1, 2019 1:27 PM
  • User1424416479 posted

    Hello mgebhard

    TY for the reply...Below is an excerpt form the stdout...

    We can see that the code is logging the user in successfully. First log line.

    Last line states 302.

    As I understand the 502. It is the communication between the client (browser) and server that is broken. And quite often it is the client that is causing the error.

    Does this throw any light on the matter?

    David

    info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[10]
    AuthenticationScheme: Identity.Application signed in.
    warn: Microsoft.EntityFrameworkCore.Query[20500]
    The LINQ expression 'where ([E].GetDataDataset.Document.Count > 0)' could not be translated and will be evaluated locally.
    warn: Microsoft.EntityFrameworkCore.Query[20500]
    The LINQ expression 'orderby [E].GetDataDataset.Document.get_Item(0).D_dStored desc' could not be translated and will be evaluated locally.
    info: Microsoft.EntityFrameworkCore.Database.Command[20101]
    Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
    SELECT [E].[E_gId], [E].[E_bActive], [E].[E_nType], [E].[E_ORG_gId], [E].[E_sCode], [E].[E_sDescription], [E].[E_xData]
    FROM [Entities] AS [E]
    WHERE [E].[E_nType] = CAST(1 AS smallint)
    warn: Microsoft.EntityFrameworkCore.Query[20500]
    The LINQ expression 'where ([E].GetDataDataset.Document.Count > 0)' could not be translated and will be evaluated locally.
    warn: Microsoft.EntityFrameworkCore.Query[20500]
    The LINQ expression 'orderby [E].GetDataDataset.Document.get_Item(0).D_dStored desc' could not be translated and will be evaluated locally.
    info: Microsoft.EntityFrameworkCore.Database.Command[20101]
    Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
    SELECT [E].[E_gId], [E].[E_bActive], [E].[E_nType], [E].[E_ORG_gId], [E].[E_sCode], [E].[E_sDescription], [E].[E_xData]
    FROM [Entities] AS [E]
    WHERE [E].[E_nType] = CAST(2 AS smallint)
    warn: Microsoft.EntityFrameworkCore.Query[20500]
    The LINQ expression 'where ((((Convert([E].ENType, Int32) == 0) AndAlso ([E].GetDataDataset.Optin.Count > 0)) AndAlso ([E].GetDataDataset.Optin.get_Item(0).OI_ORG_gId == __8__locals1_lgORG_gId_0)) AndAlso ([E].GetDataDataset.Optin.get_Item(0).OI_sUserNameAtTimeOfAccepting == __loUser_UserName_1))' could not be translated and will be evaluated locally.
    warn: Microsoft.EntityFrameworkCore.Query[20500]
    The LINQ expression 'orderby [E].GetDataDataset.Optin.get_Item(0).OI_dOfOptin desc' could not be translated and will be evaluated locally.
    info: Microsoft.EntityFrameworkCore.Database.Command[20101]
    Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
    SELECT [E].[E_gId], [E].[E_bActive], [E].[E_nType], [E].[E_ORG_gId], [E].[E_sCode], [E].[E_sDescription], [E].[E_xData]
    FROM [Entities] AS [E]
    info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
    Executed action method Heron.Dashboard.Controllers.AccountController._CheckCaptcha (Heron.Dashboard), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 1662.3289ms.
    info: Microsoft.AspNetCore.Mvc.RedirectToActionResult[1]
    Executing RedirectResult, redirecting to /Dashboard?lsData=lu823pM3F%252bX9A38wBT7ZrsP%252fABIA1wq5z0tbKzIFCIJQJsRKhjH8MS%252bKRqnIh1Z%252fl6QbRG9KUAMQNihZMtrWnegTbSk31ggsxTc3sa8JsgyqqFJib7dCU3OrhjRCSLS%252bX7SJ7%252fcrAwc%253d.
    info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
    Executed action Heron.Dashboard.Controllers.AccountController._CheckCaptcha (Heron.Dashboard) in 1712.8092ms
    info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
    Executed endpoint 'Heron.Dashboard.Controllers.AccountController._CheckCaptcha (Heron.Dashboard)'
    info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
    Request finished in 1730.079ms 302

    Saturday, June 1, 2019 1:47 PM
  • User1424416479 posted

    FYI...I do not use a custom sign in...

    I have a feeling from the stdout that the error is not there anymore despite tracking that line using the method described in a previous post.

    Saturday, June 1, 2019 1:56 PM
  • User475983607 posted

    As I understand the 502. It is the communication between the client (browser) and server that is broken. And quite often it is the client that is causing the error.

    IIS is the client if you are using IIS as a reverse proxy; out-of-process.  

    Saturday, June 1, 2019 2:48 PM
  • User1424416479 posted

    TY / Back to Google

    Saturday, June 1, 2019 3:02 PM
  • User1424416479 posted

    FYI...

    I have made some changes. See my new Startup Code:

    Note I have reinvestigated the line that fails and it is I still the passwordsigninasync line. Problem has now shifted to an ERR_CONNECTION_RESET rather than bad gateway.

    using Microsoft.AspNetCore.Builder;
    using Microsoft.AspNetCore.Hosting;
    using Microsoft.AspNetCore.Http;
    using Microsoft.AspNetCore.Identity;
    using Microsoft.EntityFrameworkCore;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.DependencyInjection;
    using System;
    using reCAPTCHA.AspNetCore;
    using System.Globalization;
    using System.Collections.Generic;
    using Microsoft.AspNetCore.Localization;
    using Newtonsoft.Json.Serialization;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.Rewrite;
    using Microsoft.Extensions.Logging;
    using Microsoft.AspNetCore.Mvc.Authorization;
    using Microsoft.AspNetCore.Authorization;
    using Microsoft.AspNetCore.Authentication;
    using Microsoft.Extensions.Options;
    using System.Text.Encodings.Web;
    using System.Threading.Tasks;
    using System.Security.Claims;
    using Microsoft.AspNetCore.Authentication.Cookies;
    using System.Net.Http;
    using Microsoft.AspNetCore.ResponseCompression;
    using System.IO.Compression;
    using Microsoft.AspNetCore.Mvc.ModelBinding;
    
    namespace Heron.Dashboard
    {
        public class Startup
        {
            public static IConfiguration _oConfiguration2 { get; set; }
            public IConfiguration _oConfiguration { get; }
            public bool _bIsStaging
            {
                get
                {
                    try
                    {
                        Heron.Dashboard.Classes.Configuration._bStaging = (this._oConfiguration.GetSection("AppSettings").GetSection("Staging").Value == "1");
                        return Heron.Dashboard.Classes.Configuration._bStaging;
                    }
                    catch (Exception loException)
                    {
                        Heron.Library.Classes.Utility.MakeExceptionMessage(loException, "\r\n", "Startup._bIsStaging");
                    }
                    return true;
                }
            }
    
            public bool _bIsCloud
            {
                get
                {
                    try
                    {
                        Heron.Dashboard.Classes.Configuration._bCloud = (this._oConfiguration.GetSection("AppSettings").GetSection("Cloud").Value == "1");
                        return Heron.Dashboard.Classes.Configuration._bCloud;
                    }
                    catch (Exception loException)
                    {
                        Heron.Library.Classes.Utility.MakeExceptionMessage(loException, "\r\n", "Startup._bIsCloud");
                    }
                    return true;
                }
            }
    
            public string GetAppSetting(string lsAppSetting)
            {
                if (this._bIsCloud && !this._bIsStaging)
                {
                    return "C" + lsAppSetting;
                }
                else if (this._bIsCloud && this._bIsStaging)
                {
                    return "S" + lsAppSetting;
                }
                else
                {
                    return "D" + lsAppSetting;
                }
            }
    
            public string GetConnectionStringName(string lsConnectionStringName)
            {
                if (this._bIsCloud && !this._bIsStaging)
                {
                    return "C" + lsConnectionStringName;
                }
                else if (this._bIsCloud && this._bIsStaging)
                {
                    return "S" + lsConnectionStringName;
                }
                else
                {
                    return "D" + lsConnectionStringName;
                }
            }
    
            public Startup(IHostingEnvironment loEnv, IConfiguration loConfiguration)
            {
                try
                {
                    _oConfiguration = this._oConfiguration = loConfiguration;
                }
                catch (Exception loException)
                {
                    Heron.Library.Classes.Utility.MakeExceptionMessage(loException, "\r\n", "Startup.Startup");
                }
            }
    
            public void ConfigureServices(IServiceCollection loServices)
            {
                try
                {
                    if (!this._bIsStaging)
                    {
                        loServices.Configure<MvcOptions>(options =>
                        {
                            options.Filters.Add(new RequireHttpsAttribute());
                        });
                    }
                    Heron.Data.Classes.ConnectionStrings._sHeronConnectionString = this._oConfiguration.GetConnectionString(this.GetConnectionStringName("Heron"));
                    Heron.Data.Classes.ConnectionStrings._sIdentityConnectionString = this._oConfiguration.GetConnectionString(this.GetConnectionStringName("Identity"));
                    loServices.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
                    loServices.AddDbContext<Heron.Data.DB.HeronContext>(O => O.UseSqlServer(Heron.Data.Classes.ConnectionStrings._sHeronConnectionString));
                    loServices.AddScoped<DbContext>(sp => sp.GetService<Heron.Data.DB.HeronContext>());
                    loServices.AddDbContext<Heron.Data.DB.Extensions.IdentityExtend.DbContext>(O => O.UseSqlServer(Heron.Data.Classes.ConnectionStrings._sIdentityConnectionString));
                    loServices.AddScoped<DbContext>(sp => sp.GetService<Heron.Data.DB.Extensions.IdentityExtend.DbContext>());
                    loServices.AddIdentity<Heron.Data.DB.Extensions.IdentityExtend.User, Heron.Data.DB.Extensions.IdentityExtend.Role>(opts =>
                    {
                        opts.Lockout.DefaultLockoutTimeSpan = new TimeSpan(0, 0, Heron.Library.Classes.Constants._nDefaultLockoutTime, 0);
                        opts.Lockout.MaxFailedAccessAttempts = Heron.Library.Classes.Constants._nMaxFailedAccessAttempts;
                        opts.Lockout.AllowedForNewUsers = true;
                        opts.Password.RequireDigit = true;
                        opts.Password.RequireLowercase = true;
                        opts.Password.RequireUppercase = true;
                        opts.Password.RequireNonAlphanumeric = true;
                        opts.Password.RequiredLength = Heron.Library.Classes.Constants._nMinRequiredDigitsPassword;
                    }).AddEntityFrameworkStores<Heron.Data.DB.Extensions.IdentityExtend.DbContext>().AddDefaultTokenProviders();
                    loServices.AddScoped<SignInManager<Heron.Data.DB.Extensions.IdentityExtend.User>>();
                    loServices.AddScoped<UserManager<Heron.Data.DB.Extensions.IdentityExtend.User>>();
                    loServices.AddScoped<RoleManager<Heron.Data.DB.Extensions.IdentityExtend.Role>>();
                    loServices.ConfigureApplicationCookie(options =>
                    {
                        options.LoginPath = new PathString("/Account/Index");
                        options.Cookie.Name = "HeronAuthCookie";
                    });
                    loServices
                        .AddMvc(options =>
                        {
                            options.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()));
                            options.RespectBrowserAcceptHeader = true;
                        })
                        .AddJsonOptions(options =>
                        {
                            options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
                            options.SerializerSettings.ContractResolver = new DefaultContractResolver();
                        })
                        .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
                        .AddSessionStateTempDataProvider();
                    loServices.AddDistributedMemoryCache();
                    loServices.AddSession();
                    loServices.AddKendo();
                    loServices.Configure<RecaptchaSettings>(this._oConfiguration.GetSection("RecaptchaSettings"));
                    loServices.AddTransient<IRecaptchaService, RecaptchaService>();
                    loServices.Configure<IISOptions>(this._oConfiguration);
                    loServices.Configure<RequestLocalizationOptions>(options =>
                    {
                        options.RequestCultureProviders.Clear();
                        options.DefaultRequestCulture = new Microsoft.AspNetCore.Localization.RequestCulture("en-GB");
                        options.SupportedCultures = new List<CultureInfo> { new CultureInfo("en-GB") };
                    });
                }
                catch (Exception loException)
                {
                    Heron.Library.Classes.Utility.MakeExceptionMessage(loException, "\r\n", "Startup.ConfigureServices");
                }
            }
    
            public void Configure(IApplicationBuilder loApp, IHostingEnvironment loEnv)
            {
                try
                {
                    if (!this._bIsStaging)
                    {
                        loApp.UseHttpsRedirection();
                    }
                    using (var serviceScope = loApp.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())
                    {
                        var loContext = serviceScope.ServiceProvider.GetService<Heron.Data.DB.HeronContext>();
                        loContext.Database.EnsureCreated();
                        loContext.Database.Migrate();
                        var loContext2 = serviceScope.ServiceProvider.GetService<Heron.Data.DB.Extensions.IdentityExtend.DbContext>();
                        loContext2.Database.EnsureCreated();
                    }
                    if (loEnv.IsDevelopment())
                    {
                        loApp.UseDeveloperExceptionPage();
                    }
                    else
                    {
                        loApp.UseExceptionHandler("/Shared/Error");
                        loApp.UseHsts();
                    }
                    loApp.UseStatusCodePages(async context =>
                    {
                        context.HttpContext.Response.ContentType = "text/plain";
                        await context.HttpContext.Response.WriteAsync("Status code page, status code: " + context.HttpContext.Response.StatusCode);
                    });
                    loApp.UseStaticFiles();
                    loApp.UseSession();
                    loApp.UseAuthentication();
                    loApp.UseMvc(routes =>
                    {
                        routes.MapRoute(name: "dashboard", template: "{controller=Dashboard}/{action=Index}/{lsData}");
                        routes.MapRoute(name: "default", template: "{controller=Account}/{action=Index}/{lsMessage?}");
                    });
                    var supportedCultures = new[] { new CultureInfo("en-GB") };
                    loApp.UseRequestLocalization(new RequestLocalizationOptions
                    {
                        DefaultRequestCulture = new RequestCulture("en-GB"),
                        SupportedCultures = supportedCultures,
                        SupportedUICultures = supportedCultures
                    });
                }
                catch (Exception loException)
                {
                    Heron.Library.Classes.Utility.MakeExceptionMessage(loException, "\r\n", "Startup.Configure");
                }
            }
        }
    }

    Sunday, June 2, 2019 7:34 PM
  • User-1764593085 posted

    Hi hkdave95,

     This error started occurring the other day without a significant code change. No changes were made to the server, and only I have access.:

    It is hard to find out the problem, I suggest you to figure out which part of code you have changed.

    Another possible reason is that the request is timeout, make sure the database connection is correct.Refer to 

    https://stackoverflow.com/questions/48869489/asp-net-core-deployed-on-iis-returns-502-error-for-long-running-requests

    Besides,the localization middleware must be configured before any middleware which might check the request culture.

    Xing

    Monday, June 3, 2019 6:13 AM
  • User1424416479 posted

    Hi Xing

    Very hard to find out the problem, I agree.

    Now I think the following:

    1. I do not think it is a code change that is causing the issue.
    2. It is server problem, either IIS or server environment. Nothing here changed when Bad Gateway started. I was making code changes, however, the area of disturbance was not changed
    3.  The error is now ERR_CONNECTION_RESET. This happens when trying to redirect to another page.
    4. It happens when program is moving from unauthorized to authorized state.

    Any more help gratefully received.

    David

    Tuesday, June 4, 2019 10:27 AM
  • User475983607 posted

    hkdave95

    Hi Xing

    Very hard to find out the problem, I agree.

    Now I think the following:

    1. I do not think it is a code change that is causing the issue.
    2. It is server problem, either IIS or server environment. Nothing here changed when Bad Gateway started. I was making code changes, however, the area of disturbance was not changed
    3.  The error is now ERR_CONNECTION_RESET. This happens when trying to redirect to another page.
    4. It happens when program is moving from unauthorized to authorized state.

    Any more help gratefully received.

    David

    It is certainly a code problem.  I've had this error with an OAuth/OIDC app during a redirect.  My issue was related to certificate access.  I don't think you have the same problem. I found the error by running the application from the command line, as recommended above, and viewing the console.

    Again, if the application is hosting out-of-process then an error in the hosted app can certainly cause vague errors returning from IIS. 

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-2.2

    Tuesday, June 4, 2019 10:44 AM
  • User1424416479 posted

    Hi mgebhard

    Thank you for your reply.

    1. Local dev environment was hosting out of process / I have changed to in process to match the production environment.#
    2.  However, the in process version of local still does not reproduce.
    3. Surely if it was code and not server the issue would reproduce in both environments?

    Continuing to investigate.

    David

    Tuesday, June 4, 2019 12:16 PM
  • User475983607 posted

    Surely if it was code and not server the issue would reproduce in both environments?

    If I only had a nickel for every time a dev said those words...

    Tuesday, June 4, 2019 12:49 PM
  • User1424416479 posted

    :) I am still deliberating as to how to progress...

    Tuesday, June 4, 2019 12:52 PM
  • User1424416479 posted

    I have moved forward to making the project run outofprocess on the server.

    Now The project has ERR_CONNECTION_RESET immediately the url resolves. Instead of when logging in and redirecting.

    Tuesday, June 4, 2019 1:47 PM
  • User475983607 posted

    I have moved forward to making the project run outofprocess on the server.

    Now The project has ERR_CONNECTION_RESET immediately the url resolves. Instead of when logging in and redirecting.

    If you have the ability, run the web app using dotnet my.dll from the server.  

    Tuesday, June 4, 2019 1:51 PM
  • User1424416479 posted

    If you have the ability, run the web app using dotnet my.dll from the server.  

    Can run the exe created as part of the build or dotnet dll same difference.

    However, only listens on 5000 not https 5001. Trying to figure out how to make the project listen on 5001 SSL also...

    Tuesday, June 4, 2019 1:54 PM
  • User475983607 posted

    hkdave95

    Can run the exe created as part of the build or dotnet dll same difference.

    I have no idea what you're referring to "same difference".  If you have not done so, log in to the server and run dotnet yourApp.dll from the command line  Then open the app in your browser while viewing the console. I can't force you to try this troubleshooting step but I found this useful for finding overlooked configurations.  Of course this assumes you've configured logging for the environment.

    hkdave95

    However, only listens on 5000 not https 5001. Trying to figure out how to make the project listen on 5001 SSL also...

    Can you clarify?  The browser shows a security warning or there is no listener at all?

    Tuesday, June 4, 2019 2:31 PM
  • User1424416479 posted

    The exe and dotnet >dll< method of instantiating the app is the same.

    I did as you suggested but the app listens on 5000 http only, albeit successfully. No good as I require Https even on localhost. (See config). Config forces usage of https so I get a no go in browser when running localhost:5000.

    So now I am trying to make app listen on 5001 in order to run on https on the server.

    Having trouble with certificates at the moment.

    So, you see I am trying to do as you have suggested.

    Thank you so far.

    Tuesday, June 4, 2019 2:42 PM
  • User1424416479 posted

    The HTTP 431 Request Header Fields Too Large response status code indicates that the server is unwilling to process the request because its header fields are too large. ... It can be used when the total number of request header fields is too large, or when a single header field is too large.

    Getting the above error now...

    Googling a way forward.

    Tuesday, June 4, 2019 3:01 PM
  • User1424416479 posted

    Success got past the connection reset area.

    My Program.cs looks like the following now:

        public class Program
        {
            public static void Main(string[] args)
            {
                CreateWebHostBuilder(args).Build().Run();
            }
    
            public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
                WebHost.CreateDefaultBuilder(args)
                .UseKestrel(options =>
                {
                    options.Limits.MaxRequestHeadersTotalSize = 1048576;
                })
                .UseUrls("http://locahost:5000", "https://localhost:5001").UseStartup<Startup>();
        }

    Tuesday, June 4, 2019 3:08 PM
  • User1424416479 posted

    Update.

    1. Note: When I run off the proper Url upon clicking login the site throws a bad gateway error again, this is different from the ERR_CONNECTION_RESET error that was experienced recently.
    2. I can run the program off https://localhost:5001 without the error occurring so this is no help determining why the error is occurring. Possibly a certificate error based upon the live url?
    3. I am still thinking it is a server configuration issue, possibly certificate as previously mentioned.

    So I continue...

    David

    Wednesday, June 5, 2019 8:49 AM
  • User-1764593085 posted

    Hi hkdave95,

    Have you checked IIS event log , could you support logging to show detailed error messages if possible?

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/troubleshoot?view=aspnetcore-2.2

    Could you try to clear cookies in browser for the domain?

    Best Regards,

    Xing

    Wednesday, June 5, 2019 9:49 AM
  • User1424416479 posted

    The error below occurs before: An internal response header size limit was exceeded error occurs

    ModuleName
    AspNetCoreModuleV2

    Notification
    EXECUTE_REQUEST_HANDLER

    HttpStatus
    502

    HttpReason
    Bad Gateway

    HttpSubStatus
    3

    ErrorCode
    2147954582

    ConfigExceptionInfo

    Please excuse the formatting....

    Wednesday, June 5, 2019 10:13 AM
  • User1424416479 posted

    I SOLVED this issue.

    The solution involved removing a user claim (custom Identity user property) value which stored a image (avatar) against the user.

    When I removed that item the Header Size exceeded and Bad Gateway 502 problem went away.

    Moral of this story?

    Keep the user claim data within tolerance of the response header size.

    This issue caused me grief for more than a month.

    I continue to really enjoy coding and these sort of things keep me humble and right on!

    Hope this answer helps someone else.

    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 15, 2019 2:33 PM