{"record":{"id":"9afd6b29437b2d4b","repo":"apache/hadoop","slug":"proxy-error-fs-oss-proxy-username-or-fs-oss-proxy","errorCode":null,"errorMessage":"Proxy error: fs.oss.proxy.username or fs.oss.proxy.password set without the other.","messagePattern":"Proxy error: fs\\.oss\\.proxy\\.username or fs\\.oss\\.proxy\\.password set without the other\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java","lineNumber":148,"sourceCode":"      clientConf.setProxyHost(proxyHost);\n      if (proxyPort >= 0) {\n        clientConf.setProxyPort(proxyPort);\n      } else {\n        if (secureConnections) {\n          LOG.warn(\"Proxy host set without port. Using HTTPS default 443\");\n          clientConf.setProxyPort(443);\n        } else {\n          LOG.warn(\"Proxy host set without port. Using HTTP default 80\");\n          clientConf.setProxyPort(80);\n        }\n      }\n      String proxyUsername = conf.getTrimmed(PROXY_USERNAME_KEY);\n      String proxyPassword = conf.getTrimmed(PROXY_PASSWORD_KEY);\n      if ((proxyUsername == null) != (proxyPassword == null)) {\n        String msg = \"Proxy error: \" + PROXY_USERNAME_KEY + \" or \" +\n            PROXY_PASSWORD_KEY + \" set without the other.\";\n        LOG.error(msg);\n        throw new IllegalArgumentException(msg);\n      }\n      clientConf.setProxyUsername(proxyUsername);\n      clientConf.setProxyPassword(proxyPassword);\n      clientConf.setProxyDomain(conf.getTrimmed(PROXY_DOMAIN_KEY));\n      clientConf.setProxyWorkstation(conf.getTrimmed(PROXY_WORKSTATION_KEY));\n    } else if (proxyPort >= 0) {\n      String msg = \"Proxy error: \" + PROXY_PORT_KEY + \" set without \" +\n          PROXY_HOST_KEY;\n      LOG.error(msg);\n      throw new IllegalArgumentException(msg);\n    }\n\n    String endPoint = conf.getTrimmed(ENDPOINT_KEY, \"\");\n    if (StringUtils.isEmpty(endPoint)) {\n      throw new IllegalArgumentException(\"Aliyun OSS endpoint should not be \" +\n          \"null or empty. Please set proper endpoint with 'fs.oss.endpoint'.\");\n    }\n    CredentialsProvider provider =","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java#L130-L166","documentation":"Thrown by AliyunOSSFileSystemStore.initialize() during proxy setup: exactly one of fs.oss.proxy.username / fs.oss.proxy.password is configured (null vs non-null check), which cannot form a valid proxy credential pair. The store throws IllegalArgumentException with a message naming the missing counterpart key.","triggerScenarios":"Setting fs.oss.proxy.username in core-site.xml without fs.oss.proxy.password (or vice versa) while fs.oss.proxy.host is configured; templated configs where the secret injection failed silently; typos in one of the two property names so only the other takes effect.","commonSituations":"Secrets managed via credential providers/JCEKS where only one property resolves; cluster-level proxy settings partially overridden by job config; environments behind authenticated proxies migrating from no-auth proxy config.","solutions":["Set both fs.oss.proxy.username and fs.oss.proxy.password (or remove both if the proxy needs no auth)","If secrets come from a credential store, verify both entries resolve: hadoop credential list and the alias names match exactly","Check for typos/case errors in the property names so neither key is silently dropped"],"exampleFix":"<!-- before -->\n<property><name>fs.oss.proxy.host</name><value>proxy.corp</value></property>\n<property><name>fs.oss.proxy.username</name><value>alice</value></property>\n\n<!-- after -->\n<property><name>fs.oss.proxy.host</name><value>proxy.corp</value></property>\n<property><name>fs.oss.proxy.username</name><value>alice</value></property>\n<property><name>fs.oss.proxy.password</name><value>${proxy.secret}</value></property>","handlingStrategy":"validation","validationCode":"String u = conf.getTrimmed(\"fs.oss.proxy.username\");\nString p = conf.getTrimmed(\"fs.oss.proxy.password\");\nif ((u == null) != (p == null)) {\n  throw new IOException(\"Configure both fs.oss.proxy.username and fs.oss.proxy.password, or neither\");\n}","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { /* init-time config bug: fix the proxy property pair; do not retry */ throw e; }","preventionTips":["Set proxy username and password together, sourced from the same secret store","Verify credential-provider aliases resolve for both keys before deploying","Remove both proxy auth keys when the proxy is unauthenticated"],"tags":["aliyun-oss","configuration","proxy","paired-config","hadoop-connector"],"backgroundTag":"incomplete-proxy-config","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}