{"record":{"id":"3b8f4173109bde69","repo":"apache/shardingsphere","slug":"30020-3b8f41","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/updatable/imports/ImportDatabaseConfigurationExecutor.java","lineNumber":48,"sourceCode":"import java.util.Collections;\n\n/**\n * Import database configuration executor.\n */\npublic final class ImportDatabaseConfigurationExecutor implements DistSQLUpdateExecutor<ImportDatabaseConfigurationStatement> {\n    \n    @Override\n    public void executeUpdate(final ImportDatabaseConfigurationStatement sqlStatement, final ContextManager contextManager) {\n        YamlProxyDatabaseConfiguration yamlConfig = getYamlProxyDatabaseConfiguration(sqlStatement);\n        new MetaDataImportExecutor(contextManager).importDatabaseConfigurations(Collections.singletonList(yamlConfig));\n    }\n    \n    private YamlProxyDatabaseConfiguration getYamlProxyDatabaseConfiguration(final ImportDatabaseConfigurationStatement sqlStatement) {\n        File file = new File(sqlStatement.getFilePath());\n        try {\n            return YamlEngine.unmarshal(file, YamlProxyDatabaseConfiguration.class);\n        } catch (final IOException ignore) {\n            throw new FileIOException(file);\n        }\n    }\n    \n    @Override\n    public Class<ImportDatabaseConfigurationStatement> getType() {\n        return ImportDatabaseConfigurationStatement.class;\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":57,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/imports/ImportDatabaseConfigurationExecutor.java#L30-L57","documentation":"FileIOException (error code 30020) thrown by ImportDatabaseConfigurationExecutor.getYamlProxyDatabaseConfiguration when YamlEngine.unmarshal(file, YamlProxyDatabaseConfiguration.class) fails with IOException during IMPORT DATABASE CONFIGURATION. The target file must be a readable YAML file on the proxy host before metadata import can proceed; any read failure is converted to this exception.","triggerScenarios":"IMPORT DATABASE CONFIGURATION FROM FILE '/path' where the path is missing/unreadable/a directory, causing IOException from YamlEngine.unmarshal.","commonSituations":"Export/import workflow where the exported YAML was not copied to the target proxy node; containerized proxy without the host path mounted; permission mismatch between the exporting and importing environments.","solutions":["Copy or mount the exported YAML to a path the proxy can read, then re-run IMPORT DATABASE CONFIGURATION with that absolute path","Check file permissions (chmod/chown) for the proxy service user","Validate the file is regular YAML (not binary/corrupted) by opening it on the proxy host first"],"exampleFix":"-- before\nIMPORT DATABASE CONFIGURATION FROM FILE 'export/db.yaml';\n\n-- after\nIMPORT DATABASE CONFIGURATION FROM FILE '/opt/shardingsphere/export/db.yaml';","handlingStrategy":"validation","validationCode":"File f = new File(path);\nif (!f.isFile() || !f.canRead()) {\n    throw new IllegalArgumentException(\"Import file missing or unreadable on proxy host: \" + f.getAbsolutePath());\n}\n// then IMPORT DATABASE CONFIGURATION FROM FILE '<path>'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stage exported YAML on the target proxy node (or shared mounted volume) before import","Automate the copy+import as one step so a missing file fails before the DistSQL round-trip"],"tags":["distsql","file-io","ral","import","metadata"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}