다음 오류 메시지와 함께 Apigee UI 또는 API를 통한 API 프록시의 배포가 실패합니다.
Error in deployment for environment [environment]
The revision is deployed, but traffic cannot flow.
AssignMessage[policy_name]: index must be greater than zero in [attribute].[index]
그런 다음 다음과 같이 HTTPModifier 정책에서 색인 번호 0, 1, 2를 사용하여 이러한 쿼리 매개변수에 액세스하려 한다고 가정해 보겠습니다.
id.0
id.1 and
id.2
이 경우에는 색인이 1로 시작해야 하므로 프록시 배포가 실패합니다. 즉, 첫 번째 쿼리 매개변수인 'id=1'에 'id.1'로 액세스할 수 있습니다. 두 번째 쿼리 매개변수인 'id=2'에 액세스하려면 색인 2, 즉 'id.2'를 사용해야 합니다. 마찬가지로 세 번째 쿼리 매개변수인 'id=3'에 액세스하려면 'id.3'을 사용할 수 있습니다.
[[["이해하기 쉬움","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\u003eAPI proxy deployment in Apigee X can fail with an "index must be greater than zero" error when using the HTTPModifier policy.\u003c/p\u003e\n"],["\u003cp\u003eThis error occurs if the \u003ccode\u003e<Copy>\u003c/code\u003e or \u003ccode\u003e<Remove>\u003c/code\u003e elements within the HTTPModifier policy attempt to access indexed flow variables with an index of 0 or a negative number.\u003c/p\u003e\n"],["\u003cp\u003eThe index in the HTTPModifier policy, when dealing with parameters that share the same name, must start at 1, not 0.\u003c/p\u003e\n"],["\u003cp\u003eTo resolve this, verify the index in the failing HTTPModifier policy, ensure that it is a positive number greater than zero, and adjust the index accordingly in the policy definition.\u003c/p\u003e\n"]]],[],null,["# HTTPModifier policy deployment error troubleshooting\n\n*You're viewing **Apigee X** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/deployment/assign-message-deployment-errors) documentation.*\n| Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nInvalidIndex\n------------\n\n### Error message\n\nDeployment of the API proxy through either the Apigee UI or API fails with this error message: \n\n```\nError in deployment for environment [environment]\nThe revision is deployed, but traffic cannot flow.\nAssignMessage[policy_name]: index must be greater than zero in [attribute].[index]\n```\n\n**Example error message** \n\n Error in deployment for environment test.\n The revision is deployed, but traffic cannot flow.\n HTTPModifier[GenerateStudentsRequest]: index must be greater than zero in id.0\n\n### Cause\n\nIf the index specified in the `\u003cCopy\u003e` and/or `\u003cRemove\u003e` elements of the HTTPModifier policy is 0 or a negative number, then deployment of the API Proxy fails.\n\nFor example, if you pass multiple query parameters with the same name, you can access them as indexed flow variables. Let's say you want to pass the IDs of 3 students as query parameters, then you can do it as follows: \n\n https://$EXTERNAL_IP/$PROXY_BASEPATH?school_name=NPS&id=1&id=2&id=3\n\nThen, let's say you attempt to access these query parameters with index numbers 0, 1, and 2 in the HTTPModifier policy as follows: \n\n id.0\n id.1 and\n id.2\n\nIn this case, the deployment of the proxy fails because the index must start with 1. This means, you can access the first query parameter \"id=1\" as \"id.1\". To access the second query parameter \"id=2\", you need to use the index 2 i.e, \"id.2\". Similarly, to access the third query parameter \"id=3\", you can use \"id.3\".\n\nFor more information, see the [AssignMessage policy Copy element documentation](/apigee/docs/api-platform/reference/policies/assign-message-policy#copy).\n\n### Diagnosis\n\n1. Identify the HTTPModifier policy where the error occurred, the name of the attribute, and the invalid index. You can find all these items in the error message. For example, in the following error, the policy name is `GeneratingGeocodingRequest`, the name of the attribute is `id`, and the index is `0`:\n\n HTTPModifier[GenerateStudentsRequest]: index must be greater than zero in id.0\n\n2. Verify that the attribute name and the index used in the failed HTTPModifier policy XML matches the attribute name and the index identified in the error message (step #1 above). For example, the following policy specifies the attribute `id` and index as `0`, which matches what's in the error message:\n\n ```carbon\n \u003cAssignMessage name=\"GenerateStudentsRequest\"\u003e\n \u003cAssignTo createNew=\"true\" type=\"request\"\u003eStudentsInfoRequest\u003c/AssignTo\u003e\n \u003cCopy source=\"request\"\u003e\n \u003cQueryParams\u003e\n \u003cQueryParam name=\"school_name\"/\u003e\n \u003cQueryParam name=\"id.0\"/\u003e\n \u003cQueryParam name=\"id.1\"/\u003e\n \u003cQueryParam name=\"id.2\"/\u003e\n \u003c/QueryParams\u003e\n \u003c/Copy\u003e\n \u003c/AssignMessage\u003e\n ```\n3. If the index specified is 0 or negative number, then that's the cause of the error.\n\n In the example Assign Message policy shown above, you are trying to access the first value of the query parameter \"id\" using the index 0. Hence the deployment of the API Proxy fails with the error: \n\n AssignMessage[GenerateStudentsRequest]: index must be greater than zero in id.0\n\n### Resolution\n\nIn HTTPModifier, when you access multiple headers, query parameters, or other parameters that share the same name, ensure that the index is always greater than zero. For example: \n\n \u003cAssignMessage name=\"GenerateStudentsRequest\"\u003e\n \u003cAssignTo createNew=\"true\" type=\"request\"\u003eStudentsInfoRequest\u003c/AssignTo\u003e\n \u003cCopy source=\"request\"\u003e\n \u003cQueryParams\u003e\n \u003cQueryParam name=\"school_name\"/\u003e\n \u003cQueryParam name=\"id.1\"/\u003e\n \u003cQueryParam name=\"id.2\"/\u003e\n \u003cQueryParam name=\"id.3\"/\u003e\n \u003c/QueryParams\u003e\n \u003c/Copy\u003e\n \u003c/AssignMessage\u003e"]]