{"record":{"id":"aba3a4e1ccb6db63","repo":"dbeaver/dbeaver","slug":"workspace-directory-is-read-only","errorCode":null,"errorMessage":"Workspace directory is read-only","messagePattern":"Workspace directory is read-only","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/configuration/ConfigurationImportWizard.java","lineNumber":87,"sourceCode":"            log.error(\"Error reading configuration\");\n            return false;\n        }\n        ConfigurationImportData configurationImportData = mainPage.getConfigurationImportData();\n        new Job(\"Importing workspace configuration\") {\n            @Override\n            protected IStatus run(IProgressMonitor monitor) {\n                String zipFilepath = configurationImportData.getFilePath();\n                File zipFile = Path.of(zipFilepath).toFile();\n                if (!zipFile.exists() || !zipFile.canRead()) {\n                    return Status.error(\"Can't read configuration file\");\n                }\n                try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFile))) {\n                    ZipEntry nextEntry = zipInputStream.getNextEntry();\n                    while (nextEntry != null) {\n                        String name = nextEntry.getName();\n                        Path configFilePath = workbench.resolve(name);\n                        if (!configFilePath.toFile().getParentFile().canWrite()) {\n                            throw new IOException(\"Workspace directory is read-only\");\n                        }\n                        if (configFilePath.toFile().exists()) {\n                            File listFile = configFilePath.toFile();\n                            if (listFile.getName().equals(name)) {\n                                writeZipEntryToFile(zipInputStream, listFile);\n                            }\n                        } else {\n                            Files.createFile(configFilePath);\n                            writeZipEntryToFile(zipInputStream, configFilePath.toFile());\n                        }\n                        nextEntry = zipInputStream.getNextEntry();\n                    }\n                } catch (FileNotFoundException exception) {\n                    return Status.error(\"File not found\", exception);\n                } catch (IOException exception) {\n                    return Status.error(\"Error reading file\", exception);\n                }\n                if (UIUtils.confirmAction(getShell(),","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/dbeaver/dbeaver/blob/1e5ee1042bc61661368942aece126f3e67049955/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/configuration/ConfigurationImportWizard.java#L69-L105","documentation":"Thrown by ConfigurationImportWizard when importing a workspace configuration zip and the resolved parent directory of a config file entry is not writable. The wizard resolves each zip entry name against the Eclipse settings metadata folder (.plugins/org.eclipse.core.runtime/.settings) and checks getParentFile().canWrite() before writing. This is a filesystem permission check, not a zip-slip guard.","triggerScenarios":"performFinish() runs a Job that iterates ZipInputStream entries; for each entry it resolves workbench.resolve(name) and tests configFilePath.toFile().getParentFile().canWrite(). If any entry's parent dir is read-only, the IOException is thrown and caught by the outer catch, producing Status.error(\"Error reading file\").","commonSituations":"Running DBeaver from a read-only installation or a restricted user account where the workspace metadata folder lacks write permission. The workspace lives on a network mount mounted read-only. Another process or OS policy locked the .settings directory.","solutions":["Verify the workspace metadata folder is writable: ls -la on the .plugins/org.eclipse.core.runtime/.settings directory under the metadata folder","Check OS-level permissions and ownership of the workspace directory; grant write access to the running user","If the workspace is on a read-only mount, move the workspace to a writable location via -data <path> launch argument","Close other DBeaver instances that may have locked the directory","Restart DBeaver with elevated privileges only if the workspace legitimately requires them"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Path settingsDir = DBWorkbench.getPlatform().getWorkspace().getMetadataFolder()\n    .resolve(\".plugins/org.eclipse.core.runtime/.settings\");\nif (!settingsDir.toFile().isDirectory() || !settingsDir.toFile().canWrite()) {\n    // abort import, warn user\n}","typeGuard":null,"tryCatchPattern":"try {\n    // zip extraction loop\n} catch (IOException e) {\n    if (e.getMessage().contains(\"read-only\")) {\n        log.error(\"Workspace settings directory is not writable: \" + settingsDir, e);\n        return Status.error(\"Cannot write to workspace settings. Check folder permissions.\");\n    }\n    throw e;\n}","preventionTips":["Pre-validate that the workspace metadata settings folder is writable before starting the import Job","Run DBeaver with a -data workspace path on a writable volume","Avoid running DBeaver from read-only installations without a separate writable workspace"],"tags":["filesystem","permissions","configuration-import","workspace","io"],"backgroundTag":null,"analyzedSha":"1e5ee1042bc61661368942aece126f3e67049955","analyzedAt":"2026-08-13T23:31:13.467Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}