{"record":{"id":"20c1080309b2021c","repo":"kopia/kopia","slug":"unable-to-read-symlink","errorCode":null,"errorMessage":"unable to read symlink","messagePattern":"unable to read symlink","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"snapshot/upload/upload.go","lineNumber":312,"sourceCode":"\tde.FileSize = written\n\n\tatomic.AddInt32(&u.stats.TotalFileCount, 1)\n\tatomic.AddInt64(&u.stats.TotalFileSize, de.FileSize)\n\n\treturn de, nil\n}\n\nfunc (u *Uploader) uploadSymlinkInternal(ctx context.Context, relativePath string, f fs.Symlink, metadataComp compression.Name) (dirEntry *snapshot.DirEntry, ret error) {\n\tu.Progress.HashingFile(relativePath)\n\n\tdefer func() {\n\t\tu.Progress.FinishedFile(relativePath, ret)\n\t}()\n\tdefer u.Progress.FinishedHashingFile(relativePath, f.Size())\n\n\ttarget, err := f.Readlink(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to read symlink\")\n\t}\n\n\twriter := u.repo.NewObjectWriter(ctx, object.WriterOptions{\n\t\tDescription:        \"SYMLINK:\" + f.Name(),\n\t\tMetadataCompressor: metadataComp,\n\t})\n\tdefer writer.Close() //nolint:errcheck\n\n\twritten, err := u.copyWithProgress(writer, bytes.NewBufferString(target))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr, err := writer.Result()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to get result\")\n\t}\n","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/snapshot/upload/upload.go#L294-L330","documentation":"Raised in uploadSymlinkInternal when fs.Symlink.Readlink fails while snapshotting a symlink: the OS returned an error reading the link target — commonly because the symlink is dangling in a way the filesystem reports (e.g. path-based walkers on Windows), the entry was deleted concurrently with the walk, or platform-specific readlink limitations. The relative path being uploaded identifies the faulting entry.","triggerScenarios":"Thrown at snapshot/upload/upload.go:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check whether the symlink still exists on disk and re-run the snapshot if it was transiently removed","On Windows, ensure Developer Mode is enabled or the process runs elevated so symlink information is accessible","Ignore symlink read errors via the uploader's ignore-permissions/readlier options when symlink targets are not required","Re-run with caching disabled if a stale directory cache points at since-deleted symlinks"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}