이 오류는 <Rate> 요소 내에 속도 설정이 포함된 변수의 참조를 급증 저지 정책에서의 값으로 확인할 수 없는 경우에 발생합니다. 이 요소는 필수이며 {int}pm 또는 {int}ps 형식으로 급증 저지 속도를 지정하는 데 사용됩니다. 예를 들어 {int}pm는 500pm일 수 있으며, 이는 분당 호출 500회을 의미합니다. 마찬가지로 10ps 값은 초당 호출 10회를 의미합니다.
진단
오류가 발생한 급증 저지 정책과 제대로 확인할 수 없는 참조의 이름을 확인합니다. 두 항목은 모두 오류 응답의 faultstring 요소에서 찾을 수 있습니다.
예를 들어 다음 faultstring에서 정책 이름은 SpikeArrest_AuthProxy이고 참조는 request.header.rate입니다.
"faultstring": "Failed to resolve Spike Arrest Rate reference request.header.rate in SpikeArrest policy SpikeArrest_AuthProxy"
실패한 급증 저지 정책 XML에서, 사용된 참조 이름이 오류 문자열(위의 1단계)에서 식별된 참조 이름과 일치하는지 확인합니다. ** **
예를 들어 다음 정책은 faultstring에서 식별된 이름과 일치하는 request.header.rate라는 참조가 있는 요소를 설정합니다.
위에 표시된 예시에서 <Rate> 요소의 급증 저지 속도 값은 rate라는 요청 헤더에서 검색되어야 합니다.
하지만 Apigee는 request.header.rate를 확인할 수 없습니다. 이 문제는 헤더 rate가 API 요청의 일부로 전달되지 않은 경우에 발생합니다.
[[["이해하기 쉬움","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-08-18(UTC)"],[[["\u003cp\u003eThis documentation covers troubleshooting for two specific error codes within Apigee and Apigee hybrid environments: \u003ccode\u003epolicies.ratelimit.InvalidMessageWeight\u003c/code\u003e and \u003ccode\u003epolicies.ratelimit.FailedToResolveSpikeArrestRate\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epolicies.ratelimit.InvalidMessageWeight\u003c/code\u003e error occurs when a non-integer value is used for the \u003ccode\u003e<MessageWeight>\u003c/code\u003e element within a Spike Arrest policy, which can be diagnosed by examining the \u003ccode\u003efaultstring\u003c/code\u003e and the definition of the message weight variable.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epolicies.ratelimit.FailedToResolveSpikeArrestRate\u003c/code\u003e error happens when the \u003ccode\u003e<Rate>\u003c/code\u003e element in a Spike Arrest policy refers to a variable that is undefined or not available in the current flow, and its diagnosis involves identifying the unresolved reference and verifying its availability in the flow.\u003c/p\u003e\n"],["\u003cp\u003eResolving the \u003ccode\u003eInvalidMessageWeight\u003c/code\u003e error involves ensuring that the \u003ccode\u003e<MessageWeight>\u003c/code\u003e value is an integer, while fixing the \u003ccode\u003eFailedToResolveSpikeArrestRate\u003c/code\u003e error requires verifying that the referenced variable within \u003ccode\u003e<Rate>\u003c/code\u003e is defined and accessible in the policy's execution flow.\u003c/p\u003e\n"],["\u003cp\u003eThe rate for the spike arrest policy is to be of the format {int}pm or {int}ps, for instance, 500pm or 10ps.\u003c/p\u003e\n"]]],[],null,["*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/runtime/spike-arrest-runtime-errors) documentation.*\n| **Note:** Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nInvalidMessageWeight\n\nError code \n\n policies.ratelimit.InvalidMessageWeight\n\nError response body \n\n```transact-sql\n{\n \"fault\": {jdoe\n \"faultstring\": \"Invalid message weight value [\u003cvar translate=\"no\"\u003einvalid_value\u003c/var\u003e]\",\n \"detail\": {\n \"errorcode\": \"policies.ratelimit.InvalidMessageWeight\"\n }\n }\n}\n```\n\n**Example Error Message** \n\n```text\n{\n \"fault\": {\n \"faultstring\": \"Invalid message weight value 1.5\",\n \"detail\": {\n \"errorcode\": \"policies.ratelimit.InvalidMessageWeight\"\n }\n }\n}\n```\n\nCause\n\nThis error occurs if the value specified for the `\u003cMessageWeight\u003e` element through\na flow variable is invalid (a non-integer value).\n\nFor example, if the value of the flow variable specified for the `\u003cMessageWeight\u003e`\nelement is 1.5 (a non-integer value), then the error occurs.\n\nDiagnosis\n\n1. Identify the invalid value used for the `\u003cMessageWeight\u003e` element in the Spike\n Arrest policy. You can find this information in the `faultstring` element of the\n error response. For example, in the following error, the invalid value used for\n `\u003cMessageWeight\u003e` element is `1.5`:\n\n \"faultstring\": \"Invalid message weight value 1.5\"\n\n2. Examine all the Spike Arrest policies in the specific API Proxy where the\n failure has occurred. There could be one or more Spike Arrest policies in which\n the `\u003cMessageWeight\u003e` element is specified.\n\n For example, the following policy specifies the value of `\u003cMessageWeight\u003e`\n through a flow variable called `message_weight:` \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cSpikeArrest async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"SpikeArrest_AuthProxy\"\u003e\n \u003cDisplayName\u003eSpikeArrest_AuthProxy\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cIdentifier ref=\"request.header.some-header-name\"/\u003e\n \u003cRate\u003e100ps\u003c/Rate\u003e\n \u003cMessageWeight ref=\"message_weight\"/\u003e\n \u003c/SpikeArrest\u003e\n\n3. Determine the value of the variable used in the `\u003cMessageWeight\u003e` element of\n the identified Spike Arrest Policy(ies). The value of the flow variable can be\n extracted from HTTP headers, query parameters, an XML or JSON request payload,\n or defined in another policy.\n\n 1. Locate the code within the API proxy, where the variable was defined first.\n 2. Once you figure out the policy in which the variable is defined and populated first, check how the value for the variable is set.\n 3. If the value of the flow variable matches the value identified in Step #1 above, then that's the cause of the error.\n\n For example, assume that a JavaScript policy is used before the Spike Arrest\n Policy to set the variable `message_weight` based on the request method as\n shown below: \n\n var verb = context.getVariable(\"request.verb\");\n context.setVariable(\"message_weight\", \"1.5\");\n if (verb == 'POST') {\n context.setVariable(\"message_weight\", \"2\");\n }\n\n Notice that the value of the variable `message_weight` is `1.5` which is\n invalid (a non-integer) value.\n\nResolution\n\nEnsure that the value of the `MessageWeight` element is a valid value (integer\nvalue).\n\nTo correct the example shown above, you can modify the value of the variable\n`message_weight` in the JavaScript to be an integer: \n\n var verb = context.getVariable(\"request.verb\");\n context.setVariable(\"message_weight\", \"1\");\n if (verb == 'POST') {\n context.setVariable(\"message_weight\", \"2\");\n }\n\nFailedToResolveSpikeArrestRate\n\nError code \n\n policies.ratelimit.FailedToResolveSpikeArrestRate\n\nError response body \n\n```transact-sql\n{\n \"fault\": {\n \"faultstring\": \"Failed to resolve Spike Arrest Rate reference [\u003cvar translate=\"no\"\u003ereference\u003c/var\u003e] in SpikeArrest policy [\u003cvar translate=\"no\"\u003eapi_policy\u003c/var\u003e]\",\n \"detail\": {\n \"errorcode\": \"policies.ratelimit.FailedToResolveSpikeArrestRate\"\n }\n }\n}\n```\n\n**Example Error Message** \n\n```scdoc\n{\n \"fault\": {\n \"faultstring\": \"Failed to resolve Spike Arrest Rate reference request.header.rate in SpikeArrest policy SpikeArrest_AuthProxy\",\n \"detail\": {\n \"errorcode\": \"policies.ratelimit.FailedToResolveSpikeArrestRate\"\n }\n }\n}\n```\n\nCause\n\nThis error occurs if the reference to the variable containing the rate setting\nwithin the `\u003cRate\u003e` element cannot be resolved to a value within the Spike Arrest\npolicy. This element is mandatory and used to specify the spike arrest rate in\nthe form of `{int}pm` or `{int}ps`. For example, `{int}pm` might be `500pm`,\nwhich means 500 calls per minute. Likewise, a value of `10ps` means 10 calls per\nsecond.\n\nDiagnosis\n\n1. Identify the Spike Arrest policy where the error occurred and the name of\n the reference that cannot be resolved properly. You can find both of these items\n in the faultstring element of the error response.\n\n For example, in the following faultstring, the policy name is\n `SpikeArrest_AuthProxy` and the reference is `request.header.rate`: \n\n \"faultstring\": \"Failed to resolve Spike Arrest Rate reference request.header.rate in SpikeArrest policy SpikeArrest_AuthProxy\"\n\n2. In the failed Spike Arrest policy XML, verify that the name of the reference\n used matches the reference name identified in the fault string (step #1 above). \\*\\* \\*\\*\n\n For example, the following policy sets the element with the reference named `request.header.rate`, which matches what's in the faultstring: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cSpikeArrest async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"SpikeArrest_AuthProxy\"\u003e\n \u003cDisplayName\u003eSpikeArrest_AuthProxy\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cIdentifier ref=\"request.header.some-header-name\"/\u003e\n \u003cRate ref=\"request.header.rate\"/\u003e\n \u003c/SpikeArrest\u003e\n\n3. Determine if the variable is defined and available in the flow in which the\n Spike Arrest policy is being executed.\n\n4. If the variable 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\n then that's the cause for the error.\n\n In the example shown above, the value of the spike arrest rate in the `\u003cRate\u003e`\n element is supposed to be retrieved from the request header named **rate** .\n However, Apigee is unable to resolve the **request.header.rate** . This happens\n if the header **rate** is not passed as part of the API request.\n\n Here's a sample API request that does not pass the header **rate** as part of\n the request: \n\n ```\n curl -v http://your_host_alias/check_spikearrest -H \"Content-Type: application/json\"\n ```\n\n\n Where \u003cvar translate=\"no\"\u003eyour_host_alias\u003c/var\u003e is a publicly facing domain used to access your APIs,\n as configured in the `virtualhosts.hostAliases` property in your overrides file.\n See [Specify configuration\n overrides](/apigee/docs/hybrid/latest/2-6-install-configure-cluster#specify-configuration-overrides).\n\n \u003cbr /\u003e\n\n Since the header **rate** is not passed as part of the request, reference\n **request.header.rate** used in the element `\u003cRate\u003e` in the above Spike\n Arrest policy is undefined and hence cannot be resolved. So you will receive\n the error code: \n\n policies.ratelimit.FailedToResolveSpikeArrestRate\n\nResolution\n\nEnsure that the variable referenced in the `\u003cRate\u003e` element exists/is defined\nand available in the specific flow, where the Spike Arrest policy is being executed.\n\nTo correct the example shown above, you can modify the request to include the **rate** header as shown below: \n\n```\ncurl -v http://your_host_alias/check_spikearrest -H \"Content-Type: application/json\" -H \"rate:30ps\"\n```\n\n\nWhere \u003cvar translate=\"no\"\u003eyour_host_alias\u003c/var\u003e is a publicly facing domain used to access your APIs,\nas configured in the `virtualhosts.hostAliases` property in your overrides file.\nSee [Specify configuration\noverrides](/apigee/docs/hybrid/latest/2-6-install-configure-cluster#specify-configuration-overrides).\n\n\u003cbr /\u003e"]]