Solução de problemas de erro na implantação da política DecodeJWT
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Esta é a documentação da Apigee e da Apigee híbrida.
Confira a documentação da Apigee Edge.
InvalidEmptyElement
Mensagem de erro
A implantação do proxy da API por meio da IU da Apigee ou da API falha
com esta mensagem de erro:
Error Saving Revision
Invalid empty element : policy(policy_name) element(Source)
Exemplo de mensagem de erro
Error Saving Revision
Invalid empty element : policy(Decode_JWT) element(Source).
Exemplo de captura de tela
Na IU da Apigee, você verá uma caixa de diálogo com um erro:
Causa
Esse erro ocorre se a variável de fluxo que contém o JWT a ser decodificada
não for especificada no elemento <Source> da política DecodeJWT.
Por exemplo, o erro ocorrerá se o elemento <Source> não contiver um
valor, conforme mostrado abaixo:
<Source></Source>
Diagnóstico
Identifique o nome da política DecodeJWT e o nome do elemento que está vazio na mensagem de erro. Por exemplo, na mensagem de erro a seguir, o nome da política DecodeJWT é Decode_JWT e o nome do elemento é Source.
Invalid empty element : policy(Decode_JWT) element(Source).
Analise a política de Decodificar JWT e verifique se o elemento identificado na Etapa 1 está vazio. Se o elemento estiver vazio, essa é a causa do erro.
Como o elemento <Source> está vazio, você recebe o erro:
Invalid empty element : policy(Decode_JWT) element(Source).
Resolução
Verifique se o elemento <Source> especifica um JWT válido em uma variável de fluxo.
Para corrigir o problema com a política de exemplo de decodificação de JWT, especifique a variável de fluxo que contém um JWT válido no elemento <Source>.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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"]]