alibaba/DataX · critical · AdsException

-303

-303

Error message

Job id is not available for the submitted LOAD DATA.{jobId}

What it means

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.

Source

Thrown at adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java:285

        try {
            Class.forName("com.mysql.jdbc.Driver");
            String url = AdsUtil.prepareJdbcUrl(this.adsURL, this.schema, this.socketTimeout, this.suffix);
            Properties connectionProps = new Properties();
            connectionProps.put("user", userName);
            connectionProps.put("password", password);
            connection = DriverManager.getConnection(url, connectionProps);
            statement = connection.createStatement();
            LOG.info("正在从ODPS数据库导数据到ADS中: "+sb.toString());
            LOG.info("由于ADS的限制,ADS导数据最少需要20分钟,请耐心等待");
            rs = statement.executeQuery(sb.toString());

            String jobId = null;
            while (DBUtil.asyncResultSetNext(rs)) {
                jobId = rs.getString(1);
            }

            if (jobId == null) {
                throw new AdsException(AdsException.ADS_LOADDATA_JOBID_NOT_AVAIL,
                        "Job id is not available for the submitted LOAD DATA." + jobId, null);
            }

            return jobId;

        } catch (ClassNotFoundException e) {
            throw new AdsException(AdsException.ADS_LOADDATA_FAILED, e.getMessage(), e);
        } catch (SQLException e) {
            throw new AdsException(AdsException.ADS_LOADDATA_FAILED, e.getMessage(), e);
        } catch (Exception e) {
            throw new AdsException(AdsException.ADS_LOADDATA_FAILED, e.getMessage(), e);
        } finally {
            if (rs != null) {
                try {
                    rs.close();
                } catch (SQLException e) {
                    // Ignore exception
                }

View on GitHub (pinned to 80ec23d5c5)

Solutions

  1. Verify the sourcePath exists and the ADS account has read permission on that ODPS/OSS location.
  2. Check the ADS console/monitoring for the load job's actual fate (it may have failed server-side).
  3. Confirm the target table and partition are valid and not locked by another load.
  4. 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.

Example fix

// before
helper.loadData(table, partition, "oss://bucket/missing-dir", true);
// after
// verify staging dir exists and contains files first
String path = odpsExport.getResultPath();
assert path != null && odpsfs.exists(path);
helper.loadData(table, partition, path, true);
Defensive patterns

Strategy: retry

Validate before calling

// before submitting LOAD DATA, confirm the staging path is real and readable
if (sourcePath == null || !odpsFs.exists(sourcePath)) {
    throw new IllegalStateException("staging path missing or empty: " + sourcePath);
}

Try / catch

int attempts = 0;
while (true) {
    try {
        return helper.loadData(table, partition, sourcePath, overwrite);
    } catch (AdsException e) {
        if (e.getCode() == AdsException.ADS_LOADDATA_JOBID_NOT_AVAIL && ++attempts <= 3) {
            LOG.warn("ADS returned no job id, attempt {}/3 - checking staging path and retrying", attempts);
            continue; // only after verifying path/permissions; ADS loads take 20+ min, backoff accordingly
        }
        throw e;
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14). Data as JSON: /api/errors/dae203bbd71d1d87. Report an issue: GitHub.