nopSolutions/nopCommerce · critical · NopException
UPS shipping service. Could not load 'inches' measure dimens
Error message
UPS shipping service. Could not load 'inches' measure dimension (used to find limits)
What it means
Thrown at the start of GetRatesAsync when the 'inches' measure dimension cannot be loaded. This is required internally by the UPS plugin to compute package size limits regardless of the configured DimensionsType. Without it, dimensional limits for UPS rate calculation are unavailable.
Source
Thrown at src/Plugins/Nop.Plugin.Shipping.UPS/Services/UPSService.cs:985
/// <returns>
/// A task that represents the asynchronous operation
/// The task result contains the represents a response of getting shipping rate options
/// </returns>
public virtual async Task<GetShippingOptionResponse> GetRatesAsync(GetShippingOptionRequest shippingOptionRequest)
{
var weightSystemName = _upsSettings.WeightType switch { "LBS" => "lb", "KGS" => "kg", _ => null };
_measureWeight = await _measureService.GetMeasureWeightBySystemKeywordAsync(weightSystemName)
?? throw new NopException($"UPS shipping service. Could not load \"{weightSystemName}\" measure weight");
_lbWeight = await _measureService.GetMeasureWeightBySystemKeywordAsync("lb")
?? throw new NopException($"UPS shipping service. Could not load 'lb' measure weight (used to find limits)");
var dimensionSystemName = _upsSettings.DimensionsType switch { "IN" => "inches", "CM" => "centimeters", _ => null };
_measureDimension = await _measureService.GetMeasureDimensionBySystemKeywordAsync(dimensionSystemName)
?? throw new NopException($"UPS shipping service. Could not load \"{dimensionSystemName}\" measure dimension");
_inchesDimension = await _measureService.GetMeasureDimensionBySystemKeywordAsync("inches")
?? throw new NopException($"UPS shipping service. Could not load 'inches' measure dimension (used to find limits)");
var response = new GetShippingOptionResponse();
//get regular rates
var (shippingOptions, error) = await GetShippingOptionsAsync(shippingOptionRequest);
response.ShippingOptions = shippingOptions;
if (!string.IsNullOrEmpty(error))
response.Errors.Add(error);
//get rates for Saturday delivery
if (_upsSettings.SaturdayDeliveryEnabled)
{
var (saturdayShippingOptions, saturdayError) = await GetShippingOptionsAsync(shippingOptionRequest, true);
foreach (var shippingOption in saturdayShippingOptions)
response.ShippingOptions.Add(shippingOption);
if (!string.IsNullOrEmpty(saturdayError))
response.Errors.Add(saturdayError);
}View on GitHub (pinned to 64bdf2ff08)
Solutions
- Recreate the 'inches' measure dimension at Admin > Configuration > Measures with system keyword 'inches'
- Verify the measure dimension is active with a valid ratio to the primary dimension
- Run nopCommerce database seed to restore default measure dimension records
- Note: the UPS plugin requires 'inches' to exist for internal size limit calculations even if DimensionsType is set to 'CM'
Example fix
// before
var response = await _upsService.GetRatesAsync(request);
// after — ensure required dimension exists
var inchesDim = await _measureService.GetMeasureDimensionBySystemKeywordAsync("inches");
if (inchesDim is null)
throw new InvalidOperationException("Measure dimension 'inches' is required by UPS plugin. Restore it in Admin > Measures.");
var response = await _upsService.GetRatesAsync(request); Defensive patterns
Strategy: validation
Validate before calling
// Verify the 'inches' measure dimension exists (required by UPS for limit calculations)
var inchesDim = await _measureService.GetMeasureDimensionBySystemKeywordAsync("inches");
if (inchesDim is null)
throw new InvalidOperationException("UPS requires measure dimension 'inches' for limit calculations. Restore it in Admin > Configuration > Measures."); Try / catch
// UPS errors throw directly; caller must catch
try
{
var response = await _upsService.GetRatesAsync(request);
}
catch (NopException ex) when (ex.Message.Contains("'inches'"))
{
_logger.Error($"UPS requires 'inches' measure dimension: {ex.Message}");
return ErrorResult("Shipping rates unavailable — measure configuration required");
} Prevention
- The UPS plugin requires 'inches' to exist even if the store uses centimeters — do not delete it
- Run a startup health check for required measure dimensions when UPS shipping is active
- Include measure dimension records in any database export/import or migration
- Add an admin warning when attempting to delete 'inches' while the UPS plugin is active
When it happens
Trigger: GetMeasureDimensionBySystemKeywordAsync('inches') returns null, meaning the 'inches' measure dimension record was deleted or never created. This check runs after the primary DimensionsType dimension check.
Common situations: Measure dimension 'inches' was manually deleted; a metric-only deployment removed imperial dimension records; database was reset without re-seeding measure data; system keyword was changed from 'inches' to a custom value.
Related errors
- UPS shipping service. Could not load "{dimensionSystemName}"
- UPS shipping service. Could not load "{weightSystemName}" me
- UPS shipping service. Could not load 'lb' measure weight (us
- Client ID is not set
- Client secret is not set
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/4b90236159f50a46.
Report an issue: GitHub.