we-promise/sure · error · Property::AvmImport::Error

This property data provider is not configured.

Error message

This property data provider is not configured.

What it means

StandardError raised by QuestradeItem#import_latest_questrade_data when questrade_provider (from QuestradeItem::Provided, resolving the OAuth-linked Provider::Questrade record) returns nil — i.e., the item has no usable Questrade OAuth connection. The message comes from I18n (questrade_items.errors.provider_not_configured) and the failure is logged to the debug log (DebugLogEntry, category provider_sync_error) before raising. The blanket rescue below re-logs and re-raises, so sync jobs will surface it.

Source

Thrown at app/models/property/avm_import.rb:23

# data without a second request.
class Property::AvmImport
  Error = Class.new(StandardError)

  def initialize(family:, owner:, provider_key:, name:, address_attributes:)
    @family = family
    @owner = owner
    @provider_key = provider_key.to_s
    @name = name
    @address_attributes = address_attributes
  end

  # Step 1: validates the inputs, then spends one provider request. Returns
  # the fetched Provider::PropertyValuationConcept::PropertyValuation.
  def lookup
    validate_inputs!

    provider = Provider::Registry.for_concept(:property_valuations).get_provider(provider_key)
    raise Error.new(I18n.t("providers.property_valuation.not_configured")) if provider.nil?

    response = provider.fetch_property_valuation(
      line1: address_attributes[:line1],
      locality: address_attributes[:locality],
      region: address_attributes[:region],
      postal_code: address_attributes[:postal_code]
    )
    raise Error.new(response.error.message) unless response.success?

    response.data
  end

  # Step 2: creates the active property account from the user-confirmed
  # valuation data. No provider request is made here.
  def create_account(data)
    validate_inputs!

    account = nil

View on GitHub (pinned to e69894adb9)

Solutions

  1. Re-authenticate Questrade from the settings UI to recreate the provider connection
  2. Check the provider record exists for this family and its tokens can refresh (see DebugLogEntry provider_sync_error entries)
  3. Guard the sync job: skip items where questrade_provider nil instead of letting the job fail
  4. Cancel pending jobs for destroyed items (destroy_later sets scheduled_for_deletion — honor it before enqueueing)

Example fix

# before
QuestradeItem.find(id).import_latest_questrade_data(sync: sync)

# after
item = QuestradeItem.find(id)
if item.questrade_provider
  item.import_latest_questrade_data(sync: sync)
else
  Rails.logger.info("Skipping QuestradeItem #{id}: provider not configured")
end
Defensive patterns

Strategy: validation

Validate before calling

return if item.scheduled_for_deletion?
return Rails.logger.info("skip: questrade not configured") unless item.questrade_provider

Try / catch

begin
  item.import_latest_questrade_data(sync: sync)
rescue StandardError => e
  raise unless e.message == I18n.t("questrade_items.errors.provider_not_configured")
  sync&.update!(status: :error, status_text: "Questrade not connected — reconnect required")
end

Prevention

When it happens

Trigger: A sync job (Sync) firing for a QuestradeItem whose OAuth tokens were revoked, expired, or never completed; provider record deleted via settings; family lost its :questrade account_provider; race where the item is destroyed but a queued job still runs.

Common situations: User disconnects Questrade in settings while a scheduled sync is in flight; token refresh permanently failed earlier; staged environments lacking a real Questrade link; leftover job retries after account deletion.

Related errors


AI-assisted analysis of we-promise/sure@e69894adb9 (2026-08-21). Data as JSON: /api/errors/dd55b7162b9fbfa9. Report an issue: GitHub.