응답 캐시 정책 배포 오류 문제 해결

현재 Apigee Edge 문서가 표시되고 있습니다.
Apigee X 문서로 이동
정보

InvalidTimeout

오류 메시지

Edge UI 또는 Edge 관리 API를 통한 API 프록시 배포가 다음 오류 메시지와 함께 실패합니다.

Error Saving Revision revision_number
CacheLookupTimeoutInSeconds value value should be greater than zero.

오류 메시지 예시

Error Saving Revision 2
CacheLookupTimeoutInSeconds -1 value should be greater than zero.

오류 스크린샷 예시

원인

ResponseCache 정책<CacheLookupTimeoutInSeconds> 요소가 음수로 설정되면 API 프록시 배포가 실패합니다.

예를 들어 <CacheLookupTimeoutInSeconds>-1이면 API 프록시 배포가 실패합니다.

진단

  1. ResponseCache 정책의 <CacheLookupTimeoutInSeconds> 요소에 사용된 잘못된 값을 확인합니다. 이 정보는 오류 메시지에서 확인할 수 있습니다. 예를 들어 다음 오류에서 <CacheLookupTimeoutInSeconds> 요소에 사용된 잘못된 값은 -1입니다.

    CacheLookupTimeoutInSeconds -1 value should be greater than zero.
    
  2. 오류가 발생한 특정 API 프록시의 모든 ResponseCache 정책을 검사합니다. <CacheLookupTimeoutInSeconds> 요소가 지정된 하나 이상의 ResponseCache 정책이 있을 수 있습니다.

    예를 들어 다음 정책 구성은 <CacheLookupTimeoutInSeconds>-1로 설정하며 이는 오류 메시지의 내용과 일치합니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ResponseCache async="false" continueOnError="false" enabled="true" name="Response-Cache-1">
        <DisplayName>Response Cache-1</DisplayName>
        <Properties/>
        <CacheKey>
            <Prefix/>
            <KeyFragment ref="request.uri" type="string"/>
        </CacheKey>
        <Scope>Exclusive</Scope>
        <ExpirySettings>
            <ExpiryDate/>
            <TimeOfDay/>
            <TimeoutInSec ref="">3600</TimeoutInSec>
        </ExpirySettings>
        <CacheLookupTimeoutInSeconds>-1</CacheLookupTimeoutInSeconds>
    </ResponseCache>
    
  3. <CacheLookupTimeoutInSeconds>가 음의 정수로 지정되면 오류가 발생합니다.

해상도

ResponseCache 정책의 <CacheLookupTimeoutInSeconds> 요소 값이 항상 음수가 아닌 정수로 지정되었는지 확인합니다.

위에 표시된 ResponseCache 정책 예시를 수정하려면 <CacheLookupTimeoutInSeconds> element30으로 수정합니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResponseCache async="false" continueOnError="false" enabled="true" name="Response-Cache-1">
    <DisplayName>Response Cache-1</DisplayName>
    <Properties/>
    <CacheKey>
        <Prefix/>
        <KeyFragment ref="request.uri" type="string"/>
    </CacheKey>
    <Scope>Exclusive</Scope>
    <ExpirySettings>
        <ExpiryDate/>
        <TimeOfDay/>
        <TimeoutInSec ref="">3600</TimeoutInSec>
    </ExpirySettings>
    <CacheLookupTimeoutInSeconds>30</CacheLookupTimeoutInSeconds>
</ResponseCache>

InvalidCacheResourceReference

오류 메시지

Edge UI 또는 Edge 관리 API를 통한 API 프록시 배포가 다음 오류 메시지와 함께 실패합니다.

Error Deploying Revision revision_number to environment
Invalid cache resource reference cache_resource in Step definition response_cache_policy_name. Context Revision:revision_number;APIProxy:ResponseCache;Organization:organization;Environment:environment

오류 메시지 예시

Error Deploying Revision 2 to prod
Invalid cache resource reference itemscache in Step definition ItemsResponseCache. Context Revision:2;APIProxy:StoresInventory;Organization:kkalckstein-eval;Environment:prod

오류 스크린샷 예시

원인

이 오류는 ResponseCache 정책<CacheResource> 요소가 API 프록시가 배포되는 환경에 존재하지 않는 이름으로 설정되는 경우에 발생합니다.

