nopSolutions/nopCommerce · error · NopException
No response from the service
Error message
No response from the service
What it means
CreateTransaction calls ServiceClient.CreateTransaction(null, model) to compute or commit a tax transaction. The Avalara AvaTax REST client returned null instead of a TransactionModel, so the plugin throws because no tax data means the order's tax cannot be determined safely. This is the core tax-calculation entry point; a null here blocks checkout/invoice pricing.
Source
Thrown at src/Plugins/Nop.Plugin.Tax.Avalara/Services/AvalaraTaxManager.cs:230
await _logger.ErrorAsync($"{AvalaraTaxDefaults.SystemName} error. {errorMessage}", exception, await _workContext.GetCurrentCustomerAsync());
return (default, errorMessage);
}
}
#endregion
#region Tax calculation
/// <summary>
/// Create tax transaction
/// </summary>
/// <param name="model">Transaction details</param>
/// <returns>Created transaction</returns>
protected TransactionModel CreateTransaction(CreateTransactionModel model)
{
var transaction = ServiceClient.CreateTransaction(null, model)
?? throw new NopException("No response from the service");
//whether there are any errors
var errors = transaction.messages?.Where(m => !m.severity?.ToLower().Equals("success") ?? true).ToList() ?? [];
if (!errors.Any())
return transaction;
var message = errors.Aggregate(string.Empty, (error, message) => $"{error}{message.summary}{Environment.NewLine}");
throw new NopException(message);
}
/// <summary>
/// Prepare model to create a tax transaction
/// </summary>
/// <param name="address">Tax address</param>
/// <param name="customerCode">Customer code</param>
/// <param name="documentType">Transaction document type</param>
/// <returns>View on GitHub (pinned to 64bdf2ff08)
Solutions
- Verify AccountId and LicenseKey in the Avalara tax provider settings and confirm Sandbox/Production matches the account type.
- Inspect the TaxTransactionLog (written by OnCallCompleted) for the actual HTTP status code and response body of the failed CreateTransaction call.
- Ensure no proxy/firewall rewrites or strips the JSON response, and that rest.avatax.com is reachable.
- Validate the CreateTransactionModel before sending: non-empty companyCode, valid date, at least one line with a taxCode, and a resolved address.
- Upgrade the Avalara.AvaTax.RestClient NuGet package to the latest version compatible with the plugin.
Example fix
// before
var transaction = ServiceClient.CreateTransaction(null, model)
?? throw new NopException("No response from the service");
// after - log diagnostics and point to the transaction log
var transaction = ServiceClient.CreateTransaction(null, model);
if (transaction is null)
{
await _logger.ErrorAsync($"Avalara CreateTransaction returned null for company '{model?.companyCode}'. Check TaxTransactionLog for HTTP status.");
throw new NopException("No response from the service (see TaxTransactionLog)");
} Defensive patterns
Strategy: try-catch
Validate before calling
// Validate config and model before the call
if (string.IsNullOrEmpty(_avalaraTaxSettings.AccountId) || string.IsNullOrEmpty(_avalaraTaxSettings.LicenseKey))
throw new NopException("Tax provider is not configured");
if (model is null || string.IsNullOrEmpty(model.companyCode) || model.date == default)
throw new NopException("Invalid transaction model"); Try / catch
// CreateTransaction throws NopException on null or aggregated errors;
// wrap it so callers degrade gracefully (matches HandleFunctionAsync)
try
{
var tx = CreateTransaction(model);
return tx;
}
catch (NopException ex)
{
await _logger.ErrorAsync($"Avalara CreateTransaction failed: {ex.Message}", ex, await _workContext.GetCurrentCustomerAsync());
return null;
} Prevention
- Always configure AccountId and LicenseKey before invoking any tax call.
- Build the CreateTransactionModel with non-empty companyCode, a valid date, at least one line, and a resolved address.
- Surface the TaxTransactionLog to ops so failed calls can be diagnosed by HTTP status.
- Confirm Sandbox/Production matches the account before relying on live calculation.
When it happens
Trigger: ServiceClient.CreateTransaction(null, model) returns null. This happens when the AvaTax client receives a response it cannot deserialize into TransactionModel (empty body, HTML error page from a proxy, or an auth redirect) while the HTTP layer did not raise an AvaTaxError. A null is distinct from an AvaTaxError exception, which carries structured error info.
Common situations: Invalid or expired AccountId/LicenseKey producing a non-JSON 401/403; corporate proxy returning an HTML challenge page; Sandbox vs Production URL mismatch for the account; a malformed CreateTransactionModel (empty companyCode, missing/future date, null lines) that Avalara rejects in a way the client surfaces as null; an outdated Avalara.AvaTax.RestClient package.
Related errors
- {aggregated error summaries}
- Failed to delete customer
- Failed to get customer's certificates
- Failed to download certificate
- Failed to get invitation
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/143dd8b771d35c56.
Report an issue: GitHub.