{"record":{"id":"ffdf518d826702e2","repo":"apache/hadoop","slug":"signversion-is-v4-but-region-is-empty","errorCode":null,"errorMessage":"SignVersion is V4 but region is empty","messagePattern":"SignVersion is V4 but region is empty","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java","lineNumber":123,"sourceCode":"        SECURE_CONNECTIONS_DEFAULT);\n    clientConf.setProtocol(secureConnections ? Protocol.HTTPS : Protocol.HTTP);\n    clientConf.setMaxErrorRetry(conf.getInt(MAX_ERROR_RETRIES_KEY,\n        MAX_ERROR_RETRIES_DEFAULT));\n    clientConf.setConnectionTimeout(conf.getInt(ESTABLISH_TIMEOUT_KEY,\n        ESTABLISH_TIMEOUT_DEFAULT));\n    clientConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT_KEY,\n        SOCKET_TIMEOUT_DEFAULT));\n    clientConf.setUserAgent(\n        conf.get(USER_AGENT_PREFIX, USER_AGENT_PREFIX_DEFAULT) + \", Hadoop/\"\n            + VersionInfo.getVersion());\n\n    String region = conf.get(REGION_KEY, \"\");\n    String signatureVersion = conf.get(SIGNATURE_VERSION_KEY, SIGNATURE_VERSION_DEFAULT);\n    if (\"V4\".equalsIgnoreCase(signatureVersion)) {\n      clientConf.setSignatureVersion(SignVersion.V4);\n      if (StringUtils.isEmpty(region)) {\n        LOG.error(\"Signature version is V4 ,but region is empty.\");\n        throw new IOException(\"SignVersion is V4 but region is empty\");\n      }\n    }\n\n    String proxyHost = conf.getTrimmed(PROXY_HOST_KEY, \"\");\n    int proxyPort = conf.getInt(PROXY_PORT_KEY, -1);\n    if (StringUtils.isNotEmpty(proxyHost)) {\n      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      }","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java#L105-L141","documentation":"Thrown by AliyunOSSFileSystemStore.initialize(): fs.oss.signature.version (SIGNATURE_VERSION_KEY) is set to \"V4\" (case-insensitive) but fs.oss.region (REGION_KEY) is empty. OSS V4 signing requires the region in the Credential string, so without it the client cannot sign any request; the store logs an error and fails initialization with IOException(\"SignVersion is V4 but region is empty\").","triggerScenarios":"Setting fs.oss.signature.version=V4 in core-site.xml (or per-job Configuration) without fs.oss.region; upgrading hadoop-aliyun / SDK where V4 becomes the desired default; copying endpoint config from an older setup that never needed a region.","commonSituations":"Migrations to V4 signing to satisfy newer OSS buckets that reject V1 signatures; region mismatch or omission in multi-region deployments; config templates that predate the region option.","solutions":["Set fs.oss.region to the bucket's region (e.g., oss-cn-hangzhou / cn-hangzhou) alongside fs.oss.signature.version=V4","If you cannot supply a region, fall back to the default signature version by removing the fs.oss.signature.version override (verify the bucket still accepts it)","Verify with a minimal ls (hadoop fs -ls oss://bucket/) after the config change to confirm initialization succeeds"],"exampleFix":"<!-- before -->\n<property><name>fs.oss.signature.version</name><value>V4</value></property>\n\n<!-- after -->\n<property><name>fs.oss.signature.version</name><value>V4</value></property>\n<property><name>fs.oss.region</name><value>oss-cn-hangzhou</value></property>","handlingStrategy":"validation","validationCode":"String sigVer = conf.get(\"fs.oss.signatureversion\", \"\");\nString region = conf.get(\"fs.oss.region\", \"\");\nif (\"V4\".equalsIgnoreCase(sigVer) && region.isEmpty()) {\n  throw new IOException(\"fs.oss.region is required when fs.oss.signatureversion=V4\");\n}","typeGuard":null,"tryCatchPattern":"catch (IOException e) { if (\"SignVersion is V4 but region is empty\".equals(e.getMessage())) { /* fix config, not retryable */ throw e; } throw e; }","preventionTips":["Always pair fs.oss.signature.version=V4 with fs.oss.region","Add a config smoke test (hadoop fs -ls on one prefix) to cluster deployment checks","Review OSS connector config after hadoop-aliyun upgrades"],"tags":["aliyun-oss","configuration","v4-signing","missing-region","hadoop-connector"],"backgroundTag":"missing-region-config","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}