{"record":{"id":"9151c70bc3260d1d","repo":"syncthing/syncthing","slug":"download-w","errorCode":null,"errorMessage":"download: %w","messagePattern":"download: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/geoip/geoip.go","lineNumber":86,"sourceCode":"// when the context is canceled.\nfunc (p *Provider) Serve(ctx context.Context) error {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\n\t\tcase <-time.After(p.refreshInterval):\n\t\t\tif err := p.download(ctx); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (p *Provider) download(ctx context.Context) error {\n\tnewSubdir, err := os.MkdirTemp(p.directory, \"geoipupdate\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"download: %w\", err)\n\t}\n\n\tcfg := &geoipupdate.Config{\n\t\tURL:               \"https://updates.maxmind.com\",\n\t\tDatabaseDirectory: newSubdir,\n\t\tLockFile:          filepath.Join(newSubdir, \"geoipupdate.lock\"),\n\t\tRetryFor:          5 * time.Minute,\n\t\tParallelism:       1,\n\t\tAccountID:         p.accountID,\n\t\tLicenseKey:        p.licenseKey,\n\t\tEditionIDs:        []string{p.edition},\n\t}\n\n\tif err := geoipupdate.NewClient(cfg).Run(ctx); err != nil {\n\t\treturn fmt.Errorf(\"download: %w\", err)\n\t}\n\n\tdbPath := filepath.Join(newSubdir, p.edition+\".mmdb\")","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/syncthing/syncthing/blob/058bcd7334839663cf569501d3ac539034d45cb5/lib/geoip/geoip.go#L68-L104","documentation":"The GeoIP provider failed before downloading: os.MkdirTemp(p.directory, \"geoipupdate\") could not create a scratch directory under the configured database directory. The mkdir error is wrapped; the provider loop returns and geo lookups keep using the old (or no) database.","triggerScenarios":"The database directory does not exist, is not writable by the process (EACCES/EROFS), the disk is full (ENOSPC), or the path is not a directory (ENOTDIR).","commonSituations":"GeoIP enabled in config but the data directory was removed or never created; Syncthing running as a service user without write access to the state dir; read-only container filesystem.","solutions":["Create the configured GeoIP directory and chown it to the Syncthing user.","Free disk space or remount read-write.","Point the provider at a writable directory in the GUI/config, or disable the GeoIP feature if unwanted."],"exampleFix":"mkdir -p /var/lib/syncthing/geoip && chown syncthing: /var/lib/syncthing/geoip","handlingStrategy":"validation","validationCode":"if err := os.MkdirAll(dbDir, 0o755); err != nil { return err }\nif err := unix.Access(dbDir, unix.W_OK); err != nil { return fmt.Errorf(\"db dir not writable: %w\", err) }","typeGuard":null,"tryCatchPattern":"if err := p.download(ctx); err != nil {\n    if errors.Is(err, fs.ErrPathNotFound) || strings.Contains(err.Error(), \"no such file\") {\n        os.MkdirAll(p.directory, 0o755) // self-heal once, then retry next cycle\n    }\n    log.Warnf(\"geoip download failed, keeping old db: %v\", err)\n}","preventionTips":["Create and chown the GeoIP data directory at install time.","Monitor free disk space on the state partition."],"tags":["geoip","permissions","disk-space"],"backgroundTag":null,"analyzedSha":"058bcd7334839663cf569501d3ac539034d45cb5","analyzedAt":"2026-08-15T07:53:43.174Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}