{"record":{"id":"dae203bbd71d1d87","repo":"alibaba/DataX","slug":"303","errorCode":"-303","errorMessage":"Job id is not available for the submitted LOAD DATA.{jobId}","messagePattern":"Job id is not available for the submitted LOAD DATA\\.(.+?)","errorType":"error_code","errorClass":"AdsException","httpStatus":null,"severity":"critical","filePath":"adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java","lineNumber":285,"sourceCode":"        try {\n            Class.forName(\"com.mysql.jdbc.Driver\");\n            String url = AdsUtil.prepareJdbcUrl(this.adsURL, this.schema, this.socketTimeout, this.suffix);\n            Properties connectionProps = new Properties();\n            connectionProps.put(\"user\", userName);\n            connectionProps.put(\"password\", password);\n            connection = DriverManager.getConnection(url, connectionProps);\n            statement = connection.createStatement();\n            LOG.info(\"正在从ODPS数据库导数据到ADS中: \"+sb.toString());\n            LOG.info(\"由于ADS的限制，ADS导数据最少需要20分钟，请耐心等待\");\n            rs = statement.executeQuery(sb.toString());\n\n            String jobId = null;\n            while (DBUtil.asyncResultSetNext(rs)) {\n                jobId = rs.getString(1);\n            }\n\n            if (jobId == null) {\n                throw new AdsException(AdsException.ADS_LOADDATA_JOBID_NOT_AVAIL,\n                        \"Job id is not available for the submitted LOAD DATA.\" + jobId, null);\n            }\n\n            return jobId;\n\n        } catch (ClassNotFoundException e) {\n            throw new AdsException(AdsException.ADS_LOADDATA_FAILED, e.getMessage(), e);\n        } catch (SQLException e) {\n            throw new AdsException(AdsException.ADS_LOADDATA_FAILED, e.getMessage(), e);\n        } catch (Exception e) {\n            throw new AdsException(AdsException.ADS_LOADDATA_FAILED, e.getMessage(), e);\n        } finally {\n            if (rs != null) {\n                try {\n                    rs.close();\n                } catch (SQLException e) {\n                    // Ignore exception\n                }","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java#L267-L303","documentation":"After executing the LOAD DATA statement, AdsHelper iterates the async result set expecting a job id in column 1; if no row was returned (jobId stays null) it throws AdsException code -303 (ADS_LOADDATA_JOBID_NOT_AVAIL). The trailing '{jobId}'/'null' in the message is just the null concatenated - it means ADS accepted the query but returned no job identifier.","triggerScenarios":"LOAD DATA submitted successfully at the JDBC level but the async result set yields zero rows: the sourcePath is invalid/empty, the account lacks LOAD permission on the source, or the ADS service rejected the load silently without an SQLException.","commonSituations":"Wrong or expired ODPS/OSS staging path, partitions with no data files, an ADS-side quota/permission issue on LOAD DATA, or transient ADS service behavior during maintenance (the code already warns loads take 20+ minutes).","solutions":["Verify the sourcePath exists and the ADS account has read permission on that ODPS/OSS location.","Check the ADS console/monitoring for the load job's actual fate (it may have failed server-side).","Confirm the target table and partition are valid and not locked by another load.","Retry after fixing the path/permissions; if it recurs, capture the full LOAD DATA SQL and run it manually against ADS to see the server's own response."],"exampleFix":"// before\nhelper.loadData(table, partition, \"oss://bucket/missing-dir\", true);\n// after\n// verify staging dir exists and contains files first\nString path = odpsExport.getResultPath();\nassert path != null && odpsfs.exists(path);\nhelper.loadData(table, partition, path, true);","handlingStrategy":"retry","validationCode":"// before submitting LOAD DATA, confirm the staging path is real and readable\nif (sourcePath == null || !odpsFs.exists(sourcePath)) {\n    throw new IllegalStateException(\"staging path missing or empty: \" + sourcePath);\n}","typeGuard":null,"tryCatchPattern":"int attempts = 0;\nwhile (true) {\n    try {\n        return helper.loadData(table, partition, sourcePath, overwrite);\n    } catch (AdsException e) {\n        if (e.getCode() == AdsException.ADS_LOADDATA_JOBID_NOT_AVAIL && ++attempts <= 3) {\n            LOG.warn(\"ADS returned no job id, attempt {}/3 - checking staging path and retrying\", attempts);\n            continue; // only after verifying path/permissions; ADS loads take 20+ min, backoff accordingly\n        }\n        throw e;\n    }\n}","preventionTips":["Always verify the ODPS/OSS staging path exists and contains files before LOAD DATA.","Grant the ADS account explicit read permission on the staging location and test it once.","Monitor the ADS console for server-side load failures; a missing job id often means silent rejection.","Log the full LOAD DATA SQL with each submission so failures can be replayed manually."],"tags":["adswriter","load-data","odps","ads-service","async-job"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}