진단

  1. Response Cache 정책의 <CacheResource> 요소와 오류가 발생한 환경에서 사용된 잘못된 캐시를 식별합니다. 오류 메시지에서 이러한 항목을 모두 확인할 수 있습니다. 예를 들어 다음 오류에서 잘못된 캐시의 이름은 itemscache이며 환경 이름은 prod입니다.

    Invalid cache resource reference itemscache in Step definition ItemsResponseCache. Context Revision:2;APIProxy:StoresInventory;Organization:kkalckstein-eval;Environment:prod
    
  2. 오류가 발생한 특정 API 프록시의 모든 ResponseCache 정책을 검사합니다. 1단계에서 확인된 잘못된 캐시가 <CacheResource> 요소에 지정된 특정 ResponseCache 정책을 식별합니다.

    예를 들어 다음 정책은 <CacheResource> 값을 itemscache로 지정하며 이는 오류 메시지의 내용과 일치합니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ResponseCache async="false" continueOnError="false" enabled="true" name="ItemsResponseCache">
      <DisplayName>ItemsResponseCache</DisplayName>
      <Properties/>
      <CacheKey>
          <Prefix/>
          <KeyFragment ref="request.uri" type="string"/>
      </CacheKey>
      <CacheResource>itemscache</CacheResource>
      <Scope>Exclusive</Scope>
      <ExpirySettings>
          <ExpiryDate/>
          <TimeOfDay/>
          <TimeoutInSec ref="">3600</TimeoutInSec>
      </ExpirySettings>
      <SkipCacheLookup/>
      <SkipCachePopulation/>
    </ResponseCache>
    
  3. 특정 환경(1단계에서 식별됨)에서 캐시(2단계에서 결정됨)가 정의되었는지 확인합니다.

    Edge UI에서 API > 환경 구성으로 이동하여 특정 환경의 캐시 탭에 캐시가 있는지 확인합니다. 캐시가 없으면 오류가 발생합니다.

    예를 들어 다음 스크린샷에는 itemscache라는 캐시가 없습니다.

    itemscache라는 캐시는 prod 환경에 정의되어 있지 않으므로 다음과 같은 오류가 발생합니다.

    Invalid cache resource reference does_not_exist in Step definition Response-Cache-1. Context Revision:2;APIProxy:ResponseCache;Organization:kkalckstein-eval;Environment:prod
    

해상도

<CacheResource> 요소에 지정된 캐시 이름이 API 프록시를 배포하려는 환경에 생성되었는지 확인합니다.

캐시를 만드는 방법에 대한 자세한 내용은 환경 캐시 만들기 및 수정을 참조하세요.

ResponseCacheStepAttachmentNotAllowedReq

오류 메시지

Edge UI 또는 Edge 관리 API를 통한 API 프록시 배포가 다음 오류 메시지와 함께 실패합니다.

Error Deploying Revision revision_number to environment
Response cache step definition response_cache_policy_name can not be attached more than once in the request path.

오류 메시지 예시

Error Deploying Revision 2 to test
Response cache step definition Response-Cache-1 can not be attached more than once in the request path.

오류 스크린샷 예시

원인

이 오류는 동일한 ResponseCache 정책이 API 프록시의 흐름 내에서 여러 요청 경로에 연결된 경우 발생합니다.

예를 들어 프록시와 대상 엔드포인트의 요청 Preflow에 동일한 ResponseCache 정책이 연결되어 있으면 이 오류가 발생합니다.

진단

  1. 두 번 이상 연결된 ResponseCache 정책의 이름을 식별합니다. 이 정보는 오류 메시지에서 확인할 수 있습니다. 예를 들어 다음 오류에서 ResponseCache 정책의 이름은 Response‑Cache‑1입니다.

    Error Deploying Revision 2 to test
    Response cache step definition Response-Cache-1 can not be attached more than once in the request path.
    
  2. 오류가 발생한 API 프록시의 프록시 및 대상 엔드포인트에서 모든 요청 흐름을 검토합니다. 두 개 이상의 요청 흐름에 동일한 ResponseCache 정책이 연결되어 있는 경우 이는 오류의 원인이 됩니다.

    다음 예시에서 동일한 ResponseCache 정책 Response-Cache-1은 기본 프록시 엔드포인트 PreFlow의 요청 경로와 기본 대상 엔드포인트 PreFlow에서 구성됩니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ProxyEndpoint name="default">
        <Description/>
        <FaultRules/>
        <PreFlow name="PreFlow">
            <Request>
                <Step>
                    <Name>Response-Cache-1</Name>
                </Step>
            </Request>
        ...
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <TargetEndpoint name="default">
        <Description/>
        <FaultRules/>
        <PreFlow name="PreFlow">
            <Request/>
            <Response/>
        </PreFlow>
        <PostFlow name="PostFlow">
            <Request>
                <Step>
                    <Name>Response-Cache-1</Name>
                </Step>
            </Request>
        ...
    

해결 방법

ResponseCache 정책이 API 프록시의 모든 흐름에서 하나의 요청 경로에만 연결되어 있는지 확인합니다.

위에 표시된 예시를 수정하려면 두 요청 흐름 중 하나에서 ResponseCache 정책 Response-Cache-1을 삭제합니다.

