{"record":{"id":"8b12aa4e13bd4d9f","repo":"wavetermdev/waveterm","slug":"recursive-directory-listings-are-not-supported","errorCode":null,"errorMessage":"recursive directory listings are not supported","messagePattern":"recursive directory listings are not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshremote/wshremote_file.go","lineNumber":225,"sourceCode":"\t\t\tpanichandler.PanicHandler(\"RemoteListEntriesCommand\", recover())\n\t\t}()\n\t\tdefer close(ch)\n\t\tpath, err := wavebase.ExpandHomeDir(data.Path)\n\t\tif err != nil {\n\t\t\tch <- wshutil.RespErr[wshrpc.CommandRemoteListEntriesRtnData](err)\n\t\t\treturn\n\t\t}\n\t\tif data.Opts == nil {\n\t\t\tdata.Opts = &wshrpc.FileListOpts{}\n\t\t}\n\t\tinnerFilesEntries := []os.DirEntry{}\n\t\tseen := 0\n\t\tif data.Opts.Limit == 0 {\n\t\t\tdata.Opts.Limit = wshrpc.MaxDirSize\n\t\t}\n\t\tif data.Opts.All {\n\t\t\tif DisableRecursiveFileOpts {\n\t\t\t\tch <- wshutil.RespErr[wshrpc.CommandRemoteListEntriesRtnData](fmt.Errorf(\"recursive directory listings are not supported\"))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfs.WalkDir(os.DirFS(path), \".\", func(path string, d fs.DirEntry, err error) error {\n\t\t\t\tdefer func() {\n\t\t\t\t\tseen++\n\t\t\t\t}()\n\t\t\t\tif seen < data.Opts.Offset {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif seen >= data.Opts.Offset+data.Opts.Limit {\n\t\t\t\t\treturn io.EOF\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif d.IsDir() {\n\t\t\t\t\treturn nil\n\t\t\t\t}","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshremote/wshremote_file.go#L207-L243","documentation":"RemoteListEntriesCommand rejects requests with Opts.All=true when DisableRecursiveFileOpts is set, because recursive directory walking is not permitted in this server configuration. The command returns a RespErr on the channel instead of performing fs.WalkDir.","triggerScenarios":"Calling RemoteListEntriesCommand with {All: true} on a server where DisableRecursiveFileOpts is enabled.","commonSituations":"Client built assuming recursive listing support; server started with recursion disabled (e.g. for security/performance on remote hosts); version change where the option became restrictable.","solutions":["Set Opts.All=false and iterate directories manually with per-directory calls.","Enable recursive listings on the server by clearing DisableRecursiveFileOpts if policy allows.","Handle the RespErr on the channel gracefully and fall back to non-recursive listing."],"exampleFix":"// before\nentries := wshclient.RemoteListEntriesCommand(ctx, wshrpc.CommandRemoteListEntriesData{Path: dir, Opts: wshrpc.FileListOpts{All: true}}, nil)\n// after\nentries := wshclient.RemoteListEntriesCommand(ctx, wshrpc.CommandRemoteListEntriesData{Path: dir, Opts: wshrpc.FileListOpts{All: false}}, nil)","handlingStrategy":"validation","validationCode":"if opts.All && recursiveDisabled {\n    // fall back to manual per-directory traversal\n    opts.All = false\n}","typeGuard":null,"tryCatchPattern":"for item := range ch {\n    if item.Error != nil {\n        if strings.Contains(item.Error.Error(), \"recursive directory listings\") {\n            return listNonRecursive(ctx, dir)\n        }\n        return item.Error\n    }\n}","preventionTips":["Feature-detect recursive support before using Opts.All","Prefer explicit per-directory walks for portability","Document server config that disables recursion"],"tags":["filesystem","directory-listing","configuration","unsupported-feature"],"backgroundTag":"recursive-listing-unsupported","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}