{"record":{"id":"dd55b7162b9fbfa9","repo":"we-promise/sure","slug":"this-property-data-provider-is-not-configured","errorCode":null,"errorMessage":"This property data provider is not configured.","messagePattern":"This property data provider is not configured\\.","errorType":"exception","errorClass":"Property::AvmImport::Error","httpStatus":null,"severity":"error","filePath":"app/models/property/avm_import.rb","lineNumber":23,"sourceCode":"# data without a second request.\nclass Property::AvmImport\n  Error = Class.new(StandardError)\n\n  def initialize(family:, owner:, provider_key:, name:, address_attributes:)\n    @family = family\n    @owner = owner\n    @provider_key = provider_key.to_s\n    @name = name\n    @address_attributes = address_attributes\n  end\n\n  # Step 1: validates the inputs, then spends one provider request. Returns\n  # the fetched Provider::PropertyValuationConcept::PropertyValuation.\n  def lookup\n    validate_inputs!\n\n    provider = Provider::Registry.for_concept(:property_valuations).get_provider(provider_key)\n    raise Error.new(I18n.t(\"providers.property_valuation.not_configured\")) if provider.nil?\n\n    response = provider.fetch_property_valuation(\n      line1: address_attributes[:line1],\n      locality: address_attributes[:locality],\n      region: address_attributes[:region],\n      postal_code: address_attributes[:postal_code]\n    )\n    raise Error.new(response.error.message) unless response.success?\n\n    response.data\n  end\n\n  # Step 2: creates the active property account from the user-confirmed\n  # valuation data. No provider request is made here.\n  def create_account(data)\n    validate_inputs!\n\n    account = nil","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/we-promise/sure/blob/e69894adb92547273377398c15f45c979cd9416a/app/models/property/avm_import.rb#L5-L41","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-authenticate Questrade from the settings UI to recreate the provider connection","Check the provider record exists for this family and its tokens can refresh (see DebugLogEntry provider_sync_error entries)","Guard the sync job: skip items where questrade_provider nil instead of letting the job fail","Cancel pending jobs for destroyed items (destroy_later sets scheduled_for_deletion — honor it before enqueueing)"],"exampleFix":"# before\nQuestradeItem.find(id).import_latest_questrade_data(sync: sync)\n\n# after\nitem = QuestradeItem.find(id)\nif item.questrade_provider\n  item.import_latest_questrade_data(sync: sync)\nelse\n  Rails.logger.info(\"Skipping QuestradeItem #{id}: provider not configured\")\nend","handlingStrategy":"validation","validationCode":"return if item.scheduled_for_deletion?\nreturn Rails.logger.info(\"skip: questrade not configured\") unless item.questrade_provider","typeGuard":null,"tryCatchPattern":"begin\n  item.import_latest_questrade_data(sync: sync)\nrescue StandardError => e\n  raise unless e.message == I18n.t(\"questrade_items.errors.provider_not_configured\")\n  sync&.update!(status: :error, status_text: \"Questrade not connected — reconnect required\")\nend","preventionTips":["Check questrade_provider presence before enqueueing or running sync jobs","Cancel queued jobs when the provider is disconnected or item marked scheduled_for_deletion","Watch DebugLogEntry provider_sync_error entries to catch revoked tokens early","Prompt users to re-authenticate when tokens stop refreshing"],"tags":["questrade","oauth","provider-not-configured","sync","brokerage"],"backgroundTag":"provider-not-configured","analyzedSha":"e69894adb92547273377398c15f45c979cd9416a","analyzedAt":"2026-08-21T18:22:41.165Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}