{"record":{"id":"1bd10fd5ffe8f647","repo":"alibaba/DataX","slug":"102","errorCode":"-102","errorMessage":"ADS JDBC connection password was not set.","messagePattern":"ADS JDBC connection password was not set\\.","errorType":"error_code","errorClass":"AdsException","httpStatus":null,"severity":"error","filePath":"adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java","lineNumber":102,"sourceCode":"     * @throws com.alibaba.datax.plugin.writer.adswriter.AdsException\n     */\n    public TableInfo getTableInfo(String table) throws AdsException {\n\n        if (table == null) {\n            throw new AdsException(AdsException.ADS_TABLEMETA_TABLE_NULL, \"Table is null.\", null);\n        }\n\n        if (adsURL == null) {\n            throw new AdsException(AdsException.ADS_CONN_URL_NOT_SET, \"ADS JDBC connection URL was not set.\", null);\n        }\n\n        if (userName == null) {\n            throw new AdsException(AdsException.ADS_CONN_USERNAME_NOT_SET,\n                    \"ADS JDBC connection user name was not set.\", null);\n        }\n\n        if (password == null) {\n            throw new AdsException(AdsException.ADS_CONN_PASSWORD_NOT_SET, \"ADS JDBC connection password was not set.\",\n                    null);\n        }\n\n        if (schema == null) {\n            throw new AdsException(AdsException.ADS_CONN_SCHEMA_NOT_SET, \"ADS JDBC connection schema was not set.\",\n                    null);\n        }\n\n        Connection connection = null;\n        Statement statement = null;\n        ResultSet rs = null;\n        try {\n            Class.forName(\"com.mysql.jdbc.Driver\");\n            String url = AdsUtil.prepareJdbcUrl(this.adsURL, this.schema, this.socketTimeout, this.suffix);\n\n            Properties connectionProps = new Properties();\n            connectionProps.put(\"user\", userName);\n            connectionProps.put(\"password\", password);","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java#L84-L120","documentation":"Fourth guard in getTableInfo: a null password throws AdsException code -102 (ADS_CONN_PASSWORD_NOT_SET). The helper refuses to build JDBC connection properties without a password, even if the account has an empty one.","triggerScenarios":"adswriter parameter block has no 'password' key (or it is named differently), leaving AdsHelper.password null when getTableInfo runs.","commonSituations":"Password omitted from the job JSON, moved to a template variable that rendered empty, or key spelled 'pwd'/'pass'.","solutions":["Add the 'password' key with the ADS account password to the adswriter parameter block.","If the account truly has an empty password, pass an empty string rather than omitting the key (null vs \"\" distinction).","Check templating/variable substitution actually produced a value in the final job JSON."],"exampleFix":"// before\n{\"parameter\":{\"url\":\"...\",\"username\":\"u\"}}\n// after\n{\"parameter\":{\"url\":\"...\",\"username\":\"u\",\"password\":\"secret\"}}","handlingStrategy":"validation","validationCode":"if (config.getString(\"password\") == null) {\n    throw new IllegalStateException(\"adswriter 'password' key is required\");\n}","typeGuard":"boolean isPasswordSet(String p) { return p != null; } // empty string allowed, null not","tryCatchPattern":"try {\n    return helper.getTableInfo(table);\n} catch (AdsException e) {\n    if (e.getCode() == AdsException.ADS_CONN_PASSWORD_NOT_SET) {\n        throw new IllegalStateException(\"job config: ADS 'password' missing\", e);\n    }\n    throw e;\n}","preventionTips":["Pass \"\" explicitly for empty-password accounts; omitting the key yields null and throws.","Verify secret-template substitution output before scheduling.","Store ADS credentials in one place and inject them at job generation time."],"tags":["adswriter","config","credentials","validation"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}