apache/cassandra · error · IllegalArgumentException

File '' doesn't exist!

Error message

File '' doesn't exist!

What it means

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.

Source

Thrown at tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java:82

        ratios = options.ops.ratios();
        default_profile_name=null;


        String yamlPath = options.profile.value();
        profiles = new LinkedHashMap<>();

        String[] yamlPaths = yamlPath.split(",");
        for (String curYamlPath : yamlPaths)
        {
            File yamlFile = new File(curYamlPath);
            URI yamlURI;
            if (yamlFile.exists()) {
            	yamlURI = yamlFile.toURI();
            } else {
            	yamlURI = URI.create(curYamlPath);
            	String uriScheme = yamlURI.getScheme();
            	if (uriScheme == null || "file".equals(uriScheme)) {
                    throw new IllegalArgumentException("File '" + yamlURI.getPath() + "' doesn't exist!");
            	}
            }
            StressProfile profile = StressProfile.load(yamlURI);
            String specName = profile.specName;
            if (default_profile_name == null) {default_profile_name=specName;} //first file is default
            if (profiles.containsKey(specName))
            {
                throw new IllegalArgumentException("Must only specify a singe YAML file per table (including keyspace qualifier).");
            }
            profiles.put(specName, profile);
        }


        if (ratios.size() == 0)
            throw new IllegalArgumentException("Must specify at least one command with a non-zero ratio");
    }

    public boolean hasInsertOnly()

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Verify the file exists: run 'ls -l <path>' with the exact path passed to profile=.
  2. Use an absolute path, e.g. profile=/opt/stress/myprofile.yaml, to avoid CWD surprises.
  3. If using a URL, ensure the scheme is correct (http://...) so it isn't treated as a local file path.
  4. Mount/copy the YAML into the container or node before running stress.

Example fix

// before
cassandra-stress user profile=./profie.yaml ops(insert=1)
// after
cassandra-stress user profile=/opt/stress/profile.yaml ops(insert=1)
Defensive patterns

Strategy: validation

Validate before calling

File f = new File(path);
if (!f.isFile()) throw new IllegalArgumentException("profile YAML not found: " + f.getAbsolutePath());

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/a1e88f3288164e23. Report an issue: GitHub.