פתרון בעיות בפריסת מדיניות של מטמון תגובות

אתם צופים במסמכי התיעוד של Apigee Edge.
כדאי לעיין במסמכי התיעוד של Apigee X.
מידע

InvalidTimeout

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Edge או Edge management 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.

דוגמה לצילום מסך של שגיאה

סיבה

אם הרכיב <CacheLookupTimeoutInSeconds> של מדיניות ResponseCache מוגדר למספר שלילי, פריסת ה-proxy ל-API נכשלת.

לדוגמה, אם הערך של <CacheLookupTimeoutInSeconds> הוא -1, הפריסה של proxy ל-API תיכשל.

אבחון

  1. מזהים את הערך הלא תקין שמשמש לרכיב <CacheLookupTimeoutInSeconds> במדיניות ResponseCache. המידע הזה מופיע בהודעת השגיאה. לדוגמה, בשגיאה הבאה, הערך הלא תקין שמשמש לרכיב <CacheLookupTimeoutInSeconds> הוא -1:

    CacheLookupTimeoutInSeconds -1 value should be greater than zero.
    
  2. בודקים את כל כללי המדיניות של ResponseCache ב-API Proxy הספציפי שבו התרחשה הכשל. יכול להיות שיש מדיניות ResponseCache אחת או יותר שבהן מצוין הרכיב <CacheLookupTimeoutInSeconds>.

    לדוגמה, בהגדרת המדיניות הבאה, הערך של <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> מוגדרת כמספר שלם שלילי, זו הסיבה לשגיאה.

רזולוציה

צריך לוודא שהערך של רכיב <CacheLookupTimeoutInSeconds> במדיניות ResponseCache תמיד מצוין כמספר שלם לא שלילי.

כדי לתקן את מדיניות ResponseCache שמוצגת בדוגמה שלמעלה, אפשר לשנות את <CacheLookupTimeoutInSeconds> element ל-30.

<?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

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Edge או Edge management 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

דוגמה לצילום מסך של שגיאה

סיבה

השגיאה הזו מתרחשת אם הרכיב <CacheResource> במדיניות ResponseCache מוגדר לשם שלא קיים בסביבה שבה מתבצעת הפריסה של proxy ל-API.

אבחון

  1. מזהים את המטמון הלא תקין שנעשה בו שימוש ברכיב <CacheResource> של מדיניות מטמון התגובות ואת הסביבה שבה התרחשה השגיאה. שני הפריטים האלה מופיעים בהודעת השגיאה. לדוגמה, בשגיאה הבאה, שם המטמון הלא תקין הוא itemscache ושם הסביבה הוא prod.

    Invalid cache resource reference itemscache in Step definition ItemsResponseCache. Context Revision:2;APIProxy:StoresInventory;Organization:kkalckstein-eval;Environment:prod
    
  2. בודקים את כל כללי המדיניות של ResponseCache ב-API Proxy הספציפי שבו התרחשה השגיאה. מזהים את מדיניות ResponseCache הספציפית שבה המטמון הלא תקין (שזוהה בשלב 1) מצוין ברכיב <CacheResource>.

    לדוגמה, במדיניות הבאה הערך של <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. בודקים אם המטמון (שנקבע בשלב 2) הוגדר בסביבה הספציפית (שזוהתה בשלב 1).

    בממשק המשתמש של Edge, עוברים אל APIs > Environment Configuration ובודקים אם המטמון קיים בכרטיסייה Caches בסביבה הספציפית. אם המטמון לא קיים, זו הסיבה לשגיאה.

    לדוגמה, בצילום המסך שלמטה אפשר לראות שהמטמון בשם 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> נוצר בסביבה שבה רוצים לפרוס את proxy ל-API.

במאמר יצירה ועריכה של מטמון סביבה מוסבר איך ליצור את המטמון.

ResponseCacheStepAttachmentNotAllowedReq

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Edge או Edge management 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 מצורף לכמה נתיבי בקשות בתוך זרימות של proxy ל-API.

