{"record":{"id":"5b16f5f3ce01328e","repo":"apache/hadoop","slug":"msi-responded-with-invalid-expires-on","errorCode":null,"errorMessage":"MSI Responded with invalid expires_on","messagePattern":"MSI Responded with invalid expires_on","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java","lineNumber":561,"sourceCode":"          }\n\n          if (fieldName.equals(\"expires_on\")) {\n            expiresOnInSecs = Long.parseLong(fieldValue);\n          }\n\n        }\n        jp.nextToken();\n      }\n      jp.close();\n      if (expiresOnInSecs > 0) {\n        LOG.debug(\"Expiry based on expires_on: {}\", expiresOnInSecs);\n        token.setExpiry(new Date(expiresOnInSecs * 1000));\n      } else {\n        if (isMsi) {\n          // Currently there is a known issue that MSI does not update expires_in\n          // for refresh and will have the value from first AAD token fetch request.\n          // Due to this known limitation, expires_in is not supported for MSI token fetch flow.\n          throw new UnsupportedOperationException(\"MSI Responded with invalid expires_on\");\n        }\n\n        LOG.debug(\"Expiry based on expires_in: {}\", expiryPeriodInSecs);\n        long expiry = System.currentTimeMillis();\n        expiry = expiry + expiryPeriodInSecs * 1000L; // convert expiryPeriod to milliseconds and add\n        token.setExpiry(new Date(expiry));\n      }\n\n      LOG.debug(\"AADToken: fetched token with expiry {}, expiresOn passed: {}\",\n          token.getExpiry().toString(), expiresOnInSecs);\n    } catch (Exception ex) {\n      LOG.debug(\"AADToken: got exception when parsing json token \" + ex.toString());\n      throw ex;\n    } finally {\n      httpResponseStream.close();\n    }\n    return token;\n  }","sourceCodeStart":543,"sourceCodeEnd":579,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java#L543-L579","documentation":"Error \"MSI Responded with invalid expires_on\" thrown in apache/hadoop.","triggerScenarios":"The managed identity (MSI) endpoint returns a token response whose expires_on field cannot be parsed.","commonSituations":"See trigger scenarios.","solutions":["Retry the token request; the MSI endpoint may have returned a transient malformed response.","Verify the VM/service uses a supported managed identity endpoint version."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}