{"record":{"id":"a1e88f3288164e23","repo":"apache/cassandra","slug":"file-doesn-t-exist","errorCode":null,"errorMessage":"File '' doesn't exist!","messagePattern":"File '' doesn't exist!","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java","lineNumber":82,"sourceCode":"        ratios = options.ops.ratios();\n        default_profile_name=null;\n\n\n        String yamlPath = options.profile.value();\n        profiles = new LinkedHashMap<>();\n\n        String[] yamlPaths = yamlPath.split(\",\");\n        for (String curYamlPath : yamlPaths)\n        {\n            File yamlFile = new File(curYamlPath);\n            URI yamlURI;\n            if (yamlFile.exists()) {\n            \tyamlURI = yamlFile.toURI();\n            } else {\n            \tyamlURI = URI.create(curYamlPath);\n            \tString uriScheme = yamlURI.getScheme();\n            \tif (uriScheme == null || \"file\".equals(uriScheme)) {\n                    throw new IllegalArgumentException(\"File '\" + yamlURI.getPath() + \"' doesn't exist!\");\n            \t}\n            }\n            StressProfile profile = StressProfile.load(yamlURI);\n            String specName = profile.specName;\n            if (default_profile_name == null) {default_profile_name=specName;} //first file is default\n            if (profiles.containsKey(specName))\n            {\n                throw new IllegalArgumentException(\"Must only specify a singe YAML file per table (including keyspace qualifier).\");\n            }\n            profiles.put(specName, profile);\n        }\n\n\n        if (ratios.size() == 0)\n            throw new IllegalArgumentException(\"Must specify at least one command with a non-zero ratio\");\n    }\n\n    public boolean hasInsertOnly()","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java#L64-L100","documentation":"SettingsCommandUser loads user-defined operation profiles from YAML files for the 'user' command. When a given path doesn't exist on disk, and its resolved URI has no scheme or a 'file' scheme, the constructor throws this IllegalArgumentException because the profile file cannot be read.","triggerScenarios":"Running 'cassandra-stress user profile=<path> ...' where <path> does not exist on the local filesystem (yamlFile.exists() is false) and the URI is file-based or scheme-less; an empty profile path also resolves to a file URI that doesn't exist.","commonSituations":"Typo in the profile filename; running from a different working directory than the script assumed; the YAML file deleted or not copied to the node/container; a relative path broken by shell expansion; passing a URL with a typo'd scheme so it resolves as a local file.","solutions":["Verify the file exists: run 'ls -l <path>' with the exact path passed to profile=.","Use an absolute path, e.g. profile=/opt/stress/myprofile.yaml, to avoid CWD surprises.","If using a URL, ensure the scheme is correct (http://...) so it isn't treated as a local file path.","Mount/copy the YAML into the container or node before running stress."],"exampleFix":"// before\ncassandra-stress user profile=./profie.yaml ops(insert=1)\n// after\ncassandra-stress user profile=/opt/stress/profile.yaml ops(insert=1)","handlingStrategy":"validation","validationCode":"File f = new File(path);\nif (!f.isFile()) throw new IllegalArgumentException(\"profile YAML not found: \" + f.getAbsolutePath());","typeGuard":null,"tryCatchPattern":"try { /* load profile */ } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"doesn't exist!\")) { System.err.println(\"Check profile path; cwd=\" + new File(\".\").getAbsolutePath()); } throw e; }","preventionTips":["Use absolute paths for profile= arguments.","Check file existence in scripts before invoking cassandra-stress.","Copy YAML profiles into containers/nodes as a provisioning step."],"tags":["cli","file","configuration"],"backgroundTag":"file-not-found","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}