{"record":{"id":"e201363d33aec9ca","repo":"dbeaver/dbeaver","slug":"data-transfer-was-canceled","errorCode":null,"errorMessage":"Data transfer was canceled","messagePattern":"Data transfer was canceled","errorType":"exception","errorClass":"DBInterruptedException","httpStatus":null,"severity":"warning","filePath":"plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/DataTransferJob.java","lineNumber":160,"sourceCode":"            throw new DBException(\"Null consumer\");\n        }\n\n        String inputName = producer.getObjectFullName(monitor);\n        String outputName = consumer.getObjectFullName(monitor);\n        monitor.beginTask(\n            NLS.bind(DTMessages.data_transfer_wizard_job_container_name,\n                CommonUtils.truncateString(inputName, 200),\n                CommonUtils.truncateString(outputName, 200)), 1);\n\n        IDataTransferSettings nodeSettings = settings.getNodeSettings(producer);\n        try {\n            //consumer.initTransfer(producer.getDatabaseObject(), consumerSettings, );\n\n            IDataTransferProcessor processor = settings.getProcessor() == null ? null : settings.getProcessor().getInstance();\n            producer.transferData(monitor, consumer, processor, nodeSettings, task, -1);\n\n            if (isTransferCanceled(monitor)) {\n                throw new DBInterruptedException(\"Data transfer was canceled\");\n            }\n\n            totalStatistics.accumulate(producer.getStatistics());\n            totalStatistics.accumulate(consumer.getStatistics());\n\n            consumer.finishTransfer(monitor, false);\n        } catch (Exception e) {\n            consumer.finishTransfer(monitor, e, task, false);\n            log.error(\"Error transferring data from \" + inputName + \" to \" + outputName, e);\n            throw e;\n        } finally {\n            monitor.done();\n        }\n    }\n\n    private boolean isTransferCanceled(@NotNull DBRProgressMonitor monitor) {\n        return monitor.isCanceled() || isCanceled() || (parentMonitor != null && parentMonitor.isCanceled());\n    }","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/dbeaver/dbeaver/blob/1e5ee1042bc61661368942aece126f3e67049955/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/DataTransferJob.java#L142-L178","documentation":"Thrown as a DBInterruptedException after producer.transferData returns, when isTransferCanceled(monitor) is true. It is the clean cancellation path: the transfer job's canceling() flag or the monitor's cancel state was set, so the job aborts the current pipe rather than continuing. Not a fault; the message exists so the job reports a structured interruption.","triggerScenarios":"The user pressed Cancel in the progress dialog, the job received an IJobManager cancel, or a DBRProgressMonitor passed to the producer was marked canceled mid-stream.","commonSituations":"User-initiated cancel of a long export/import; a parent operation canceling its children; automated runs with a timeout that cancels the monitor.","solutions":["Treat this as expected control flow: catch DBInterruptedException and surface 'Transfer canceled by user' rather than as a failure.","If cancel is unexpected, audit code that calls job.cancel() or monitor.setCanceled() upstream.","For resumable transfers, restart the job; producers/consumers that support resumption will continue."],"exampleFix":"// before\ntry {\n    job.transferData(monitor, pipe);\n} catch (DBException e) {\n    log.error(\"Transfer failed\", e); // wrongly logs cancellation as error\n}\n\n// after\ntry {\n    job.transferData(monitor, pipe);\n} catch (DBInterruptedException e) {\n    log.info(\"Transfer canceled: \" + e.getMessage());\n} catch (DBException e) {\n    log.error(\"Transfer failed\", e);\n}","handlingStrategy":"try-catch","validationCode":"if (monitor.isCanceled()) {\n    // do not start; or exit gracefully\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    job.transferData(monitor, pipe);\n} catch (DBInterruptedException e) {\n    // expected: user/parent canceled; do not treat as error\n    log.info(\"Transfer canceled: \" + e.getMessage());\n}","preventionTips":["Differentiate DBInterruptedException from real DBException in catch blocks.","Do not cancel the job monitor unless shutdown is intended.","Surfaces cancel state to the user as a normal outcome, not a failure."],"tags":["data-transfer","cancellation","monitor","control-flow"],"backgroundTag":null,"analyzedSha":"1e5ee1042bc61661368942aece126f3e67049955","analyzedAt":"2026-08-13T23:31:13.467Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}