{"record":{"id":"6738418eb16adfb2","repo":"apache/shardingsphere","slug":"30020","errorCode":"30020","errorMessage":"File access failed, file is: %s","messagePattern":"File access failed, file is: (.+?)","errorType":"exception","errorClass":"FileIOException","httpStatus":null,"severity":"error","filePath":"proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/yaml/ConvertYamlConfigurationExecutor.java","lineNumber":74,"sourceCode":" * Convert YAML configuration executor.\n */\npublic final class ConvertYamlConfigurationExecutor implements DistSQLQueryExecutor<ConvertYamlConfigurationStatement> {\n    \n    private final YamlProxyDataSourceConfigurationSwapper dataSourceConfigSwapper = new YamlProxyDataSourceConfigurationSwapper();\n    \n    @Override\n    public Collection<String> getColumnNames(final ConvertYamlConfigurationStatement statement) {\n        return Collections.singleton(\"dist_sql\");\n    }\n    \n    @Override\n    public Collection<LocalDataQueryResultRow> getRows(final ConvertYamlConfigurationStatement sqlStatement, final ContextManager contextManager) {\n        File file = new File(sqlStatement.getFilePath());\n        YamlProxyDatabaseConfiguration yamlConfig;\n        try {\n            yamlConfig = YamlEngine.unmarshal(file, YamlProxyDatabaseConfiguration.class);\n        } catch (final IOException ignore) {\n            throw new FileIOException(file);\n        }\n        Preconditions.checkNotNull(yamlConfig, \"Invalid yaml file `%s`\", file.getName());\n        Preconditions.checkNotNull(yamlConfig.getDatabaseName(), \"`databaseName` in file `%s` is required.\", file.getName());\n        DatabaseNameValidator.validate(yamlConfig.getDatabaseName());\n        return Collections.singleton(new LocalDataQueryResultRow(convertYamlConfigurationToDistSQL(yamlConfig)));\n    }\n    \n    @SuppressWarnings(\"unchecked\")\n    private String convertYamlConfigurationToDistSQL(final YamlProxyDatabaseConfiguration yamlConfig) {\n        StringBuilder result = new StringBuilder();\n        result.append(convertDatabase(yamlConfig.getDatabaseName()));\n        result.append(System.lineSeparator()).append(System.lineSeparator());\n        if (null == yamlConfig.getDataSources() || yamlConfig.getDataSources().isEmpty()) {\n            return result.toString();\n        }\n        result.append(convertDataSources(yamlConfig.getDataSources()));\n        result.append(System.lineSeparator()).append(System.lineSeparator());\n        if (null == yamlConfig.getRules() || yamlConfig.getRules().isEmpty()) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/yaml/ConvertYamlConfigurationExecutor.java#L56-L92","documentation":"FileIOException (error code 30020) thrown by ConvertYamlConfigurationExecutor.getRows when YamlEngine.unmarshal(file, YamlProxyDatabaseConfiguration.class) raises IOException while reading the file passed to CONVERT YAML CONFIGURATION. The IOException is swallowed (`ignore`) and replaced with this exception naming the file, so the original I/O reason (missing file, permission, encoding) is not visible in the message.","triggerScenarios":"CONVERT YAML CONFIGURATION '/path/to/file.yaml' where the path does not exist, is a directory, or is unreadable by the proxy process; YamlEngine.unmarshal throws IOException during stream reading.","commonSituations":"Relative path resolved against the proxy working directory instead of the user's shell; file on a mount not visible inside a Docker container; file permissions denying the proxy OS user; typo in the path.","solutions":["Verify the file exists and is readable by the proxy process (absolute path is safest); if running in Docker/K8s, confirm the path is mounted into the container","Re-run with an absolute path from the proxy's working directory perspective","If the file exists, check OS-level read permission for the user running ShardingSphere-Proxy"],"exampleFix":"-- before\nCONVERT YAML CONFIGURATION 'config/db.yaml';\n\n-- after\nCONVERT YAML CONFIGURATION '/opt/shardingsphere/conf/db.yaml';","handlingStrategy":"validation","validationCode":"File f = new File(path);\nif (!f.isFile() || !f.canRead()) {\n    throw new IllegalArgumentException(\"YAML file missing or unreadable: \" + f.getAbsolutePath());\n}\n// safe to submit: CONVERT YAML CONFIGURATION '<path>'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-check file existence/readability from the proxy's working directory before issuing CONVERT","Use absolute paths; in containers verify the path is mounted"],"tags":["distsql","file-io","ral","yaml","path"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}