vue.jsasp.net-coreaxios

GET request are working but certain POST request resulting in net::ERR_CONNECTION_RESET


I have a strange error that is coming out of no where in my mind for myself in dev and production and also my users in production once deployed. I have a network error response which is new to me. My app has been in development for some time and it has been deployed to IIS for users to use. Well recently I switched from a Mac to a windows laptop (not sure if this has anything to do with it but full disclosure) and since I published a few minor updates a certain endpoint now receives net::ERR_CONNECTION_RESET for some uploads. It has me scratching my head because even locally when I am debugging this it is also doing it so its not a production issue. I really am not sure what to even post but here is my controller endpoint:

    [HttpPost("")]
    [Authorize]
    [OktaAllowedRoles(["end-user"])]
    [EnableRateLimiting("api")]
    public async Task<IActionResult> AddCertificationReviewAsync([FromForm] AddCertificationReviewDTO addCertificationReviewDTO)
    {
        try
        {
            var certificationReviewDTO = await _certificationReviewService.AddCertificationReviewAsync(addCertificationReviewDTO);
            return Ok(new ResponseDTO<CertificationReviewDTO>(){
                Succeeded = true,
                StatusCode = 200,
                Message = "The review has been successfully uploaded.",
                Data = certificationReviewDTO,
                Pagination = null});
        }
        catch(Exception ex)
        {
            return Ok("There was an issue adding the review. Please contact administrator.");
        } 
    }

I wish I had more information but this is just kind of coming out of no where and the only thing I can think is that its a windows issue and even in deployment this windows issue is carrying over now? Could it be on my front end? I use vuejs with vuetify. I have updated all of my packages and axios to ensure its not the frontend connection but I am unsure to be honest.

I have put a breakpoint at the top of the controller and its never hit. Its as if the frontend cannot find the backend for some requests although Get works every time and even some POST seem to be working too.

With some more breakpoints I do hit the top of the controller declaration so the controller does get a request but walking through it never makes it to the POST endpoint.

    protected ICertificationReviewService<CertificationReview> _certificationReviewService;
    public CertificationReviewController(IConfiguration configuration, ILogger<BaseController> logger, IHttpClientFactory httpClientFactory, ICertificationReviewService<CertificationReview> CertificationReviewService) : base(configuration, logger, httpClientFactory)
    {
        _certificationReviewService = CertificationReviewService;
    }

Solution

  • Your question is vague, therefore my answer will also be.

    Option 1) I would assume that you are uploading some large file with a combination that your internet connection is not fast and unstable. Maybe some VPN or other network switching. Thats the way how the browser gets network:reset.

    Option 2) The upload code breaks, the services quits, and the internal server proxy resets the connection.

    Try to replicate the production environment in your local machine using docker and debug it from there.