nopSolutions/nopCommerce · error · NopException

Tax provider is not configured

Error message

Tax provider is not configured

What it means

Thrown inside HandleFunctionAsync (the central wrapper for all AvalaraTaxManager operations) when IsConfigured returns false. This is the universal guard for every Avalara tax operation — it checks that the Avalara account credentials (Account ID, License Key, Company Code, and service URL) are present in settings. If unconfigured, no Avalara API call is attempted.

Source

Thrown at src/Plugins/Nop.Plugin.Tax.Avalara/Services/AvalaraTaxManager.cs:184

    }

    /// <summary>
    /// Handle function and get result
    /// </summary>
    /// <typeparam name="TResult">Result type</typeparam>
    /// <param name="function">Function</param>
    /// <param name="logErrors">Whether to log errors</param>
    /// <returns>
    /// A task that represents the asynchronous operation
    /// The task result contains the result; error if exists
    /// </returns>
    protected async Task<(TResult Result, string Error)> HandleFunctionAsync<TResult>(Func<Task<TResult>> function, bool logErrors = true)
    {
        try
        {
            //ensure that Avalara tax provider is configured
            if (!IsConfigured())
                throw new NopException("Tax provider is not configured");

            var result = await function();

            return (result, default);
        }
        catch (Exception exception)
        {
            if (!logErrors)
                return (default, exception.Message);

            //compose an error message
            var errorMessage = exception.Message;
            if (exception is AvaTaxError avaTaxError && avaTaxError.error != null)
            {
                var errorInfo = avaTaxError.error.error;
                if (errorInfo != null)
                {
                    errorMessage = $"{errorInfo.code} - {errorInfo.message}{Environment.NewLine}";

View on GitHub (pinned to 64bdf2ff08)

Solutions

  1. Configure Avalara credentials at Admin > Configuration > Tax Providers > Avalara > Configure with Account ID, License Key, Company Code, and Service URL
  2. Verify the tax provider is marked as active in Admin > Configuration > Tax Providers
  3. Test the connection from the configuration page to confirm credentials are valid
  4. Ensure settings are loaded from the correct store scope in multi-store deployments

Example fix

// before
var (result, error) = await _avalaraTaxManager.GetTaxResultAsync(order, settings);
if (!string.IsNullOrEmpty(error))
    _logger.Error(error);

// after — verify configuration before calling
if (string.IsNullOrEmpty(settings.AccountId) || string.IsNullOrEmpty(settings.LicenseKey))
{
    _logger.Warning("Avalara tax provider is not configured; tax calculation skipped");
    // fall back to standard nopCommerce tax calculation
    return await _fallbackTaxService.CalculateAsync(order);
}
var (result, error) = await _avalaraTaxManager.GetTaxResultAsync(order, settings);
Defensive patterns

Strategy: validation

Validate before calling

// Verify Avalara configuration before calling any AvalaraTaxManager method
if (string.IsNullOrEmpty(settings.AccountId) || string.IsNullOrEmpty(settings.LicenseKey)
    || string.IsNullOrEmpty(settings.CompanyCode))
{
    _logger.Warning("Avalara tax provider not configured; skipping tax calculation");
    return;
}

Try / catch

// HandleFunctionAsync catches internally; check the returned error tuple
var (result, error) = await _avalaraTaxManager.GetTaxResultAsync(order);
if (!string.IsNullOrEmpty(error) && error.Contains("not configured"))
{
    _logger.Warning($"Avalara not configured: {error}");
    // Fall back to standard nopCommerce tax calculation
    result = await _fallbackTaxService.CalculateAsync(order);
}

Prevention

When it happens

Trigger: Any AvalaraTaxManager method (tax calculation, address validation, tax code sync, commitment, etc.) is called through HandleFunctionAsync while AvalaraTaxSettings lacks required configuration fields. The wrapper catches the NopException and returns it as the Error string in the (Result, Error) tuple.

Common situations: Avalara plugin installed but not configured; settings were cleared or expired; sandbox-to-production migration left credentials blank; multi-store setup where the wrong store's settings are loaded; the tax provider was activated before configuration was completed.

Related errors


AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13). Data as JSON: /api/errors/ca891b55cf53868a. Report an issue: GitHub.