{
"fault":{
"faultstring":"Failed to set variable variable_name in KeyValueMapStepDefinition policy_name",
"detail":{
"errorcode":"steps.keyvaluemapoperations.SetVariableFailed"
}
}
}
오류 메시지 예
{"fault":{"faultstring":"Failed to set variable myvar in KeyValueMapStepDefinition EncryptedKVM","detail":{"errorcode":"steps.keyvaluemapoperations.SetVariableFailed"}}}
원인
이 오류는 암호화된 키 값 맵에서 값을 검색하려 하고 이름에 private. 프리픽스가 없는 변수로 설정하려고 할 때 발생합니다. 디버깅 중 기본 보안 목적으로 필요한 프리픽스는 API 프록시 Trace 및 디버그 세션에서의 암호화된 값을 숨깁니다.
진단
1.
오류가 발생한 키 값 맵 작업 정책과 값을 설정할 수 없는 변수의 이름을 식별합니다. 두 항목 모두 오류 응답의 faultstring 요소에서 찾을 수 있습니다. 예를 들어 다음 faultstring에서 정책 이름은 EncryptedKVM이고 변수는 myvar입니다.
"faultstring":"Failed to set variable myvar in KeyValueMapStepDefinition EncryptedKVM"
1.
해당 키 값 매핑 작업 정책 XML에서 <Get> 키 요소의 assignTo 속성에 지정된 변수의 이름이 위 1단계의 오류 문자열에 식별된 변수 이름과 일치하는지 확인합니다. 예를 들어, 다음 키 값 맵 작업 정책은 faultstring의 내용과 일치하는 <Get> 요소에서 myvar라는 변수를 지정합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis document addresses troubleshooting for two specific errors related to Apigee's Key Value Map Operations policy: \u003ccode\u003eUnsupportedOperationException\u003c/code\u003e and \u003ccode\u003eSetVariableFailed\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUnsupportedOperationException\u003c/code\u003e error occurs when the \u003ccode\u003emapIdentifier\u003c/code\u003e attribute in a Key Value Map Operations policy is set to an empty string, which can be fixed by setting it to a valid key value map.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSetVariableFailed\u003c/code\u003e error happens when retrieving a value from an encrypted key value map and assigning it to a variable without the \u003ccode\u003eprivate.\u003c/code\u003e prefix, and resolving this involves adding the prefix to the variable name.\u003c/p\u003e\n"],["\u003cp\u003eTo identify if the \u003ccode\u003eSetVariableFailed\u003c/code\u003e error is caused by retrieving from an encrypted key value map you must look for a masked value in the UI using asterisks.\u003c/p\u003e\n"],["\u003cp\u003eThe document provides specific XML examples to illustrate both the error-causing configurations and the correct configurations to fix each issue.\u003c/p\u003e\n"]]],[],null,["# Key Value Map Operations runtime error troubleshooting\n\n*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/runtime/key-value-map-runtime-errors) documentation.*\n| **Note:** Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nUnsupportedOperationException\n-----------------------------\n\n### Error code\n\n java.lang.UnsupportedOperationException\n\n### Error response body\n\n {\n \"fault\":{\n \"faultstring\":\"java.lang.UnsupportedOperationException\",\n \"detail\":{\n \"errorcode\":\"Internal Server Error\"\n }\n }\n }\n\n### Cause\n\nThis error occurs if the `mapIdentifier` attribute is set to an empty string in the Key Value Map Operations policy.\n\n### Diagnosis\n\n1. Examine all the Key Value Map Operations policies in the specific API Proxy where the failure has occurred. If there is any Key Value Map Operations policy in which the `mapIdentifier` attribute is set as an empty string, then that's the cause of the error.\n\n For example, the following Key Value Map Operations policy has an empty `mapIdentifier`: \n\n \u003cKeyValueMapOperations async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"StoreKvm\" mapIdentifier=\"\"\u003e\n \u003cDisplayName\u003eStoreKvm\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cExclusiveCache\u003efalse\u003c/ExclusiveCache\u003e\n \u003cExpiryTimeInSecs\u003e300\u003c/ExpiryTimeInSecs\u003e\n \u003cPut override=\"true\"\u003e\n \u003cKey\u003e\n \u003cParameter ref=\"request.queryparam.key\"/\u003e\n \u003c/Key\u003e\n \u003cValue ref=\"request.queryparam.value\"/\u003e\n \u003c/Put\u003e\n \u003cScope\u003eenvironment\u003c/Scope\u003e\n \u003c/KeyValueMapOperations\u003e\n\n### Resolution\n\nEnsure the attribute `mapIdentifier` is set to a valid key value map in the Key Value Map Operations policy.\n\nTo correct the example policy shown above, you can specify the `mapIdentifier` to an existing key value map `UserLocationMap`. \n\n \u003cKeyValueMapOperations async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"StoreKvm\" mapIdentifier=\"UserLocationMap\"\u003e\n \u003cDisplayName\u003eStoreKvm\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cExclusiveCache\u003efalse\u003c/ExclusiveCache\u003e\n \u003cExpiryTimeInSecs\u003e300\u003c/ExpiryTimeInSecs\u003e\n \u003cPut override=\"true\"\u003e\n \u003cKey\u003e\n \u003cParameter ref=\"request.queryparam.key\"/\u003e\n \u003c/Key\u003e\n \u003cValue ref=\"request.queryparam.value\"/\u003e\n \u003c/Put\u003e\n \u003cScope\u003eenvironment\u003c/Scope\u003e\n \u003c/KeyValueMapOperations\u003e\n\nSetVariableFailed\n-----------------\n\n### Error code\n\n steps.keyvaluemapoperations.SetVariableFailed\n\n### Error response body\n\n```\n{\n \"fault\":{\n \"faultstring\":\"Failed to set variable variable_name in KeyValueMapStepDefinition policy_name\",\n \"detail\":{\n \"errorcode\":\"steps.keyvaluemapoperations.SetVariableFailed\"\n }\n }\n}\n```\n\n### Example Error Message\n\n {\n \"fault\":{\n \"faultstring\":\"Failed to set variable myvar in KeyValueMapStepDefinition EncryptedKVM\",\n \"detail\":{\n \"errorcode\":\"steps.keyvaluemapoperations.SetVariableFailed\"\n }\n }\n }\n\n### Cause\n\nThis error occurs if you try to retrieve a value from an encrypted key value map\nand set the value to a variable whose name does not have the prefix `private.`. The\nprefix, which is required for basic security purposes during debugging, hides the\nencrypted values from API proxy Trace and debug sessions.\n\n### Diagnosis\n\n1.\nIdentify the Key Value Map Operations policy where the error occurred and the name of the variable to which the value cannot be set. You can find both of these items in the `faultstring` element of the error response. For example, in the following `faultstring`, the policy name is `EncryptedKVM` and the variable is `myvar`: \n\n \"faultstring\":\"Failed to set variable myvar in KeyValueMapStepDefinition EncryptedKVM\"\n\n1.\nIn the failed Key Value Map Operations policy XML, verify that the name of the variable specified in the **`assignTo`** attribute of the `\u003cGet\u003e` element matches the variable name identified in the fault string (step #1 above). For example, the following Key Value Map Operations policy specifies a variable named `myvar` in the `\u003cGet\u003e` element, which matches what's in the `faultstring`: \n\n \u003cKeyValueMapOperations async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"Key-Value-Map-Operations-1\" mapIdentifier=\"testEncrypted\"\u003e\n \u003cDisplayName\u003eKeyValueMapOperations-1\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cExclusiveCache\u003efalse\u003c/ExclusiveCache\u003e\n \u003cExpiryTimeInSecs\u003e300\u003c/ExpiryTimeInSecs\u003e\n \u003cGet assignTo=\"myvar\" index=\"1\"\u003e\n \u003cKey\u003e\n \u003cParameter\u003efoo\u003c/Parameter\u003e\n \u003c/Key\u003e\n \u003c/Get\u003e\n \u003cScope\u003eenvironment\u003c/Scope\u003e\n \u003c/KeyValueMapOperations\u003e\n\n1. Check if the key value map specified in the `mapIdentifier` attribute is an encrypted KVM.\n\n To check if a KVM is encrypted in the Apigee UI:\n 1. In the Apigee UI, click **Admin** in the left navigation menu.\n 2. Click **Environments**.\n 3. Click **Key Value Maps**.\n 4. Find the Key Value Map you want to use.\n 5. Click the arrow to the left of the name to expand the list of values.\n 6. Encrypted Key Value Maps display values masked with asterisks in the UI (\\*\\*\\*\\*\\*) as shown in [About encrypted KVMs](/apigee/docs/api-platform/cache/key-value-maps#aboutencrypted).\n2. If the key value map is an encrypted KVM and the variable name used in the\n `assignTo` attribute of the `\u003cGet\u003e` element does not have the prefix `private`.\n Then that's the cause for the error.\n\n In the example Key Value Map Operations policy shown above, the key value map `testEncrypted` is encrypted and the variable name `myvar` does not have the prefix `private`. Hence you receive the error code: \n\n steps.keyvaluemapoperations.SetVariableFailed\n\n### Resolution\n\nEnsure that the variable name has the prefix `private.` in the `assignTo` attribute\nof the `\u003cGet\u003e` element in Key Value Map Operations policy if the key value map\nused is encrypted.\n\nTo correct the example Key Value Map Operations policy shown above, you can modify\nthe value of the attribute `assignTo` to `private.myvar`: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cKeyValueMapOperations async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"Key-Value-Map-Operations-1\" mapIdentifier=\"testEncrypted\"\u003e\n \u003cDisplayName\u003eKeyValueMapOperations-1\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cExclusiveCache\u003efalse\u003c/ExclusiveCache\u003e\n \u003cExpiryTimeInSecs\u003e300\u003c/ExpiryTimeInSecs\u003e\n \u003cGet assignTo=\"private.myvar\" index=\"1\"\u003e\n \u003cKey\u003e\n \u003cParameter\u003efoo\u003c/Parameter\u003e\n \u003c/Key\u003e\n \u003c/Get\u003e\n \u003cScope\u003eenvironment\u003c/Scope\u003e\n \u003c/KeyValueMapOperations\u003e"]]