לדוגמה, אם אותה מדיניות ResponseCache מצורפת ל-Preflow של בקשת Proxy וגם לנקודות קצה של Target, השגיאה הזו מתרחשת.

אבחון

  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. בודקים את כל זרימות הבקשות ב-Proxy ובנקודות הקצה של היעד של ה-API Proxy שבו התרחשה השגיאה. אם אותה מדיניות ResponseCache מצורפת לשני תהליכי בקשות או יותר, זו הסיבה לשגיאה.

    בדוגמה הבאה, אותה מדיניות ResponseCache Response-Cache-1 מוגדרת בנתיב הבקשה של נקודת הקצה של ברירת המחדל של ה-proxy 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 Proxy.

כדי לתקן את הדוגמה שמוצגת למעלה, צריך להסיר את מדיניות ResponseCache‏ Response-Cache-1 מאחד משני תהליכי הבקשה.

ResponseCacheStepAttachmentNotAllowedResp

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Edge או Edge management 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 מצורף למספר נתיבי תגובה בכל זרימה של proxy ל-API.

לדוגמה, אם אותה מדיניות ResponseCache מצורפת ל-Response Preflow של Proxy ושל Target Endpoints, השגיאה הזו מתרחשת.

אבחון

  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. בודקים את כל זרימות הבקשות ב-Proxy ובנקודות הקצה של היעד של ה-API Proxy שבו התרחשה השגיאה. אם אותה מדיניות ResponseCache מצורפת לשני תהליכי תגובה או יותר, זו הסיבה לשגיאה.

    בדוגמה הבאה, אותה מדיניות ResponseCache‏ Response-Cache-1 מוגדרת בנתיב התגובה של נקודת הקצה של ה-Proxy שמוגדרת כברירת מחדל 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 Proxy.

כדי לתקן את הדוגמה שמוצגת למעלה, צריך להסיר את מדיניות ResponseCache‏ Response-Cache-1 מאחד משני נתיבי התגובה.

InvalidMessagePatternForErrorCode

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Edge או דרך Edge management 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.

דוגמה לצילום מסך של שגיאה

או

סיבה

השגיאה הזו מתרחשת אם הרכיב <SkipCacheLookup> או הרכיב <SkipCachePopulation> במדיניות ResponseCache מכילים תנאי לא תקין.

אבחון

  1. בודקים את כל כללי המדיניות של ResponseCache ב-API Proxy שבו התרחשה השגיאה, ומחפשים כללי מדיניות שצוינו בהם תנאים לרכיבים <SkipCacheLookup> או <SkipCachePopulation>.

  2. בודקים אם התנאי שצוין לרכיב <SkipCacheLookup> או לרכיב <SkipCachePopulation> לא תקין. אם כן, זו הסיבה לשגיאה.

    בדוגמה הבאה, רכיב <SkipCachePopulation> משתמש באופרטור JavaScript‏ === כדי לבדוק אם הערך והסוג שווים, וזה לא תקין.

    <?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

הודעת השגיאה

פריסת proxy ל-API באמצעות ממשק המשתמש של Edge או Edge Management API גורמת להודעת שגיאה כמו זו, וסטטוס הפריסה של proxy ל-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. מציגים את הפריסות של ה-proxy ל-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. רושמים את מזהי ה-UUID של מעבד ההודעות שבו מופיעה השגיאה steps.cache.CacheNotFound. מזהים את שם המארח או את כתובת ה-IP של מעבד ההודעות מתוך ה-UUID.

  3. מתחברים למעבד ההודעות הספציפי ומפעילים אותו מחדש באמצעות הפקודה הבאה:

    apigee-service edge-message-processor restart

אם אתם משתמשים ב-Public Cloud או אם הבעיה נמשכת ב-Private Cloud, פנו אל התמיכה של Apigee לקבלת עזרה.