{"record":{"id":"fa4d0513f7736276","repo":"alibaba/arthas","slug":"time-fragment-index-is-expected-please-type-i-to","errorCode":null,"errorMessage":"Time fragment index is expected, please type -i to specify","messagePattern":"Time fragment index is expected, please type -i to specify","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java","lineNumber":255,"sourceCode":"    static String validateSizeLimit(Integer sizeLimit) {\n        if (sizeLimit != null && sizeLimit.intValue() <= 0) {\n            return \"sizeLimit must be greater than 0.\";\n        }\n        return null;\n    }\n\n    /**\n     * 检查参数是否合法\n     */\n    private void checkArguments() {\n        String validateError = validateSizeLimit(sizeLimit);\n        if (validateError != null) {\n            throw new IllegalArgumentException(validateError);\n        }\n\n        // 检查d/p参数是否有i参数配套\n        if ((isDelete || isPlay) && null == index) {\n            throw new IllegalArgumentException(\"Time fragment index is expected, please type -i to specify\");\n        }\n\n        // 在t参数下class-pattern,method-pattern\n        if (isTimeTunnel) {\n            if (StringUtils.isEmpty(classPattern)) {\n                throw new IllegalArgumentException(\"Class-pattern is expected, please type the wildcard expression to match\");\n            }\n            if (StringUtils.isEmpty(methodPattern)) {\n                throw new IllegalArgumentException(\"Method-pattern is expected, please type the wildcard expression to match\");\n            }\n        }\n\n        // 一个参数都没有是不行滴\n        if (null == index && !isTimeTunnel && !isDeleteAll && StringUtils.isEmpty(watchExpress)\n                && !isList && StringUtils.isEmpty(searchExpress)) {\n            throw new IllegalArgumentException(\"Argument(s) is/are expected, type 'help tt' to read usage\");\n        }\n    }","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java#L237-L273","documentation":"Thrown by checkArguments() in the `tt` command when a delete (-d) or play/replay (-p) action is requested but no time fragment index (-i) is supplied. Each recorded time fragment is identified by an integer index; you must specify which one to delete or replay.","triggerScenarios":"Running `tt -d` or `tt -p` without `-i <index>`, e.g. `tt -d` alone, or `tt -p --replay-times 2` without the index.","commonSituations":"Forgetting the -i index; assuming -d deletes all (use -D/--delete-all for that); index variable left null in a script.","solutions":["Add `-i <index>` where <index> is the time fragment id shown by `tt -l`.","Run `tt -l` first to list recorded fragments and their indices.","To delete all fragments use the delete-all option instead of -d."],"exampleFix":"// before\ntt -d\n// after\ntt -i 1000 -d","handlingStrategy":"validation","validationCode":"if ((isDelete || isPlay) && index == null) {\n    fail(\"-d/-p require -i <index>\");\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Always pair -d/-p with -i <index>.","List fragments first with `tt -l` to find the index."],"tags":["arthas","tt-command","required-argument","input-validation"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}