{"record":{"id":"8fed490b4f258e00","repo":"immich-app/immich","slug":"geodata-file-cities500-not-found","errorCode":null,"errorMessage":"Geodata file ${cities500} not found","messagePattern":"Geodata file (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/src/repositories/map.repository.ts","lineNumber":272,"sourceCode":"                )`.execute(manager);\n      await manager.schema.dropTable('geodata_places').execute();\n      await manager.schema.alterTable('geodata_places_tmp').renameTo('geodata_places').execute();\n    });\n    await this.db.schema\n      .createIndex('IDX_geodata_gist_earthcoord')\n      .on('geodata_places')\n      .using('gist')\n      .expression(sql`ll_to_earth_public(latitude, longitude)`)\n      .execute();\n    await this.loadCities500(admin1, admin2);\n    await this.createGeodataIndices();\n  }\n\n  private async loadCities500(admin1Map: Map<string, string>, admin2Map: Map<string, string>) {\n    const { resourcePaths } = this.configRepository.getEnv();\n    const cities500 = resourcePaths.geodata.cities500;\n    if (!existsSync(cities500)) {\n      throw new Error(`Geodata file ${cities500} not found`);\n    }\n\n    this.logger.log(`Starting geodata import`);\n    const startTime = performance.now();\n\n    const input = createReadStream(cities500, { highWaterMark: 512 * 1024 * 1024 });\n    let bufferGeodata = [];\n    const lineReader = readLine.createInterface({ input });\n    let count = 0;\n\n    let futures = [];\n    for await (const line of lineReader) {\n      const lineSplit = line.split('\\t');\n      if ((lineSplit[7] === 'PPLX' && lineSplit[8] !== 'AU') || lineSplit[7] === 'PPLH') {\n        continue;\n      }\n\n      const geoData = {","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/repositories/map.repository.ts#L254-L290","documentation":"During geodata import (loadCities500), Immich resolves resourcePaths.geodata.cities500 and checks existsSync(cities500). If the file is missing it throws Error('Geodata file <path> not found') before attempting the stream import. The cities500 dataset is required to populate the places/geocoding feature.","triggerScenarios":"Triggering the geodata import (map/geocoding bootstrap) when the packaged cities500.txt is absent from the build geodata resource folder.","commonSituations":"Broken/incomplete build or container image missing the geodata bundle; custom IMMICH_BUILD_DATA/resource path pointing to a folder without the file; geodata download step skipped during image build.","solutions":["Use the official Immich image which bundles the geodata file, or run the documented geodata-fetch build step.","Verify resourcePaths.geodata.cities500 resolves to an existing file (check IMMICH_BUILD_DATA).","Place cities500.txt in the expected geodata directory and re-run the import."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nconst cities500 = resolveGeodataPath('cities500');\nif (!existsSync(cities500)) {\n  throw new Error(`Geodata file missing: ${cities500}; rebuild image with geodata bundle.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the official image which bundles cities500.","In custom images, run the geodata-fetch build step and assert the file exists.","Verify IMMICH_BUILD_DATA points to the folder containing the geodata bundle."],"tags":["map","geodata","filesystem","startup","resources"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}