{"record":{"id":"92113efb2c9b989e","repo":"nektos/act","slug":"unable-to-readlink-s-w","errorCode":null,"errorMessage":"unable to readlink '%s': %w","messagePattern":"unable to readlink '(.+?)': %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/filecollector/file_collector.go","lineNumber":181,"sourceCode":"\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tif err == nil && entry.Mode == filemode.Submodule {\n\t\t\terr = fc.Fs.Walk(file, fc.CollectFiles(ctx, split))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn filepath.SkipDir\n\t\t}\n\t\tpath := filepath.ToSlash(sansPrefix)\n\n\t\t// return on non-regular files (thanks to [kumo](https://medium.com/@komuw/just-like-you-did-fbdd7df829d3) for this suggested update)\n\t\tif fi.Mode()&os.ModeSymlink == os.ModeSymlink {\n\t\t\tlinkName, err := fc.Fs.Readlink(file)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to readlink '%s': %w\", file, err)\n\t\t\t}\n\t\t\treturn fc.Handler.WriteFile(path, fi, linkName, nil)\n\t\t} else if !fi.Mode().IsRegular() {\n\t\t\treturn nil\n\t\t}\n\n\t\t// open file\n\t\tf, err := fc.Fs.Open(file)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer f.Close()\n\n\t\tif ctx != nil {\n\t\t\t// make io.Copy cancellable by closing the file\n\t\t\tcpctx, cpfinish := context.WithCancel(ctx)\n\t\t\tdefer cpfinish()\n\t\t\tgo func() {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/filecollector/file_collector.go#L163-L199","documentation":"Returned when the billy filesystem's Readlink call fails while FileCollector processes a symlink encountered during the workspace walk. The error wraps the underlying OS/filesystem error and names the offending path, so the root cause (permission, dangling symlink, unsupported FS) is visible in %w.","triggerScenarios":"The walked tree contains a symlink that the filesystem implementation cannot read: a dangling symlink on a filesystem that disallows it, permission-restricted symlink targets, or a chroot/billy test FS whose Readlink is unimplemented for that path.","commonSituations":"Workspaces with broken symlinks (node_modules/.bin entries pointing at missing binaries), bind-mounted volumes with weird link semantics, or unit tests using in-memory filesystems that return errors from Readlink.","solutions":["Run `find . -xtype l` in the workspace to locate dangling symlinks and fix or delete them.","Check permissions on the symlink and its parent directory if running under a restricted user/container.","Exclude the offending directory from collection (move it out of SrcPath or add ignore rules) if it is not needed inside the container."],"exampleFix":"# locate broken symlinks before running act\nfind . -xtype l -print\ndelete_or_fix_each_of_them","handlingStrategy":"validation","validationCode":"// before running act, verify no dangling symlinks exist in the workspace\nerr := filepath.Walk(src, func(p string, fi os.FileInfo, err error) error {\n    if err == nil && fi.Mode()&os.ModeSymlink != 0 {\n        if _, e := os.Readlink(p); e != nil { return fmt.Errorf(\"bad link %s: %w\", p, e) }\n    }\n    return nil\n})","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"unable to readlink\") {\n    // report the named path, fix or remove the symlink, then retry the run\n}","preventionTips":["Run `find . -xtype l` as a pre-flight check in CI before invoking act.","Avoid committing broken node_modules/.bin-style links; regenerate them instead.","Keep the workspace on a native filesystem, not a restrictive FUSE mount, when collecting files."],"tags":["symlink","filecollector","filesystem","workspace"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}