{"record":{"id":"6d55f0f02ac60504","repo":"dbeaver/dbeaver","slug":"error-starting-data-transfer","errorCode":null,"errorMessage":"Error starting data transfer","messagePattern":"Error starting data transfer","errorType":"exception","errorClass":"DBException","httpStatus":null,"severity":"error","filePath":"plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/task/DTTaskHandlerTransfer.java","lineNumber":105,"sourceCode":"        @NotNull Locale locale,\n        @NotNull Log log,\n        @Nullable PrintStream logStream,\n        @NotNull DBTTaskExecutionListener listener,\n        DataTransferSettings settings\n    ) throws DBException {\n        listener.taskStarted(task);\n        int indexOfLastPipeWithDisabledReferentialIntegrity = -1;\n        try {\n            indexOfLastPipeWithDisabledReferentialIntegrity = initializePipes(runnableContext, settings, task);\n            Throwable error = runDataTransferJobs(runnableContext, task, locale, log, logStream, listener, settings);\n            listener.taskFinished(task, null, error, settings);\n        } catch (InvocationTargetException e) {\n            DBWorkbench.getPlatformUI().showError(\n                DTMessages.data_transfer_task_handler_unexpected_error_title,\n                DTMessages.data_transfer_task_handler_unexpected_error_message,\n                e.getCause()\n            );\n            throw new DBException(\"Error starting data transfer\", e);\n        } catch (InterruptedException | OperationCanceledException e) {\n            //ignore\n        } finally {\n            restoreReferentialIntegrity(\n                runnableContext,\n                settings.getDataPipes().subList(0, indexOfLastPipeWithDisabledReferentialIntegrity + 1)\n            );\n        }\n    }\n\n    private int initializePipes(\n        @NotNull DBRRunnableContext runnableContext,\n        @NotNull DataTransferSettings settings,\n        @Nullable DBTTask task\n    ) throws InvocationTargetException, InterruptedException, DBException {\n        int[] indexOfLastPipeWithDisabledReferentialIntegrity = new int[]{-1};\n        DBException[] dbException = {null};\n        List<DataTransferPipe> dataPipes = settings.getDataPipes();","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/dbeaver/dbeaver/blob/1e5ee1042bc61661368942aece126f3e67049955/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/task/DTTaskHandlerTransfer.java#L87-L123","documentation":"Thrown when initializing data transfer pipes or running the transfer jobs fails with an InvocationTargetException. Before throwing, an error dialog is displayed via DBWorkbench.getPlatformUI().showError() containing the root cause (e.getCause()). The original InvocationTargetException is wrapped directly in the DBException.","triggerScenarios":"Calling DTTaskHandlerTransfer.executeWithSettings() when initializePipes() or runDataTransferJobs() throws inside a runnable. Common triggers: source or target datasource unreachable, metadata read error during pipe initialization, or the transfer job itself fails.","commonSituations":"Target database went offline mid-transfer. Insufficient privileges on source or target. Driver incompatibility causing metadata read failures. Network timeout during pipe setup.","solutions":["Check the error dialog displayed before this exception — it shows the root cause via e.getCause()","Verify both source and target datasources are connected and accessible before starting the transfer","Confirm driver versions are compatible with the transfer engine and the target database"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure both source and target are connected before transfer\nfor (DBPDataSourceContainer ds : Arrays.asList(sourceDs, targetDs)) {\n    if (!ds.isConnected()) {\n        ds.connect(VoidProgressMonitor.INSTANCE, true, true);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    handler.executeWithSettings(ctx, task, locale, log, out, listener, settings);\n} catch (DBException e) {\n    Throwable root = e.getCause(); // InvocationTargetException\n    if (root instanceof InvocationTargetException ite) {\n        root = ite.getCause();\n    }\n    log.error(\"Transfer failed\", root);\n}","preventionTips":["Verify both source and target datasource connectivity before starting a transfer","Note that an error dialog is already shown to the user before this exception propagates — avoid duplicate dialogs in your handler","Unwrap InvocationTargetException to get the true cause for logging"],"tags":["data-transfer","jdbc","connection"],"backgroundTag":null,"analyzedSha":"1e5ee1042bc61661368942aece126f3e67049955","analyzedAt":"2026-08-13T23:31:13.467Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}