dbeaver/dbeaver · error · IOException
Workspace directory is read-only
Error message
Workspace directory is read-only
What it means
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.
Source
Thrown at plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/configuration/ConfigurationImportWizard.java:87
log.error("Error reading configuration");
return false;
}
ConfigurationImportData configurationImportData = mainPage.getConfigurationImportData();
new Job("Importing workspace configuration") {
@Override
protected IStatus run(IProgressMonitor monitor) {
String zipFilepath = configurationImportData.getFilePath();
File zipFile = Path.of(zipFilepath).toFile();
if (!zipFile.exists() || !zipFile.canRead()) {
return Status.error("Can't read configuration file");
}
try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFile))) {
ZipEntry nextEntry = zipInputStream.getNextEntry();
while (nextEntry != null) {
String name = nextEntry.getName();
Path configFilePath = workbench.resolve(name);
if (!configFilePath.toFile().getParentFile().canWrite()) {
throw new IOException("Workspace directory is read-only");
}
if (configFilePath.toFile().exists()) {
File listFile = configFilePath.toFile();
if (listFile.getName().equals(name)) {
writeZipEntryToFile(zipInputStream, listFile);
}
} else {
Files.createFile(configFilePath);
writeZipEntryToFile(zipInputStream, configFilePath.toFile());
}
nextEntry = zipInputStream.getNextEntry();
}
} catch (FileNotFoundException exception) {
return Status.error("File not found", exception);
} catch (IOException exception) {
return Status.error("Error reading file", exception);
}
if (UIUtils.confirmAction(getShell(),View on GitHub (pinned to 1e5ee1042b)
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
Defensive patterns
Strategy: validation
Validate before calling
Path settingsDir = DBWorkbench.getPlatform().getWorkspace().getMetadataFolder()
.resolve(".plugins/org.eclipse.core.runtime/.settings");
if (!settingsDir.toFile().isDirectory() || !settingsDir.toFile().canWrite()) {
// abort import, warn user
} Try / catch
try {
// zip extraction loop
} catch (IOException e) {
if (e.getMessage().contains("read-only")) {
log.error("Workspace settings directory is not writable: " + settingsDir, e);
return Status.error("Cannot write to workspace settings. Check folder permissions.");
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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").
Common situations: 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.
Related errors
- Cannot create directory '${exportData.getOutputFolder().getA
- Can't create directory '${fsDir.getAbsolutePath()}'
- Can't create directory '${fileDir.getAbsolutePath()}'
- Target file '${fsFile.getAbsolutePath()}' is a directory
- IO Error reading bookmarks storage
AI-assisted analysis of dbeaver/dbeaver@1e5ee1042b (2026-08-13).
Data as JSON: /api/errors/aba3a4e1ccb6db63.
Report an issue: GitHub.