ResponseCacheStepAttachmentNotAllowedResp

오류 메시지

Edge UI 또는 Edge 관리 API를 통한 API 프록시 배포가 다음 오류 메시지와 함께 실패합니다.

Error Deploying Revision revision_number to environment
Response cache step definition response_cache_policy_name can not be attached more than once in the response path.

오류 메시지 예시

Error Deploying Revision 2 to test
Response cache step definition Response-Cache-1 can not be attached more than once in the response path.

오류 스크린샷 예시

원인

이 오류는 동일한 ResponseCache 정책이 API 프록시의 흐름 내에서 여러 응답 경로에 연결된 경우 발생합니다.

예를 들어 프록시와 대상 엔드포인트의 응답 Preflow에 동일한 ResponseCache 정책이 연결되어 있으면 이 오류가 발생합니다.

진단

  1. 두 번 이상 연결된 ResponseCache 정책의 이름을 식별합니다. 이 정보는 오류 메시지에서 확인할 수 있습니다. 예를 들어 다음 오류에서 ResponseCache 정책의 이름은 Response-Cache-1입니다.

    Error Deploying Revision 2 to test
    Response cache step definition Response-Cache-1 can not be attached more than once in the response path.
    
  2. 오류가 발생한 API 프록시의 프록시 및 대상 엔드포인트에서 모든 요청 흐름을 검토합니다. 두 개 이상의 응답 흐름에 동일한 ResponseCache 정책이 연결되어 있는 경우 이는 오류의 원인이 됩니다.

    다음 예시에서 동일한 ResponseCache 정책 Response-Cache-1은 기본 프록시 엔드포인트 PreFlow의 응답 경로와 기본 대상 엔드포인트 PreFlow에서 구성됩니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ProxyEndpoint name="default">
        <Description/>
        <FaultRules/>
        <PreFlow name="PreFlow">
            <Request>
                <Step>
                    <Name>Response-Cache</Name>
                </Step>
            </Request>
            <Response>
                <Step>
                    <Name>Response-Cache-1</Name>
                </Step>
            </Response>
        </PreFlow>
        ...
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <TargetEndpoint name="default">
        <Description/>
        <FaultRules/>
        <PreFlow name="PreFlow">
            <Request/>
            <Response/>
        </PreFlow>
        <PostFlow name="PostFlow">
            <Request/>
            <Response>
                <Step>
                    <Name>Response-Cache-1</Name>
                </Step>
            </Response>
        </PostFlow>
        ...
    

해상도

ResponseCache 정책이 API 프록시의 모든 흐름에서 하나의 응답 경로에만 연결되어 있는지 확인합니다.

위에 표시된 예시를 수정하려면 두 응답 경로 중 하나에서 ResponseCache 정책 Response-Cache-1을 삭제합니다.

InvalidMessagePatternForErrorCode

오류 메시지

Edge UI 또는 Edge 관리 API를 통해 API 프록시를 배포할 때 다음 오류 메시지 중 하나가 표시되면서 실패합니다.

Error Deploying Revision revision_number to environment
Invalid message pattern found for error code steps.cache.InvalidSkipCacheLookUpCondition.

또는

Error Deploying Revision revision_number to environment
Invalid message pattern found for error code steps.cache.InvalidSkipCachePopulationCondition.

오류 메시지 예시

Error Deploying Revision 2 to prod
Invalid message pattern found for error code steps.cache.InvalidSkipCacheLookUpCondition.

또는

Error Deploying Revision 2 to prod
Invalid message pattern found for error code steps.cache.InvalidSkipCachePopulationCondition.

오류 스크린샷 예시

또는

원인

이 오류는 ResponseCache 정책에서 <SkipCacheLookup> 또는 <SkipCachePopulation> 요소에 잘못된 조건이 포함된 경우에 발생합니다.

진단

  1. 오류가 발생한 API 프록시의 모든 ResponseCache 정책을 검토하고 <SkipCacheLookup> 또는 <SkipCachePopulation> 요소에 지정된 조건이 있는 정책이 있는지 확인합니다.

  2. <SkipCacheLookup> 또는 <SkipCachePopulation> 요소에 지정된 조건이 유효하지 않은지 확인합니다. 그렇다면 이는 오류의 원인이 됩니다.

    다음 예시에서 <SkipCachePopulation> 요소는 자바스크립트 연산자 ===을(를) 사용하여 잘못된 동일 값 및 동일 유형을 확인합니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ResponseCache async="false" continueOnError="false" enabled="true" name="Response-Cache-1">
        <DisplayName>Response Cache-1</DisplayName>
        <Properties/>
        <CacheKey>
            <Prefix/>
            <KeyFragment ref="request.uri" type="string"/>
        </CacheKey>
        <Scope>Exclusive</Scope>
        <ExpirySettings>
            <ExpiryDate/>
            <TimeOfDay/>
            <TimeoutInSec ref="">3600</TimeoutInSec>
        </ExpirySettings>
        <CacheLookupTimeoutInSeconds>2</CacheLookupTimeoutInSeconds>
        <SkipCacheLookup>request.header.bypass-cache === "true"</SkipCacheLookup>
    </ResponseCache>
    

    연산자 ===가 유효하지 않으므로 다음 오류가 발생합니다.

    Invalid message pattern found for error code steps.cache.InvalidSkipCacheLookUpCondition.
    

