예를 들어 Assign Message 정책이 요청 흐름에서 실행되지만 <Copy> 요소의 source 속성이 response 또는 error 변수 또는 요청 흐름에 존재하지 않는 다른 커스텀 변수로 설정된 경우 이 오류가 발생합니다.
진단
오류가 발생한 Assign Message 정책 및 사용할 수 없는 변수의 이름을 확인합니다. 두 항목은 모두 오류 응답의 faultstring 요소에서 찾을 수 있습니다.
예를 들어 다음 faultstring에서 정책 이름은 googleBook이고 변수는 var입니다.
"faultstring":"AssignMessage[googleBook]: unable to resolve variable var"
실패한 Assign Message 정책 XML에서 사용된 변수 이름이 위 1단계의 오류 문자열에서 식별된 변수 이름과 일치하는지 확인합니다. 예를 들어 다음 정책은 <Copy> 요소의 소스 속성을 faultstring에 있는 내용과 일치하는 var라는 변수로 설정합니다.
변수가 Assign Message 정책이 실행되는 흐름에서 정의되고 사용 가능한지 확인합니다.
변수가 다음 중 하나인 경우
범위를 벗어난 경우(정책이 실행 중인 특정 흐름에서 사용할 수 없음)
확인할 수 없는 경우(정의되지 않음)
이는 오류의 원인이 됩니다.
예를 들어 위에 표시된 Assign Message 정책이 요청 흐름에서 실행된다고 가정해 보겠습니다. 요청 흐름의 Assign Message 정책 이전에 실행된 정책에 var 변수가 정의되어 있는지 확인합니다. 변수가 정의되지 않은 경우 다음과 같은 오류 코드가 표시됩니다.
steps.assignmessage.UnresolvedVariable
해결 방법
정책에서 참조하는 변수가 존재하고 Assign Message 정책이 실행되는 특정 흐름에서 사용할 수 있는지 확인합니다.
위의 예시 정책을 수정하려면 <Copy> 요소의 소스 속성을 요청 변수로 수정하거나 요청 흐름에 있는 다른 메시지 유형의 커스텀 변수로 수정하면 됩니다.
{"fault":{"faultstring":"AssignMessage[policy_name]: value of variable [variable] is not of type Message","detail":{"errorcode":"steps.assignmessage.VariableOfNonMsgType"}}}
원인
이 오류는 <Copy> 요소의 source 속성이 메시지 유형이 아닌 변수로 설정된 경우에 발생합니다.
메시지 유형 변수는 전체 HTTP 요청 및 응답을 나타냅니다. 기본 제공 흐름 변수 request, response, message는 메시지 유형입니다. message 변수에 대한 자세한 내용은 변수 참조를 확인하세요.
진단
오류가 발생한 Assign Message 정책 및 유형이 잘못된 변수 이름을 식별합니다. 두 항목은 모두 오류 응답의 faultstring 요소에서 찾을 수 있습니다. 예를 들어 다음 faultstring에서 정책 이름은 GenerateGeocodingRequest이고 변수는 PostalCode입니다.
"faultstring":"AssignMessage[GenerateGeocodingRequest]: value of variable PostalCode is not of type Message"
실패한 Assign Message 정책 XML에서 <Copy> 요소에 설정된 변수 이름이 위의 1단계의 오류 문자열에서 식별된 변수 이름과 일치하는지 확인합니다. 예를 들어 다음 정책은 소스 속성을 faultstring의 내용과 일치하는 PostalCode라는 변수로 설정합니다.
PostalCode는 메시지 유형이 아니므로(이 예시에서는 문자열) 다음과 같은 오류 코드를 받게 됩니다.
steps.assignmessage.VariableOfNonMsgType
해결 방법
실패한 Assign Message 정책의 <Copy> 요소에 있는 source 속성이 존재하는 메시지 유형 흐름 변수로 설정되어 있는지 확인합니다.
정책을 수정하려면 <Copy> 요소에서 source 속성을 수정하여 메시지 유형의 변수를 지정하면 됩니다. 예를 들어 요청 흐름에서 Assign Message 정책을 실행해야 하는 경우 메시지 유형 변수 request 또는 메시지 유형의 다른 커스텀 변수를 사용할 수 있습니다.
[[["이해하기 쉬움","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 documentation focuses on troubleshooting two specific errors within the Apigee Assign Message policy: \u003ccode\u003esteps.assignmessage.UnresolvedVariable\u003c/code\u003e and \u003ccode\u003esteps.assignmessage.VariableOfNonMsgType\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esteps.assignmessage.UnresolvedVariable\u003c/code\u003e error occurs when a variable referenced in the Assign Message policy is not defined or is out of scope in the current flow, requiring a review of variable definition and flow context.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esteps.assignmessage.VariableOfNonMsgType\u003c/code\u003e error arises when the \u003ccode\u003esource\u003c/code\u003e attribute in the \u003ccode\u003e<Copy>\u003c/code\u003e element refers to a variable that is not of the message type, which requires ensuring it is set to a message-type variable such as \u003ccode\u003erequest\u003c/code\u003e, \u003ccode\u003eresponse\u003c/code\u003e, or any other custom variable of type message.\u003c/p\u003e\n"],["\u003cp\u003eTo resolve the \u003ccode\u003eUnresolvedVariable\u003c/code\u003e error, ensure the variable exists and is within the scope of the policy's execution flow; to resolve \u003ccode\u003eVariableOfNonMsgType\u003c/code\u003e, use a message-type variable for the source attribute.\u003c/p\u003e\n"],["\u003cp\u003eThe main error context in question can be resolved by checking the policy, the variables, the flow, and adjusting the policy with either a defined variable or a message type variable.\u003c/p\u003e\n"]]],[],null,["# Assign Message 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/assign-message-runtime-errors) documentation.*\n| **Note:** Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nUnresolvedVariable\n------------------\n\n### Error code\n\n steps.assignmessage.UnresolvedVariable\n\n### Error response body\n\n```transact-sql\n{\n \"fault\": {\n \"faultstring\": \"AssignMessage[\u003cvar translate=\"no\"\u003epolicy_name\u003c/var\u003e]: unable to resolve variable [\u003cvar translate=\"no\"\u003evariable_name\u003c/var\u003e]\",\n \"detail\": {\n \"errorcode\": \"steps.assignmessage.UnresolvedVariable\"\n }\n }\n}\n```\n\n### Cause\n\nThis error occurs if a variable specified in the [Assign Message policy](/apigee/docs/api-platform/reference/policies/assign-message-policy) is either:\n\n- out of scope (not available in the specific flow where the policy is being executed) or\n- can't be resolved (is not defined)\n\nFor example, this error occurs if the Assign Message policy executes in the request flow, but the `source` attribute in the `\u003cCopy\u003e` element is set to the `response` or `error` variable or any other custom variable that does not exist in the request flow.\n\n### Diagnosis\n\n1. Identify the Assign Message Policy where the error occurred and the name of the variable that is not available. You can find both of these items in the `faultstring` element of the error response.\n\n For example, in the following `faultstring`, the policy name is `googleBook` and the variable is `var`: \n\n \"faultstring\": \"AssignMessage[googleBook]: unable to resolve variable var\"\n\n2. In the failed Assign Message Policy XML, verify that the name of the variable used matches the variable name identified in the fault string (step #1 above). For example, the following policy sets the source attribute in the `\u003cCopy\u003e` element to a variable named `var`, which matches what's in the `faultstring`:\n\n \u003cAssignMessage async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"Assign-Message-1\"\u003e\n \u003cDisplayName\u003egoogleBook\u003c/DisplayName\u003e\n \u003cProperties /\u003e\n \u003cCopy source=\"var\"\u003e\n \u003cHeaders\u003e\n \u003cHeader name=\"user-agent\" /\u003e\n \u003c/Headers\u003e\n \u003c/Copy\u003e\n \u003cIgnoreUnresolvedVariables\u003efalse\u003c/IgnoreUnresolvedVariables\u003e\n \u003cAssignTo createNew=\"true\" transport=\"http\" type=\"request\"\u003egoogleBookReq\u003c/AssignTo\u003e\n \u003c/AssignMessage\u003e\n\n3. Determine if the variable is defined and available in the flow in which the Assign Message policy is being executed.\n\n4. If the variable is either:\n\n 1. out of scope (not available in the specific flow where the policy is being executed) or\n 2. can't be resolved (is not defined)\n\n then that's the cause for the error.\n\n As an example, let's say the Assign Message policy shown above executes in the request flow. Check if the variable `var` is defined in any of the policies that are executed before the Assign Message policy in the request flow. If the variable has not been defined, then you will receive the error code: \n\n steps.assignmessage.UnresolvedVariable\n\n### Resolution\n\nEnsure that the variable referenced in the policy exists and is available in the specific flow, where the Assign Message policy is being executed.\n\nTo correct the example policy shown above, you can modify the source attribute in the `\u003cCopy\u003e` element to be the request variable or any other custom variable of type message that exists in the request flow. \n\n \u003cAssignMessage async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"Assign-Message-1\"\u003e\n \u003cDisplayName\u003egoogleBook\u003c/DisplayName\u003e\n \u003cProperties /\u003e\n \u003cCopy source=\"request\"\u003e\n \u003cHeaders\u003e\n \u003cHeader name=\"user-agent\" /\u003e\n \u003c/Headers\u003e\n \u003c/Copy\u003e\n \u003cIgnoreUnresolvedVariables\u003efalse\u003c/IgnoreUnresolvedVariables\u003e\n \u003cAssignTo createNew=\"true\" transport=\"http\" type=\"request\"\u003egoogleBookReq\u003c/AssignTo\u003e\n \u003c/AssignMessage\u003e\n\nVariableOfNonMsgType\n--------------------\n\n### Error code\n\n steps.assignmessage.VariableOfNonMsgType\n\n### Error response body\n\n```transact-sql\n{\n \"fault\": {\n \"faultstring\": \"AssignMessage[\u003cvar translate=\"no\"\u003epolicy_name\u003c/var\u003e]: value of variable [\u003cvar translate=\"no\"\u003evariable\u003c/var\u003e] is not of type Message\",\n \"detail\": {\n \"errorcode\": \"steps.assignmessage.VariableOfNonMsgType\"\n }\n }\n}\n```\n\n### Cause\n\nThis error occurs if the `source` attribute in the `\u003cCopy\u003e` element is set to a variable which is not of type [message](/apigee/docs/api-platform/reference/variables-reference#messagevariables).\n\nMessage type variables represent entire HTTP requests and responses. The built-in flow variables `request`, `response`, and `message` are of type message. To learn more about message variables, see the [Variables reference](/apigee/docs/api-platform/reference/variables-reference#messagevariables).\n\n### Diagnosis\n\n1. Identify the Assign Message Policy where the error occurred and the name of the variable whose type is incorrect. 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 `GenerateGeocodingRequest` and the variable is `PostalCode`:\n\n \"faultstring\": \"AssignMessage[GenerateGeocodingRequest]: value of variable PostalCode is not of type Message\"\n\n2. In the failed Assign Message Policy XML, verify that the name of the variable set in the `\u003cCopy\u003e` element matches the variable name identified in the fault string (step #1 above). For example, the following policy sets a source attribute to a variable named `PostalCode`, which matches what's in the `faultstring`:\n\n \u003cAssignMessage name=\"GenerateGeocodingRequest\"\u003e\n \u003cAssignTo createNew=\"true\" type=\"request\"\u003eGeocodingRequest\u003c/AssignTo\u003e\n \u003cAssignVariable\u003e\n \u003cName\u003ePostalCode\u003c/Name\u003e\n \u003cRef\u003erequest.queryparam.postalcode\u003c/Ref\u003e\n \u003c/AssignVariable\u003e\n \u003cAssignVariable\u003e\n \u003cName\u003eCountry\u003c/Name\u003e\n \u003cRef\u003erequest.queryparam.country\u003c/Ref\u003e\n \u003c/AssignVariable\u003e\n \u003cCopy source=\"PostalCode\"\u003e\n \u003cQueryParams\u003e\n \u003cQueryParam name=\"q\" /\u003e\n \u003c/QueryParams\u003e\n \u003c/Copy\u003e\n \u003c/AssignMessage\u003e\n\n3. Determine if this variable is of type message or not:\n\n 1. Locate the code within the API Proxy bundle, where the variable was defined first.\n 2. Once you figure out the policy in which the variable is defined and populated first, you need to determine the type of that variable as follows:\n 1. Check the value of the type attribute (if present).\n 2. If the type attribute is not present, then the variable is considered to be a string.\n 3. If the variable's type is non-message (such as a string), then that's the cause of the error. You can learn about common variables and their types in the [Variables reference](/apigee/docs/api-platform/reference/variables-reference).\n\n For example, look at the PostalCode variable in the above XML. It is assigned the value of the flow variable `request.queryparam.postalcode` in the `\u003cAssignVariable\u003e` element. This value is a string, because there is no type attribute present in the variable assignment.\n\n Now, recall that the PostalCode variable is used in the `\u003cCopy\u003e` element of the Assign Message policy: \n\n \u003cCopy source=\"PostalCode\"\u003e\n \u003cQueryParams\u003e\n \u003cQueryParam name=\"PostalCode\" /\u003e\n \u003c/QueryParams\u003e\n \u003c/Copy\u003e\n\n Because PostalCode is not of type message (it's a string in this example), you receive the error code: \n\n steps.assignmessage.VariableOfNonMsgType\n\n### Resolution\n\nEnsure that the `source` attribute in the `\u003cCopy\u003e` element in the failed Assign Message policy is set to a [message](/apigee/docs/api-platform/reference/variables-reference#messagevariables) type flow variable that exists.\n\nTo correct the policy, you can modify the `source` attribute in the `\u003cCopy\u003e` element to specify a variable that is of type message. For example, if the Assign Message policy is supposed to execute in the request flow, then you could use the message type variable `request` or any other custom variable of type message. \n\n \u003cAssignMessage name=\"GenerateGeocodingRequest\"\u003e\n \u003cAssignTo createNew=\"true\" type=\"request\"\u003eGeocodingRequest\u003c/AssignTo\u003e\n \u003cAssignVariable\u003e\n \u003cName\u003ePostalCode\u003c/Name\u003e\n \u003cRef\u003erequest.queryparam.postalcode\u003c/Ref\u003e\n \u003c/AssignVariable\u003e\n \u003cAssignVariable\u003e\n \u003cName\u003eCountry\u003c/Name\u003e\n \u003cRef\u003erequest.queryparam.country\u003c/Ref\u003e\n \u003c/AssignVariable\u003e\n \u003cCopy source=\"request\"\u003e\n \u003cQueryParams\u003e\n \u003cQueryParam name=\"PostalCode\" /\u003e\n \u003c/QueryParams\u003e\n \u003c/Copy\u003e\n \u003c/AssignMessage\u003e"]]