{"record":{"id":"143dd8b771d35c56","repo":"nopSolutions/nopCommerce","slug":"no-response-from-the-service","errorCode":null,"errorMessage":"No response from the service","messagePattern":"No response from the service","errorType":"exception","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Plugins/Nop.Plugin.Tax.Avalara/Services/AvalaraTaxManager.cs","lineNumber":230,"sourceCode":"            await _logger.ErrorAsync($\"{AvalaraTaxDefaults.SystemName} error. {errorMessage}\", exception, await _workContext.GetCurrentCustomerAsync());\n\n            return (default, errorMessage);\n        }\n    }\n\n    #endregion\n\n    #region Tax calculation\n\n    /// <summary>\n    /// Create tax transaction\n    /// </summary>\n    /// <param name=\"model\">Transaction details</param>\n    /// <returns>Created transaction</returns>\n    protected TransactionModel CreateTransaction(CreateTransactionModel model)\n    {\n        var transaction = ServiceClient.CreateTransaction(null, model)\n            ?? throw new NopException(\"No response from the service\");\n\n        //whether there are any errors\n        var errors = transaction.messages?.Where(m => !m.severity?.ToLower().Equals(\"success\") ?? true).ToList() ?? [];\n\n        if (!errors.Any())\n            return transaction;\n\n        var message = errors.Aggregate(string.Empty, (error, message) => $\"{error}{message.summary}{Environment.NewLine}\");\n        throw new NopException(message);\n    }\n\n    /// <summary>\n    /// Prepare model to create a tax transaction\n    /// </summary>\n    /// <param name=\"address\">Tax address</param>\n    /// <param name=\"customerCode\">Customer code</param>\n    /// <param name=\"documentType\">Transaction document type</param>\n    /// <returns>","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Plugins/Nop.Plugin.Tax.Avalara/Services/AvalaraTaxManager.cs#L212-L248","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nvar transaction = ServiceClient.CreateTransaction(null, model)\n    ?? throw new NopException(\"No response from the service\");\n\n// after - log diagnostics and point to the transaction log\nvar transaction = ServiceClient.CreateTransaction(null, model);\nif (transaction is null)\n{\n    await _logger.ErrorAsync($\"Avalara CreateTransaction returned null for company '{model?.companyCode}'. Check TaxTransactionLog for HTTP status.\");\n    throw new NopException(\"No response from the service (see TaxTransactionLog)\");\n}","handlingStrategy":"try-catch","validationCode":"// Validate config and model before the call\nif (string.IsNullOrEmpty(_avalaraTaxSettings.AccountId) || string.IsNullOrEmpty(_avalaraTaxSettings.LicenseKey))\n    throw new NopException(\"Tax provider is not configured\");\nif (model is null || string.IsNullOrEmpty(model.companyCode) || model.date == default)\n    throw new NopException(\"Invalid transaction model\");","typeGuard":null,"tryCatchPattern":"// CreateTransaction throws NopException on null or aggregated errors;\n// wrap it so callers degrade gracefully (matches HandleFunctionAsync)\ntry\n{\n    var tx = CreateTransaction(model);\n    return tx;\n}\ncatch (NopException ex)\n{\n    await _logger.ErrorAsync($\"Avalara CreateTransaction failed: {ex.Message}\", ex, await _workContext.GetCurrentCustomerAsync());\n    return null;\n}","preventionTips":["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."],"tags":["avalara","tax-calculation","null-response","network"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}