Solución de errores durante la implementación de la política de DecodeJWT
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Estás viendo la documentación de Apigee y Apigee Hybrid.
Consulta la documentación de Apigee Edge.
InvalidEmptyElement
Mensaje de error
La implementación del proxy de API a través de la IU o la API de Apigee falla con este mensaje de error:
Error Saving Revision
Invalid empty element : policy(policy_name) element(Source)
Ejemplo de mensaje de error
Error Saving Revision
Invalid empty element : policy(Decode_JWT) element(Source).
Captura de pantalla de ejemplo
En la IU de Apigee, verás un cuadro de diálogo con un error:
Causa
Este error se produce si la variable del flujo que contiene el JWT que se desea decodificar no se especifica en el elemento <Source> de la política de DecodeJWT.
Por ejemplo, el error se producirá si el elemento <Source> no contiene un valor, como se muestra a continuación:
<Source></Source>
Diagnóstico
Identifica el nombre de la política de DecodeJWT y el nombre del elemento vacío en el mensaje de error. Por ejemplo, en el siguiente mensaje de error, el nombre de la política de DecodeJWT es Decode_JWT y el nombre del elemento es Source.
Invalid empty element : policy(Decode_JWT) element(Source).
Examina la política de DecodeJWT y verifica si el elemento identificado en el paso 1 está vacío. Si el elemento está vacío, esta es la causa del error.
A continuación, se muestra una política de DecodeJWT de muestra:
Como el elemento <Source> está vacío, obtienes el siguiente error:
Invalid empty element : policy(Decode_JWT) element(Source).
Solución
Asegúrate de que el elemento <Source> especifique un JWT válido en una variable del flujo.
Para solucionar el problema con la política de DecodeJWT de muestra, puedes especificar la variable del flujo que contiene un JWT válido en el elemento <Source>.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-07 (UTC)"],[[["\u003cp\u003eThis documentation addresses an error encountered during API proxy deployment in Apigee or Apigee hybrid.\u003c/p\u003e\n"],["\u003cp\u003eThe error "Invalid empty element" occurs when the \u003ccode\u003e<Source>\u003c/code\u003e element in a DecodeJWT policy is empty.\u003c/p\u003e\n"],["\u003cp\u003eThe error message will specify the policy name and the empty element, such as \u003ccode\u003epolicy(Decode_JWT) element(Source)\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe issue is resolved by populating the \u003ccode\u003e<Source>\u003c/code\u003e element with a flow variable containing a valid JWT.\u003c/p\u003e\n"],["\u003cp\u003eTo diagnose, identify the policy and empty element from the error and then verify that element is empty in the policy definition.\u003c/p\u003e\n"]]],[],null,["*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/deployment/decode-JWT-deployment-errors) documentation.*\n| Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nInvalidEmptyElement\n\nError message\n\nDeployment of the API proxy through either the Apigee UI or API fails\nwith this error message: \n\n```scdoc\nError Saving Revision\nInvalid empty element : policy(policy_name) element(Source)\n```\n\nExample error message \n\n Error Saving Revision\n Invalid empty element : policy(Decode_JWT) element(Source).\n\nExample screenshot\n\nIn the Apigee UI, you will see a dialog box with an error:\n\nCause\n\nThis error occurs if the flow variable containing JWT that is to be decoded\nis not specified in the `\u003cSource\u003e` element of the DecodeJWT policy.\n\nFor example, the error will occur if the `\u003cSource\u003e` element does not contain a\nvalue, as shown below: \n\n \u003cSource\u003e\u003c/Source\u003e\n\nDiagnosis\n\n1. Identify the name of the DecodeJWT policy and name of the element that is empty from the error message. For example, in the following error message, the name of DecodeJWT policy is `Decode_JWT` and the element name is `Source`.\n\n ```scdoc\n Invalid empty element : policy(Decode_JWT) element(Source).\n ```\n2. Examine the DecodeJWT policy and verify if the element identified in Step 1 is empty. If the element is empty, then that's the cause of the error.\n\n Here's a sample DecodeJWT policy: \n\n \u003cDecodeJWT name=\"Decode_JWT\"\u003e\n \u003cDisplayName\u003eJWT Decode HS256\u003c/DisplayName\u003e\n \u003cSource\u003e\u003c/Source\u003e\n \u003cIgnoreUnresolvedVariables\u003efalse\u003c/IgnoreUnresolvedVariables\u003e\n \u003c/DecodeJWT\u003e\n\n Because the `\u003cSource\u003e` element is empty, you get the error: \n\n Invalid empty element : policy(Decode_JWT) element(Source).\n\nResolution\n\nEnsure that the `\u003cSource\u003e` element specifies a valid JWT in a flow variable.\n\nTo fix the issue with the sample DecodeJWT policy, you can specify the flow variable containing a valid JWT in the `\u003cSource\u003e` element. \n\n \u003cDecodeJWT name=\"Decode_JWT\"\u003e\n \u003cDisplayName\u003eJWT Decode HS256\u003c/DisplayName\u003e\n \u003cSource\u003evar.jwt\u003c/Source\u003e\n \u003cIgnoreUnresolvedVariables\u003efalse\u003c/IgnoreUnresolvedVariables\u003e\n \u003c/DecodeJWT\u003e"]]