해상도

<SkipCacheLookup> 또는 <SkipCachePopulation> 요소에 지정된 조건이 항상 유효한지 확인합니다.

위에 표시된 ResponseCache 정책 예시를 수정하려면 = 연산자를 사용할 수 있도록 <SkipCacheLookup>을 수정합니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResponseCache async="false" continueOnError="false" enabled="true" name="Response-Cache-1">
    <DisplayName>Response Cache-1</DisplayName>
    <Properties/>
    <CacheKey>
        <Prefix/>
        <KeyFragment ref="request.uri" type="string"/>
    </CacheKey>
    <Scope>Exclusive</Scope>
    <ExpirySettings>
        <ExpiryDate/>
        <TimeOfDay/>
        <TimeoutInSec ref="">3600</TimeoutInSec>
    </ExpirySettings>
    <CacheLookupTimeoutInSeconds>2</CacheLookupTimeoutInSeconds>
    <SkipCacheLookup>request.header.bypass-cache = "true"</SkipCacheLookup>
</ResponseCache>

CacheNotFound

오류 메시지

Edge UI 또는 Edge 관리 API를 통해 API 프록시를 배포하면 다음과 같은 오류 메시지가 표시되고 API 프록시의 배포 상태는 부분적으로 배포된 것으로 표시됩니다.

Error: Cache : cache_resource, not found in organization : organization__environment.

오류 메시지 예시

Error Cache : Response-Cache-1, not found in organization : kkalckstein-eval__prod

원인

이 오류는 오류 메시지에 언급된 특정 캐시가 특정 메시지 프로세서 구성요소에 생성되지 않으면 발생합니다.

해상도

Private Cloud 사용자인 경우 다음 안내를 따르세요.

  1. API 프록시 배포를 나열하고 steps.cache.CacheNotFound 오류가 있는 메시지 프로세서를 확인합니다.

    샘플 출력

    curl -u $USERID:$USERPASSWORD http://<management-server-host>:8080/v1/organizations/<org-name>/environments/<env-name>/apis/<apiproxy-name>/revisions/<revision-number>/deployments
    {
      "aPIProxy" : "ResponseCache",
      "environment" : [ {
        "configuration" : {
          "basePath" : "/",
          "configVersion" : "SHA-512:45d3f39783414d3859bf2dec4135d8f5f9960ee6b2d361db2799c82693a8e3f8b95dbbb37c547eb3c0a3819d8ca51727f390502bcaefdf1f113263521a9023b6",
          "steps" : [ ]
        },
        "name" : "prod",
        "server" : [ {
          "pod" : {
            "name" : "pod1",
            "region" : "us-central1"
          },
          "status" : "deployed",
          "type" : [ "message-processor" ],
          "uUID" : "f2e5e34a-5630-43a9-8fef-48a5b9da76d1"
        }, {
          "pod" : {
            "name" : "pod1",
            "region" : "us-central1"
          },
          "status" : "deployed",
          "type" : [ "message-processor" ],
          "uUID" : "879a6538-a5e0-4503-b142-9cb2b4e0623d"
        }, {
        "error" : "Cache : Response-Cache-1, not found in organization : kkalckstein-eval__prod",
        "errorCode" : "steps.cache.CacheNotFound",
        "status" : "error",
        "type" : [ "message-processor" ],
         "uUID" : "a8f9ce0b-c32d-48a9-b26c-9c75d8bf467d"
    },
    ...
        "state" : "deployed"
      } ],
      "name" : "2",
      "organization" : "kkalckstein-eval"
    
  2. steps.cache.CacheNotFound 오류가 표시된 메시지 프로세서의 UUID를 확인합니다. UUID에서 메시지 프로세서의 호스트 이름/IP 주소를 식별합니다.

  3. 특정 메시지 프로세서에 로그인하고 다음 명령어를 사용하여 메시지 프로세서를 다시 시작합니다.

    apigee-service edge-message-processor restart

Public Cloud 사용자이거나 Private Cloud에서 문제가 계속되면 Apigee 지원팀에 문의하여 도움을 받으세요.