{"record":{"id":"ff5dae00c1159c09","repo":"pentaho/pentaho-kettle","slug":"vfs-provider-invalid-scheme","errorCode":"vfs.provider/invalid-scheme","errorMessage":"vfs.provider/invalid-scheme","messagePattern":"vfs\\.provider/invalid-scheme","errorType":"error_code","errorClass":"FileSystemException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/connections/vfs/provider/ConnectionFileNameParser.java","lineNumber":281,"sourceCode":"    // When name is empty, fileType is FOLDER, which is the correct type for either the root or connection folder.\n    FileType fileType = UriParser.normalisePath( name );\n\n    // Examples: name = \"\" | \"Folder/Sub Folder/100%25\"\n\n    getConnectionFileNameUtils().ensureLeadingSeparator( name );\n\n    // Examples: name = \"/\" | \"/Folder/Sub Folder/100%25\"\n\n    String path = name.toString();\n\n    return new ConnectionFileName( connectionName, path, fileType );\n  }\n\n  private void extractPvfsScheme( String uri, StringBuilder name ) throws FileSystemException {\n    // UriParser.extractScheme initializes `name` with the contents of uri, and only then extracts the scheme.\n    // Scheme may not be present, or invalid (e.g. drive letter), in which case null is returned.\n    if ( UriParser.extractScheme( SCHEMES, uri, name ) == null ) {\n      throw new FileSystemException( \"vfs.provider/invalid-scheme\" );\n    }\n\n    // Extract \"//\" (based on HostFileNameParser#parseUri(..))\n    // These two are not supported as \"\\\".\n    if ( name.length() < 2 || name.charAt( 0 ) != SEPARATOR_CHAR || name.charAt( 1 ) != SEPARATOR_CHAR ) {\n      throw new FileSystemException( \"vfs.provider/missing-double-slashes.error\", uri );\n    }\n\n    name.delete( 0, 2 );\n  }\n}\n","sourceCodeStart":263,"sourceCodeEnd":293,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/connections/vfs/provider/ConnectionFileNameParser.java#L263-L293","documentation":"extractPvfsScheme parses the scheme off a pvfs URI using UriParser.extractScheme with the parser's supported SCHEMES. If the URI has no scheme, or what precedes '//' is not a supported scheme (e.g. a Windows drive letter like 'c:'), extractScheme returns null and a FileSystemException with message 'vfs.provider/invalid-scheme' is thrown.","triggerScenarios":"Calling parser.parseUri with a URI lacking the pvfs scheme — e.g. 'my-connection/folder/file.txt', 'file:///some/path', or a bare Windows path 'C:\\data' that looks like a scheme but isn't in SCHEMES.","commonSituations":"Passing plain filesystem paths to a parser that expects pvfs URIs; users omitting 'pvfs://' in configured file locations; using a related but unsupported scheme name (typo like 'pvfs2://').","solutions":["Prefix the URI with the supported scheme: 'pvfs://my-connection/path'.","Check the scheme yourself (uri.substring before \"://\") and reject or convert non-pvfs URIs before calling parseUri.","Fix typos in the scheme name to match the parser's SCHEMES list exactly (case as supported).","On Windows, ensure drive-letter paths are converted to proper URIs before PVFS parsing."],"exampleFix":"// before\nFileName name = parser.parseUri( \"my-connection/folder\" ); // throws invalid-scheme\n// after\nString uri = uri.startsWith( \"pvfs://\" ) ? uri : \"pvfs://\" + uri;\nFileName name = parser.parseUri( uri );","handlingStrategy":"validation","validationCode":"if ( uri == null || !uri.matches( \"(?i)^pvfs://.*\" ) ) {\n  uri = \"pvfs://\" + uri.replaceFirst( \"^[a-zA-Z]:\\\\\\\\?\", \"\" );\n}","typeGuard":"boolean hasSupportedScheme( String uri ) {\n  int i = uri.indexOf( ':' );\n  return i > 0 && uri.regionMatches( true, 0, \"pvfs\", 0, i ) && uri.startsWith( \"//\", i + 1 );\n}","tryCatchPattern":"try {\n  return parser.parseUri( uri );\n} catch ( FileSystemException e ) {\n  if ( \"vfs.provider/invalid-scheme\".equals( e.getMessage() ) ) {\n    // convert the path to a pvfs URI or report a config error\n  }\n  throw e;\n}","preventionTips":["Require full 'pvfs://...' URIs in user-facing configuration fields","Convert local/Windows paths to pvfs URIs before calling the parser","Validate scheme names against the parser's SCHEMES to catch typos early"],"tags":["vfs","uri-parsing","scheme"],"backgroundTag":"invalid-url-format","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}