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

כרגע מוצג התיעוד של Apigee Edge.
כניסה למסמכי התיעוד של Apigee X.
מידע

InvalidTimeout

הודעת שגיאה

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

הודעת שגיאה

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

למידע על אופן היצירה של המטמון, אפשר לעיין במאמר יצירה ועריכה של מטמון של סביבה.

ResponseCacheStepAttachmentNotAllowedReq

הודעת שגיאה

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

אבחון

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

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

ResponseCacheStepAttachmentNotAllowedResp

הודעת שגיאה

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

אבחון

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

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

InvalidMessagePatternForErrorCode

הודעת שגיאה

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

הודעת שגיאה

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

סיבה

השגיאה הזאת מתרחשת אם המטמון הספציפי שמוזכר בהודעת השגיאה לא נוצר ברכיב מסוים של מעבד ההודעות.

רזולוציה

אם אתם משתמשים בענן פרטי, עליכם לפעול לפי ההוראות הבאות:

  1. פירוט הפריסות של שרת ה-API של שרת ה-proxy ובדיקה באילו מעבדי הודעות מוצגת השגיאה 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 כדי לקבל עזרה.