{"record":{"id":"c1a6c5042817702c","repo":"Freika/dawarich","slug":"unsupported-source-source","errorCode":null,"errorMessage":"Unsupported source: %{source}","messagePattern":"Unsupported source: %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"app/services/imports/create.rb","lineNumber":116,"sourceCode":"\n    case source.to_s\n    when 'google_semantic_history'      then GoogleMaps::SemanticHistoryImporter\n    when 'google_phone_takeout'         then GoogleMaps::PhoneTakeoutImporter\n    when 'google_records'               then GoogleMaps::RecordsStorageImporter\n    when 'google_photos'                then GooglePhotos::Importer\n    when 'owntracks'                    then OwnTracks::Importer\n    when 'gpx'                          then Gpx::TrackImporter\n    when 'kml'                          then Kml::Importer\n    when 'geojson'                      then Geojson::Importer\n    when 'immich_api', 'photoprism_api' then Photos::Importer\n    when 'csv'                          then Csv::Importer\n    when 'tcx'                          then Tcx::Importer\n    when 'fit'                          then Fit::Importer\n    when 'polarsteps'                   then Polarsteps::Importer\n    when 'zip'\n      raise ArgumentError, I18n.t('services.imports.create.zip_unclassified')\n    else\n      raise ArgumentError, I18n.t('services.imports.create.unsupported_source', source:)\n    end\n  end\n\n  def update_import_points_count(import)\n    Import::UpdatePointsCountJob.perform_later(import.id)\n  end\n\n  def notify_if_all_skipped(import)\n    import.reload\n    return unless import.points.count.zero?\n\n    if import.doubles.to_i.positive?\n      I18n.with_locale(import.user.locale) do\n        Notification.create!(\n          user_id: import.user_id,\n          title: I18n.t('services.imports.create.import_completed_with_no_new_points'),\n          content: I18n.t('services.imports.create.your_file_name_contained_raw_points_points_all_of_which',\n                          name: import.name, raw_points: import.raw_points),","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/Freika/dawarich/blob/97fad417c5a11b0eb11157890635e015723a2e97/app/services/imports/create.rb#L98-L134","documentation":"ArgumentError raised by Imports::Create#importer when the import's source value matches none of the supported importer names (google_semantic_history, google_phone_takeout, google_records, google_photos, owntracks, gpx, kml, geojson, immich_api, photoprism_api, csv, tcx, fit, polarsteps). The case statement maps source names to importer classes and deliberately raises for unknown values instead of guessing. Note 'zip' is special-cased to the separate zip_unclassified error at line 114.","triggerScenarios":"An Import record whose source column holds a legacy or renamed value (e.g. an old 'google_timeline' string from an earlier Dawarich version), a source injected via console or API with a typo, or a detection result from a newer format this app version has no importer mapping for.","commonSituations":"Version skew after upgrading Dawarich (source names changed between releases), scripts or seeds creating Import rows with arbitrary source strings, or running an older app version against data produced by a newer one.","solutions":["Inspect the value: Import.find(id).source, and compare against the case list in app/services/imports/create.rb:99-117","Clear or correct the source column to a supported name so auto-detection re-runs","Update Dawarich to a version that maps this source name","Re-create the import without pinning source, letting SourceDetector pick it from file contents"],"exampleFix":"# before: import stuck failing with 'Unsupported source: google_timeline'\nimport.update!(source: 'google_timeline')\n\n# after: clear source so run_importer re-detects from the file\nimport.update!(source: nil)\nImports::Create.new(user, import.reload).call","handlingStrategy":"validation","validationCode":"SUPPORTED_SOURCES = %w[google_semantic_history google_phone_takeout google_records google_photos\n                        owntracks gpx kml geojson immich_api photoprism_api csv tcx fit polarsteps].freeze\n\nraise ArgumentError, \"unsupported source #{source.inspect}\" unless SUPPORTED_SOURCES.include?(source.to_s)","typeGuard":"def supported_source?(source)\n  %w[google_semantic_history google_phone_takeout google_records google_photos owntracks gpx kml geojson\n     immich_api photoprism_api csv tcx fit polarsteps].include?(source.to_s)\nend","tryCatchPattern":"begin\n  importer(source).new(import, user.id, path).call\nrescue ArgumentError => e\n  # surface to the user: which source value failed vs. the supported list\n  notify_user(\"#{e.message} - supported: #{SUPPORTED_SOURCES.join(', ')}\")\nend","preventionTips":["Never hand-set import.source; let SourceDetector populate it","Keep a single constant for supported sources and derive validation from the same list the case statement uses","After Dawarich upgrades, audit Import.distinct.pluck(:source) for orphaned values"],"tags":["import","source-routing","argument-error"],"backgroundTag":"unsupported-source-format","analyzedSha":"97fad417c5a11b0eb11157890635e015723a2e97","analyzedAt":"2026-08-21T17:04:17.778Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}