{"record":{"id":"442d36e677262c4b","repo":"uutils/coreutils","slug":"reading-cyclic-directory","errorCode":null,"errorMessage":"Reading cyclic directory","messagePattern":"Reading cyclic directory","errorType":"exception","errorClass":"uucore::error::Error","httpStatus":null,"severity":"error","filePath":"src/uu/chcon/src/chcon.rs","lineNumber":593,"sourceCode":"                // this file, tell fts_read to stat it \"again\".\n                if entry.level() == 0 && entry.number() == 0 {\n                    entry.set_number(1);\n                    let _ignored = fts.set(fts_sys::FTS_AGAIN);\n                    return Ok(());\n                }\n\n                result = fts_err(translate!(\"chcon-op-accessing\"));\n            }\n\n            fts_sys::FTS_ERR => result = fts_err(translate!(\"chcon-op-accessing\")),\n\n            fts_sys::FTS_DNR => result = fts_err(translate!(\"chcon-op-reading-directory\")),\n\n            fts_sys::FTS_DC\n                if cycle_warning_required(options.recursive_mode.fts_open_options(), &entry) =>\n            {\n                emit_cycle_warning(&file_full_name);\n                return Err(err(\n                    translate!(\"chcon-op-reading-cyclic-directory\"),\n                    io::ErrorKind::InvalidData,\n                ));\n            }\n\n            _ => {}\n        }\n\n        if entry.flags() == fts_sys::FTS_DP\n            && result.is_ok()\n            && root_dev_ino_check(root_dev_ino, file_dev_ino)\n        {\n            root_dev_ino_warn(&file_full_name);\n            result = Err(err(\n                translate!(\"chcon-op-modifying-root-path\"),\n                io::ErrorKind::PermissionDenied,\n            ));\n        }","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/uutils/coreutils/blob/0b77ced48502a5f80c51dfa827af7e69f3687053/src/uu/chcon/src/chcon.rs#L575-L611","documentation":"Error \"Reading cyclic directory\" thrown in uutils/coreutils.","triggerScenarios":"Occurs when chcon recursion detects a directory cycle, e.g. via bind mounts or symlinks.","commonSituations":"Recursing with -R through directory structures containing loops.","solutions":["Remove the directory cycle (symlink loop or bind mount loop) before recursing.","Use options that do not follow symbolic links, e.g. chcon without -L/-H dereferencing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0b77ced48502a5f80c51dfa827af7e69f3687053","analyzedAt":"2026-08-19T21:43:27.871Z","contentChangedAt":"2026-08-19T21:43:27.871Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}