Risoluzione dei problemi di errore di deployment del criterio DecodeJWT
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Stai visualizzando la documentazione di Apigee e Apigee hybrid.
Visualizza la documentazione di
Apigee Edge.
InvalidEmptyElement
Messaggio di errore
Il deployment del proxy API tramite l'API o l'interfaccia utente di Apigee non va a buon fine con questo messaggio di errore:
Error Saving Revision
Invalid empty element : policy(policy_name) element(Source)
Esempio di messaggio di errore
Error Saving Revision
Invalid empty element : policy(Decode_JWT) element(Source).
Screenshot di esempio
Nell'interfaccia utente di Apigee viene visualizzata una finestra di dialogo con un errore:
Causa
Questo errore si verifica se la variabile di flusso contenente il JWT da decodificare non è specificata nell'elemento <Source> del criterio DecodeJWT.
Ad esempio, l'errore si verifica se l'elemento <Source> non contiene un valore, come mostrato di seguito:
<Source></Source>
Diagnosi
Identifica il nome del criterio DecodeJWT e il nome dell'elemento vuoto dal messaggio di errore. Ad esempio, nel seguente messaggio di errore, il nome del criterio DecodeJWT è Decode_JWT e il nome dell'elemento è Source.
Invalid empty element : policy(Decode_JWT) element(Source).
Esamina il criterio DecodeJWT e verifica se l'elemento identificato nel passaggio 1 è vuoto. Se l'elemento è vuoto, è la causa dell'errore.
Poiché l'elemento <Source> è vuoto, viene visualizzato l'errore:
Invalid empty element : policy(Decode_JWT) element(Source).
Risoluzione
Assicurati che l'elemento <Source> specifichi un JWT valido in una variabile di flusso.
Per risolvere il problema relativo al criterio DecodeJWT di esempio, puoi specificare la variabile di flusso contenente un JWT valido nell'elemento <Source>.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 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,["# DecodeJWT policy deployment error troubleshooting\n\n*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-------------------\n\n### Error 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\n### Example error message\n\n Error Saving Revision\n Invalid empty element : policy(Decode_JWT) element(Source).\n\n### Example screenshot\n\nIn the Apigee UI, you will see a dialog box with an error:\n\n### Cause\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\n### Diagnosis\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\n### Resolution\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"]]