Admin Troubleshooting Guide

TABLE OF CONTENTS


Introduction

This document provides a step-by-step guide for troubleshooting the Znode 10 Admin development environment. It includes diagnostics for webstore service issues and resolution techniques for configuration, component, and content-related problems. This resource is intended to streamline debugging and resolution during local development.


This guide is divided into two primary sections:

  • Troubleshooting and issue history
  • Debugging for Znode Admin developers

Troubleshooting and Debugging (Development)

Local Environment Setup

Refer to the Z10 Admin - Setup Guide, Installation and Configuration for instructions on setting up the Znode Admin Console locally.

Tools Checklist

ToolPurpose
Visual StudioBreakpoints, Call Stack, Immediate Window
Browser DevToolsUI issues, console logs, network trace
PostmanAPI testing
dotPeekView hosted DLL code
SQL ProfilerTrack database queries
Fiddler/CharlesNetwork request tracing


Admin Troubleshooting Guidelines

Understand the Code Flow

The typical flow in the Admin module is as follows:

View (.cshtml) → Controller → Agent → Client → Endpoint → API Controller → Cache → Service/Repository → Database
  • View (.cshtml): UI interaction (e.g., clicking “Edit”)
  • Controller: Handles the request and logic
  • Agent: Middleware for business rules
  • Client: Makes API calls
  • Endpoint: Defines the route
  • API Controller: Handles HTTP and service interaction
  • Cache: Temporarily stores frequently accessed data
  • Service/Repository: Data access logic
  • Database: Permanent data store

Troubleshooting Steps by Layer

View Layer (.cshtml and CSS)

  • Model Binding: Ensure model is passed correctly
  • Rendering Issues: Confirm partial views and ViewBag usage
  • CSS Loading: Use DevTools → Network tab to verify .css load status
  • Missing Files: Check console for 404s

JavaScript Layer

  • Console Errors: Identify TypeError, undefined, or AJAX issues
  • Event Binding: Confirm event handlers like:
$(document).ready(function() {
  $('#btnSave').click(function() {
    console.log('Button clicked');
  });
});
  • AJAX Debugging:
$.ajax({
  url: '/Product/GetList',
  method: 'GET',
  success: function(data) { console.log(data); },
  error: function(xhr) { console.error(xhr.responseText); }
});

Controller (Admin Project)

  • Set breakpoints on action methods
  • Check ModelState.IsValid
  • Validate data passed to the view


Agent and Client

  • Ensure the correct methods and parameters are used
  • Use Visual Studio Watch window to inspect values

public ProductViewModel GetProduct(int productId) {
  return _client.Get<ProductViewModel>($"product/{productId}");
}

API Controller

  • Validate route configuration
  • Test using Postman with appropriate headers
[HttpGet]
[Route("product/{id}")]
public IHttpActionResult GetProduct(int id) {
  var product = _productService.GetProduct(id);
  return Ok(product);
}

Cache Layer

  • Temporarily clear the cache:
ZnodeCache.Clear("ProductList");
  • Debug whether cache updates correctly

Service/Repository Layer

  • Set breakpoints in service methods
  • Use SQL Profiler to trace query results
  • Check for NULLs and key mismatches

Production DLL Debugging (No Source Code)

  • Use dotPeek to decompile DLLs
  • Set <customErrors mode="Off" /> in web.config
  • Use Windows Event Viewer and Application Insights for logs

Debugging Sequence

  • UI: Check for rendering or JavaScript issues
  • Controller: Validate data receipt
  • Agent and Client: Ensure API calls are correct
  • API Controller: Test endpoint via Postman
  • Service Layer: Confirm correct data retrieval
  • Cache: Ensure no stale data
  • Production: Rely on logs and decompilation

Common Troubleshooting Scenarios

Routing and Endpoint Mismatches

Symptoms:

  • 404 Not Found in Postman
  • UI actions fail

Check attribute routing or RouteConfig.cs.

Form Submission Issues

  • Validate method="post" and action URL
  • Include anti-forgery tokens:

@Html.AntiForgeryToken()

Controller:

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult SaveProduct(ProductViewModel model)

Model Binding Failures

  • Ensure property names match model
  • Use browser Inspect tool to check input name attributes
  • Check ModelState.IsValid and enumerate errors

JavaScript File Conflicts

  • Avoid duplicate function definitions
  • Use the browser’s Source tab to detect overlapping scripts

Role-Based Access Troubleshooting

  • Confirm [Authorize(Roles = "Admin")]
  • Inspect claims:

var roles = HttpContext.User.Claims.Where(c => c.Type == ClaimTypes.Role).ToList();

Unhandled Exceptions

Wrap suspect blocks with try/catch:

try {
   // Code
} catch (Exception ex) {
    _logger.LogError("Error: " + ex.Message, ex);
}

Review logs: App_Data/logs/, Application Insights, or Serilog

Performance Bottlenecks

  • Use MiniProfiler or SQL Profiler
  • Optimize EF Core with AsNoTracking()
  • Avoid loading excess data

Cache Invalidation Issues

  • Confirm that cache keys are removed when expected
  • Validate expiration settings
  • Example:

_cache.Remove("ProductListCache");

Inspecting Live Site Without Source Code

  • Use dotPeek or ILSpy
  • Compare method and parameter names
  • Check HTML via browser DevTools
  • Review console logs

Debugging Multi-Step Workflows

Example: Product → Tax → Price → Save

  • Debug each step independently
  • Log ViewModel state transitions
  • Use hidden fields for continuity

Troubleshooting Checklist

  • API responds successfully in Postman?
  • ViewModel is populated correctly?
  • JavaScript functions as expected?
  • Logs are captured and readable?
  • Cache invalidated where applicable?
  • End-to-end controller flow validated?
  • Role-based permissions functioning?
  • Hosted logs reviewed in UAT/production?

Client Issues History

Issue DescriptionTroubleshooting SummaryTypeResolution
Container Widget cannot be configured from CMSIssue traced to missing production imageProduction ImageDeploy correct image
Brand images missing after importCSV missing BrandLogo fieldData mismatchCorrected CSV format
Page Builder keeps loadingChange set not deployed in PR environmentProduction ImageMerged change set to correct env
Selected Catalog not saving for AccountsDefault catalog condition missing in codeData update issueCode updated
“Save for Preview” removes widgetsIncorrect Page Builder Application URLConfiguration issueUpdated to correct QA URL

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.