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

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

InvalidRegularExpression

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
RegularExpressionProtection policy_name: Invalid Regular Expression com.apigee.steps.regexprotection.RegularExpressionProtectionBean$RegexPattern@f4ecb23, Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.

הודעת שגיאה לדוגמה

Error Deploying Revision 1 to test
RegularExpressionProtection Regular-Expression-Protection-1: Invalid Regular Expression com.apigee.steps.regexprotection.RegularExpressionProtectionBean$RegexPattern@f4ecb23, Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.

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

טקסט שגיאה לא חוקי של 'ביטוי רגולרי'

סיבה

אם הביטוי הרגולרי ברכיב <Pattern> של regularExpressionProtection policy לא תקין, הפריסה של שרת ה-API של ה-API תיכשל.

אבחון

  1. מזהים את השם של regularExpressionProtection בהודעת השגיאה. לדוגמה, בשגיאה הבאה, שם המדיניות של regularExpressionProtection הוא Regular-Expression-Protection-1:

    Error Deploying Revision 1 to test
    RegularExpressionProtection Regular-Expression-Protection-1: Invalid Regular Expression com.apigee.steps.regexprotection.RegularExpressionProtectionBean$RegexPattern@f4ecb23, Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
    
  2. יש לבדוק את כל רכיבי <Pattern> ב-XML של המדיניות מסוג 'הגנה על ביטויים רגולריים' שנכשל. יש לבדוק אם רכיב כלשהו של <Pattern> מכיל ביטוי רגולרי לא חוקי. אם באחד מרכיבי <Pattern> יש ביטוי רגולרי לא חוקי, זו הסיבה לשגיאה.

    לדוגמה, המדיניות הבאה מציינת את הערך של Pattern> של foo){2}, שנחשב ביטוי רגולרי לא חוקי:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
            <DisplayName>Regular Expression Protection-1</DisplayName>
            <Properties/>
            <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
            <URIPath>
                <Pattern>foo){2}</Pattern>
            </URIPath>
            <Source>request</Source>
        </RegularExpressionProtection>
    

    בדוגמה שלמעלה, בביטוי הרגולרי שצוין ב-<Pattern> חסרים סוגריים פותחים. לכן הוא נחשב כביטוי רגולרי לא חוקי. כך שהפריסה של שרת ה-API של שרת ה-proxy נכשלה.

רזולוציה

מוודאים שכל רכיב <Pattern> ב-regularExpressionProtection מכיל ביטוי רגולרי תקין. אתם יכולים לחפש כלים שונים לביטויים רגולריים (regex) אונליין או אופליין כדי לנפות באגים בביטויים רגולריים. כדי לתקן את הדוגמה של המדיניות בנושא הגנת ביטוי רגולרי שמוצגת למעלה, צריך להוסיף את הסוגריים החסרים:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
        <DisplayName>Regular Expression Protection-1</DisplayName>
        <Properties/>
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
        <URIPath>
            <Pattern>(foo){2}</Pattern>
        </URIPath>
        <Source>request</Source>
    </RegularExpressionProtection>

XPathCompilationFailed

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
RegularExpressionProtection policy_name: Failed to compile xpath xpath_expression. Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.

הודעת שגיאה לדוגמה

Error Deploying Revision 1 to test
RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile xpath /notapigee:foo/notapigee:bar. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.

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

טקסט שגיאה XPathCompilationנכשל

סיבה

אם התחילית או הערך שנמצאים בשימוש ברכיב <XPath> אינם חלק ממרחבי השמות המוצהרים ב-regularExpressionProtection policy, הפריסה של שרת ה-proxy של ה-API תיכשל.

מידע נוסף על מרחבי שמות, XPath וקידומת זמין במאמר מרחבי שמות של XML ואיך הם משפיעים על XPath ו-XSLT.

אבחון

  1. זהה את השם של המדיניות GeneralExpressionProtection שבה אירעה השגיאה ואת ביטוי ה-XPath שבו נעשה שימוש. ניתן למצוא את שני הפריטים האלה בהודעת השגיאה.

    לדוגמה, בשגיאה הבאה , שם המדיניות הוא Regular-Expression-Protection-1 והביטוי XPath הוא /notapigee:foo/notapigee:bar:

    Error Deploying Revision 1 to test
    RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile xpath /notapigee:foo/notapigee:bar. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
    
  2. ב-XML של מדיניות ההגנה על ביטוי רגולרי שנכשל, יש לוודא ש-XPath שהוגדר ברכיב Expression תואם ל-XPath שזוהה בהודעת השגיאה (שלב 1 למעלה).

    לדוגמה, המדיניות הבאה מציינת את ה-XPath כ-/notapigee:foo/notapigee:bar שתואם לתוכן בהודעת השגיאה:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
        <DisplayName>Regular Expression Protection-1</DisplayName>
        <Properties/>
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
        <Source>request</Source>
         <XMLPayload>
             <Namespaces>
                 <Namespace prefix="apigee">http://www.apigee.com</Namespace>
             </Namespaces>
             <XPath>
                 <Expression>/notapigee:foo/notapigee:bar</Expression>
                 <Type>nodeset</Type>
                 <Pattern>pattern</Pattern>
                 <Pattern>pattern2</Pattern>
             </XPath>
         </XMLPayload>
    </RegularExpressionProtection>
    
  3. יש לבדוק את הרכיבים <Namespaces> ו-<Expression> ב-regularExpressionProtection. אם השדה <Expression> הספציפי שצוין בהודעת השגיאה משתמש בקידומת או בערך שאינם חלק ממרחבי השמות שהוצהרו ב-regularExpressionProtection, זו הסיבה לשגיאה.

    שימו לב שה-<XPath> הספציפי משתמש בקידומת notapigee בדוגמה regularExpressionProtection:

    <Expression>/notapigee:foo/notapigee:bar</Expression>

    עם זאת, התחילית notapigee לא מוגדרת באף אחד מהאלמנטים של <Namespace>; לכן ההידור של <XPath> נכשל וגורם לכשל בפריסה.

רזולוציה

צריך לוודא שכל מרחבי השמות שנמצאים בשימוש ברכיבי <Expression> ברכיבי <XPath> מוצהרים במדיניות רגולריExpressionProtection. כדי לתקן את הדוגמה שלמעלה, אפשר להחליף את התחילית notapigee ב-apigee, שמוצהרת במרחבי שמות:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
    <DisplayName>Regular Expression Protection-1</DisplayName>
    <Properties/>
    <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    <Source>request</Source>
     <XMLPayload>
         <Namespaces>
             <Namespace prefix="apigee">http://www.apigee.com</Namespace>
         </Namespaces>
         <XPath>
             <Expression>/apigee:foo/apigee:bar</Expression>
             <Type>nodeset</Type>
             <Pattern>pattern</Pattern>
             <Pattern>pattern2</Pattern>
         </XPath>
     </XMLPayload>
</RegularExpressionProtection>

CannotBeConvertedToNodeset

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
RegularExpressionProtection policy_name: Result of xpath xpath_expression cannot be converted to nodeset. Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.

הודעת שגיאה לדוגמה

Error Deploying Revision 1 to test
RegularExpressionProtection Regular-Expression-Protection-1: Result of xpath count(//apigee:foo) cannot be converted to nodeset. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.

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

טקסט שגיאה מסוג NOTBeconvertToNodeset

סיבה

אם המדיניות בנושא ביטויים רגולריים כוללת ביטוי <XPath> שבו הרכיב <Type> מוגדר כnodeset, אבל לא ניתן להמיר את הביטוי לקבוצת צמתים, הפריסה של שרת ה-proxy של ה-API תיכשל.

אבחון

  1. מזהים את המדיניות הרגילה של ExpressionProtection שבה אירעה השגיאה, ואת ביטוי ה-XPath שלא ניתן להמיר ל-netset. ניתן למצוא את שני הפריטים האלה בהודעת השגיאה.

    לדוגמה, בשגיאה הבאה , שם המדיניות הוא Regular-Expression-Protection-1 והביטוי XPath הוא count(//apigee:foo):

    Error Deploying Revision 1 to test
    RegularExpressionProtection Regular-Expression-Protection-1: Result of xpath count(//apigee:foo) cannot be converted to nodeset. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
    
  2. ב-XML של מדיניות ההגנה על ביטוי רגולרי שנכשל, מוודאים ש-XPath שהוגדר ברכיב <Expression> של הרכיב <XPath> תואם ל-XPath שזוהה בהודעת השגיאה (שלב 1 למעלה).

    לדוגמה, המדיניות הבאה מציינת את הערך count(//apigee:foo), שתואם לתוכן הודעת השגיאה:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
            <DisplayName>Regular Expression Protection-1</DisplayName>
            <Properties/>
            <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
            <Source>request</Source>
             <XMLPayload>
                 <Namespaces>
                     <Namespace prefix="apigee">http://www.apigee.com</Namespace>
                 </Namespaces>
                 <XPath>
                     <Expression>count(//apigee:foo)</Expression>
                     <Type>nodeset</Type>
                     <Pattern>pattern</Pattern>
                     <Pattern>pattern2</Pattern>
                 </XPath>
             </XMLPayload>
        </RegularExpressionProtection>
    
  3. צריך לבדוק את הערך שמוגדר ברכיב <Type> מתחת לרכיב <XPath>. אם הרכיב <Type> הוא nodeset, זו הסיבה לשגיאה.

    בדוגמה הזו, ביטוי ה-XPath הוא count() שלא מחזיר צומת אחד או יותר. לכן הפריסה של שרת ה-API של שרת ה-proxy נכשלה.

רזולוציה

אם הרכיב <Type> מוגדר לקבוצת צמתים, צריך לוודא שהתוצאה של הרכיב <Expression> שהוגדרה ב-<XPath> היא צומת אחד או יותר. לחלופין, אפשר לשנות את הרכיב <Type> לערך מתאים יותר בהתאם לתרחיש לדוגמה שלכם.

כדי לתקן את הדוגמה שלמעלה, אפשר לשנות את הרכיב <Expression> לערך אחר שיכול להחזיר צמתים:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
    <DisplayName>Regular Expression Protection-1</DisplayName>
    <Properties/>
    <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    <Source>request</Source>
     <XMLPayload>
         <Namespaces>
             <Namespace prefix="apigee">http://www.apigee.com</Namespace>
         </Namespaces>
         <XPath>
             <Expression>/apigee:foo/apigee:bar</Expression>
             <Type>nodeset</Type>
             <Pattern>pattern</Pattern>
             <Pattern>pattern2</Pattern>
         </XPath>
     </XMLPayload>
</RegularExpressionProtection>

JSONPathCompilationFailed

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
RegularExpressionProtection policy_name: Failed to compile jsonpath jsonpath_expression Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.

הודעת שגיאה לדוגמה

Error Deploying Revision 1 to test
RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile jsonpath $.store.book[*.author. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.

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

טקסט שגיאה מסוג JSONPathCompilationנכשל

סיבה

אם הרכיב <Expression> בקטע <JSONPath> של מדיניות 'הגנה על ביטוי רגולרי' מוגדר לביטוי JSONPath לא חוקי, הפריסה של שרת ה-proxy של ה-API תיכשל.

אבחון

  1. מזהים את השם של regularExpressionProtection המדיניות שבה אירעה השגיאה והשימוש בביטוי JSONPath לא תקין. ניתן למצוא את שני הפריטים האלה בהודעת השגיאה.

    לדוגמה, בשגיאה הבאה , שם המדיניות הוא Regular-Expression-Protection-1 והביטוי JSONPath הוא $.store.book[*.author:

    Error Deploying Revision 1 to test
    RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile jsonpath $.store.book[*.author. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
    
  2. ב-XML של מדיניות ההגנה על ביטוי רגולרי שנכשל, יש לוודא ש-JSONPath שהוגדר באלמנט Expression תואם ל-JSONPath שזוהה בהודעת השגיאה (שלב 1 למעלה).

    לדוגמה, המדיניות הבאה מציינת את הרכיב Expression ברכיב <JSONPath> כ-$.store.book[*.author, שתואם למה שמופיע בהודעת השגיאה:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
            <DisplayName>Regular Expression Protection-1</DisplayName>
            <Properties/>
            <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
            <Source>request</Source>
            <JSONPayload>
                 <JSONPath>
                     <Expression>$.store.book[*.author</Expression>
                     <Pattern>REGEX PATTERN</Pattern>
                     <Pattern>REGEX PATTERN</Pattern>
                 </JSONPath>
                </JSONPayload>
        </RegularExpressionProtection>
    
  3. צריך לבדוק את הרכיב <Expression> במסגרת הרכיב <JSONPath> במדיניות. אם הוא לא תואם לתחביר של JSONPath, אז זו הסיבה לשגיאה. בדוגמה שלמעלה, הסוגריים המרובעים הסוגרים חסרים, ולכן הביטוי אינו חוקי.

    מאחר שביטוי הנתיב של ה-JSON לא תקין, הפריסה של שרת ה-proxy של ה-API נכשלת.

רזולוציה

יש לוודא שהערך של הרכיב <Expression> שבתוך הרכיב <JSONPath> במדיניות 'הגנה על ביטויים רגולריים' הוא ביטוי JSONPath חוקי.

כדי לתקן את הדוגמה שלמעלה, אפשר להוסיף סוגר סוגריים מרובעים חסר לערך הרכיב <Expression>:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
    <DisplayName>Regular Expression Protection-1</DisplayName>
    <Properties/>
    <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    <Source>request</Source>
    <JSONPayload>
         <JSONPath>
             <Expression>$.store.book[*].author</Expression>
             <Pattern>REGEX PATTERN</Pattern>
             <Pattern>REGEX PATTERN</Pattern>
         </JSONPath>
        </JSONPayload>
</RegularExpressionProtection>

NothingToEnforce

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Saving Revision revision_number
RegularExpressionProtection policy_name: at least one of URIPath, QueryParam, Header, FormParam, XMLPayload, JSONPayload is mandatory.

הודעת שגיאה לדוגמה

Error Saving Revision 1
RegularExpressionProtection Regular-Expression-Protection-1: at least one of URIPath, QueryParam, Header, FormParam, XMLPayload, JSONPayload is mandatory.

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

טקסט שגיאה של noneToEnforce

סיבה

אם ה-regularExpressionProtection לא כולל אף אחד מהאלמנטים <URIPath>, <QueryParam>, <Header>, <FormParam>, <XMLPayload> או <JSONPayload>, הפריסה של שרת ה-API של שרת ה-API תיכשל.

כפי שצוין בהודעת השגיאה, המדיניות הרגילה של ExpressionProtection חייבת לכלול לפחות אחד מהאלמנטים הבאים במדיניות: <URIPath>, <QueryParam>, <Header>, <FormParam>, <XMLPayload> או <JSONPayload>.

אבחון

  1. זהה את השם של המדיניותregularExpressionProtection שבה אירעה השגיאה. אפשר למצוא אותו בהודעת השגיאה. לדוגמה, בשגיאה הבאה , שם המדיניות הוא Regular-Expression-Protection-1:

    RegularExpressionProtection Regular-Expression-Protection-1: at least one of URIPath, QueryParam, Header, FormParam, XMLPayload, JSONPayload is mandatory.
    
  2. יש לבדוק את מדיניות ההגנה על ביטויים רגולריים שנכשלה (זוהתה בשלב 1 למעלה). אם המדיניות לא כוללת אף אחד מהרכיבים הבאים: <URIPath>, <QueryParam>, <Header>, <FormParam>, <XMLPayload> או <JSONPayload>, זו הסיבה לשגיאה.

    לדוגמה, המדיניות הבאה להגנה על ביטויים רגולריים לא כוללת אף אחד מהאלמנטים שצוינו למעלה:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
            <DisplayName>Regular Expression Protection-1</DisplayName>
            <Properties/>
            <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
            <Source>request</Source>
        </RegularExpressionProtection>
    

    מאחר שאף אחד מהאלמנטים הנדרשים לא קיים במדיניות חילוץ משתני, הפריסה של שרת ה-proxy של ה-API נכשלת.

רזולוציה

יש לוודא שה-regularExpressionProtection כולל לפחות אחד מהאלמנטים הנדרשים הבאים: <URIPath>, <QueryParam>, <Header>, <FormParam>, <XMLPayload> או <JSONPayload>. לדוגמה:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
    <DisplayName>Regular Expression Protection-1</DisplayName>
    <Properties/>
    <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    <Source>request</Source>
    <JSONPayload>
        <JSONPath>
            <Expression>$.store.book[*].author</Expression>
            <Pattern>REGEX PATTERN</Pattern>
            <Pattern>REGEX PATTERN</Pattern>
        </JSONPath>
    </JSONPayload>
</RegularExpressionProtection>

NoPatternsToEnforce

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Saving Revision revision_number
RegularExpressionProtection policy_name: No patterns to enforce in payload_name.

הודעת שגיאה לדוגמה

Error Saving Revision 1
RegularExpressionProtection Regular-Expression-Protection-1: No patterns to enforce in XPath.

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

טקסט שגיאה של NoPatternsToEnforce

סיבה

אם יש רכיבים ברמה העליונה (<URIPath>, <QueryParam>, <Header>, <FormParam>, <XMLPayload> או <JSONPayload>) שלא מוגדר בהם רכיב <Pattern> בregularExpressionProtection Policy, הפריסה של שרת ה-proxy של ה-API תיכשל.

אבחון

  1. זהה את השם של המדיניותregularExpressionProtection שבה אירעה השגיאה ואת רכיב הצאצא שלא כולל את הרכיב <Pattern>. ניתן למצוא את שני הפריטים האלה בהודעת השגיאה.

    לדוגמה, בשגיאה הבאה, שם המדיניות הוא Regular-Expression-Protection-1 ורכיב הצאצא הוא XPath:

    RegularExpressionProtection Regular-Expression-Protection-1: No patterns to enforce in XPath.
    
  2. יש לבדוק את מדיניות ההגנה על ביטויים רגולריים שנכשלה ולוודא שרכיב הצאצא שזוהה בשלב 1 לא מכיל את הרכיב <Pattern>. אם רכיב <Pattern> לא קיים, זו הסיבה לשגיאה.

    לדוגמה, במדיניות הבאה אין רכיב <Pattern> בתוך רכיב <XPath>:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
          <DisplayName>Regular Expression Protection-1</DisplayName>
          <Properties/>
          <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
          <Source>request</Source>
          <XMLPayload>
            <Namespaces>
              <Namespace prefix="apigee">http://www.apigee.com</Namespace>
            </Namespaces>
            <XPath>
              <Expression>/apigee:Greeting/apigee:User</Expression>
              <Type>string</Type>
            </XPath>
          </XMLPayload>
        </RegularExpressionProtection>
    

    מכיוון שהרכיב <XPath> לא כולל את האלמנט <Pattern>, הפריסה של שרת ה-proxy של ה-API נכשלה.

רזולוציה

יש לוודא שבכל אחד מהרכיבים <URIPath>, <QueryParam>, <Header>, <FormParam>, <XMLPayload> או <JSONPayload> צוין לפחות <Pattern> אחד. מידע נוסף על ציון נכון של הרכיב זמין במדיניות של רגולריExpressionProtection.

כדי לתקן את הדוגמה שלמעלה, מוסיפים את הרכיב <Pattern> לרכיב <XPath> מתחת ל-<XMLPayload>:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
  <DisplayName>Regular Expression Protection-1</DisplayName>
  <Properties/>
  <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
  <Source>request</Source>
  <XMLPayload>
    <Namespaces>
      <Namespace prefix="apigee">http://www.apigee.com</Namespace>
    </Namespaces>
    <XPath>
      <Expression>/apigee:Greeting/apigee:User</Expression>
      <Type>string</Type>
      <Pattern>REGEX PATTERN</Pattern>
    </XPath>
  </XMLPayload>
</RegularExpressionProtection>

NONEmptyPrefixpedToEmptyURI

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Saving Revision revision_number
RegularExpressionProtection policy_name: Non-empty prefix prefix_name cannot be mapped to empty uri.

הודעת שגיאה לדוגמה

Error Saving Revision 1
RegularExpressionProtection Regular-Expression-Protection-1: Non-empty prefix apigee cannot be mapped to empty uri.

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

טקסט שגיאה NONEmptyPrefixMappedToEmptyURI

סיבה

השגיאה הזו מתרחשת אם ל-regularExpressionProtection יש קידומת שמוגדרת ברכיב <Namespace> במסגרת הרכיב <XMLPayload>, אבל לא הוגדרה URI.

אבחון

  1. מזהים את המדיניות הרגילה של ExpressionProtection שבה אירעה השגיאה, ואת שם הקידומת שלא ממופה ל-URI. ניתן למצוא את שני הפריטים האלה בהודעת השגיאה.

    לדוגמה, בשגיאה הבאה, שם המדיניות הוא regular Expression Protection-1 והקידומת היא apigee:

    RegularExpressionProtection Regular-Expression-Protection-1: Non-empty prefix apigee cannot be mapped to empty uri.
    
  2. ב-XML של המדיניות בנושא הגנה על ביטויים רגולריים שנכשל, יש לוודא ששם הקידומת שהוגדר ברכיב <Namespace> ברכיב <XMLPayload> תואם לשם הקידומת שזוהה בהודעת השגיאה (שלב 1 למעלה).

    לדוגמה, המדיניות הבאה מציינת קידומת בשם apigee ברכיב <Namespace> , שתואמת למה שמופיע בהודעת השגיאה:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
          <DisplayName>Regular Expression Protection-1</DisplayName>
          <Properties/>
          <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
          <Source>request</Source>
          <XMLPayload>
            <Namespaces>
              <Namespace prefix="apigee"/>
              <Namespace prefix="gmail">http://mail.google.com</Namespace>
            </Namespaces>
            <XPath>
              <Expression>/apigee:Greeting/apigee:User</Expression>
              <Type>string</Type>
              <Pattern>REGEX PATTERN</Pattern>
            </XPath>
          </XMLPayload>
        </RegularExpressionProtection>
    
  3. צריך לבדוק אם לרכיב <Namespace> עם הקידומת הספציפית שזוהתה בשלב 2 יש URI חוקי. אם ה-URI חסר, זאת הסיבה לשגיאה.

    בדוגמה של המדיניות בנושא הגנה על ביטויים רגולריים שמופיעה למעלה, שימו לב שאין URI שמתאים לרכיב <Namespace> עם התחילית apigee. לכן, מתקבלת השגיאה:

    Non-empty prefix apigee cannot be mapped to empty uri.

רזולוציה

יש לוודא שלכל רכיבי <Namespace> שמוגדרים עם קידומת יש URI תואם במדיניות 'חילוץ משתנים'. לדוגמה:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
  <DisplayName>Regular Expression Protection-1</DisplayName>
  <Properties/>
  <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
  <Source>request</Source>
  <XMLPayload>
    <Namespaces>
      <Namespace prefix="apigee">http://www.apigee.com</Namespace>
      <Namespace prefix="gmail">http://mail.google.com</Namespace>
    </Namespaces>
    <XPath>
      <Expression>/apigee:Greeting/apigee:User</Expression>
      <Type>string</Type>
      <Pattern>REGEX PATTERN</Pattern>
    </XPath>
  </XMLPayload>
</RegularExpressionProtection>

DuplicatePrefix

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Saving Revision revision_number
RegularExpressionProtection policy_name: Duplicate prefix prefix_name.

הודעת שגיאה לדוגמה

Error Saving Revision 1
RegularExpressionProtection Regular-Expression-Protection-1: Duplicate prefix apigee.

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

טקסט שגיאה של שכפול קידומת

סיבה

השגיאה הזו מתרחשת אם ב-regularExpressionProtection מוגדרת אותה תחילית מוגדרת יותר מפעם אחת ברכיב <Namespace> מתחת לרכיב <XMLPayload>.

לדוגמה, השגיאה הזו מתרחשת כי ה-API של התחילית מוגדר פעמיים כפי שמוצג למטה:

<Namespace prefix="apigee">http://www.apigee.com</Namespace>
<Namespace prefix="apigee">http://www.apigee.com</Namespace>

אבחון

  1. זיהוי המדיניות הרגילה של ExpressionProtection שבה אירעה השגיאה ואת שם הקידומת. ניתן למצוא את שני הפריטים האלה בהודעת השגיאה.

    לדוגמה, בשגיאה הבאה, שם המדיניות הוא regular Expression Protection-1 והקידומת היא apigee:

    RegularExpressionProtection Regular-Expression-Protection-1: Duplicate prefix apigee.
    
  2. ב-XML של המדיניות בנושא הגנה על ביטויים רגולריים שנכשל, יש לוודא ששם הקידומת שהוגדר ברכיב <Namespace> ברכיב <XMLPayload> תואם לשם הקידומת שזוהה בהודעת השגיאה (שלב 1 למעלה).

    לדוגמה, המדיניות הבאה מציינת קידומת בשם apigee ברכיב <Namespace> , שתואמת למה שמופיע בהודעת השגיאה:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
          <DisplayName>Regular Expression Protection-1</DisplayName>
          <Properties/>
          <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
          <Source>request</Source>
          <XMLPayload>
            <Namespaces>
              <Namespace prefix="apigee">http://www.apigee.com</Namespace>
              <Namespace prefix="apigee">http://www.apigee.com</Namespace>
            </Namespaces>
            <XPath>
              <Expression>/apigee:Greeting/apigee:User</Expression>
              <Type>string</Type>
              <Pattern>REGEX PATTERN</Pattern>
            </XPath>
          </XMLPayload>
        </RegularExpressionProtection>
    
  3. יש לקבוע אם הרכיב <Namespace> עם הקידומת הספציפית, שזוהה בשלב #2, הוגדר יותר מפעם אחת. אם היא מוגדרת יותר מפעם אחת, זאת הסיבה לשגיאה.

    בדוגמה של המדיניות בנושא 'הגנה על ביטוי רגולרי' שמוצגת למעלה, שימו לב שהרכיב <Namespace> עם התחילית apigee הוגדר פעמיים. לכן, מתקבלת השגיאה:

    Duplicate prefix apigee.
    

רזולוציה

מוודאים שיש רק הגדרה אחת לכל קידומת ברכיבי <Namespace> ב-regularExpressionProtection. לדוגמה:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
      <DisplayName>Regular Expression Protection-1</DisplayName>
      <Properties/>
      <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
      <Source>request</Source>
      <XMLPayload>
        <Namespaces>
          <Namespace prefix="apigee">http://www.apigee.com</Namespace>
        </Namespaces>
        <XPath>
          <Expression>/apigee:Greeting/apigee:User</Expression>
          <Type>string</Type>
          <Pattern>REGEX PATTERN</Pattern>
        </XPath>
      </XMLPayload>
    </RegularExpressionProtection>

EmptyXPathExpression

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Saving Revision revision_number
RegularExpressionProtection policy_name: Empty XPath expression.

הודעת שגיאה לדוגמה

Error Saving Revision 1
RegularExpressionProtection Regular-Expression-Protection-1: Empty XPath expression.

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

טקסט שגיאה EmptyXPathExpression

סיבה

אם ב-regularExpressionProtection לא מוגדר רכיב <Expression> בתוך הרכיב <XPath>, הפריסה של שרת ה-API של שרת ה-API תיכשל.

אבחון

  1. זיהוי המדיניות בנושא 'הגנה על ביטויים רגולריים' שנכשלה בהודעת השגיאה. לדוגמה, בשגיאה הבאה, שם המדיניות הוא regular-Expression-Protection-1:

    RegularExpressionProtection Regular-Expression-Protection-1: Empty XPath expression.
    
  2. ב-XML של מדיניות ההגנה על ביטויים רגולריים שנכשל, יש לקבוע אם יש רכיב <XMLPayload> עם רכיב צאצא <XPath> שלא הוגדר בו רכיב <Expression>, או אם הרכיב <Expression> לא מוגדר לערך כלשהו. אם כן, זו הסיבה לשגיאה.

    לדוגמה, הנה מדיניות 'הגנה על ביטויים רגולריים' שכוללת רכיב <XMLPayload>:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
      <DisplayName>Regular Expression Protection-1</DisplayName>
      <Properties/>
      <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
      <Source>request</Source>
      <XMLPayload>
        <Namespaces>
          <Namespace prefix="apigee">http://www.apigee.com</Namespace>
        </Namespaces>
        <XPath>
          <Expression></Expression>
          <Type>string</Type>
          <Pattern>REGEX PATTERN</Pattern>
        </XPath>
      </XMLPayload>
    </RegularExpressionProtection>
    

    מכיוון שיש רכיב <Expression> ריק בתוך הרכיב <XPath>, הפריסה של שרת ה-proxy של ה-API נכשלת.

רזולוציה

יש לוודא שה-regularExpressionProtection כולל רכיב <Expression> לא ריק וחוקי שמוגדר במסגרת הרכיב <XPath>. לדוגמה:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
  <DisplayName>Regular Expression Protection-1</DisplayName>
  <Properties/>
  <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
  <Source>request</Source>
  <XMLPayload>
    <Namespaces>
      <Namespace prefix="apigee">http://www.apigee.com</Namespace>
    </Namespaces>
    <XPath>
      <Expression>/apigee:Greeting/apigee:User</Expression>
      <Type>string</Type>
      <Pattern>REGEX PATTERN</Pattern>
    </XPath>
  </XMLPayload>
</RegularExpressionProtection>

EmptyJSONPathExpression

הודעת שגיאה

כשפורסים את ה-API של ה-API דרך ממשק המשתמש של Edge או Edge management API, מוצגת הודעת השגיאה הבאה:

Error Saving Revision revision_number
RegularExpressionProtection policy_name: Empty JSONPath expression.

הודעת שגיאה לדוגמה

Error Saving Revision 1
RegularExpressionProtection Regular-Expression-Protection-1: Empty JSONPath expression.

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

טקסט שגיאה EmptyJSONPathExpression

סיבה

אם ב-regularExpressionProtection לא מוגדר רכיב <Expression> בתוך הרכיב <JSONPath>, הפריסה של שרת ה-API של שרת ה-API תיכשל.

אבחון

  1. זיהוי המדיניות בנושא 'הגנה על ביטויים רגולריים' שנכשלה בהודעת השגיאה. לדוגמה, בשגיאה הבאה, שם המדיניות הוא regular-Expression-Protection-1:

    Error Saving Revision 1
    RegularExpressionProtection Regular-Expression-Protection-1: Empty JSONPath expression.
    
  2. ב-XML של מדיניות ההגנה על ביטויים רגולריים שנכשל, יש לקבוע אם יש רכיב <JSONPayload> עם רכיב צאצא <JSONPath> שלא הוגדר בו רכיב <Expression>, או אם הרכיב <Expression> לא מוגדר לערך כלשהו. אם כן, זו הסיבה לשגיאה.

    לדוגמה, הנה מדיניות 'הגנה על ביטויים רגולריים' שכוללת רכיב <JSONPayload>:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
          <DisplayName>Regular Expression Protection-1</DisplayName>
          <Properties/>
          <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
          <Source>request</Source>
          <JSONPayload>
            <JSONPath>
              <Expression></Expression>
              <Pattern>REGEX PATTERN</Pattern>
              <Pattern>REGEX PATTERN</Pattern>
            </JSONPath>
          </JSONPayload>
        </RegularExpressionProtection>
    

    מכיוון שיש רכיב <Expression> ריק בתוך הרכיב <JSONPath>, הפריסה של שרת ה-proxy של ה-API נכשלת.

רזולוציה

יש לוודא שה-regularExpressionProtection כולל רכיב <Expression> לא ריק וחוקי שמוגדר במסגרת הרכיב <JSONPath>. לדוגמה:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1">
  <DisplayName>Regular Expression Protection-1</DisplayName>
  <Properties/>
  <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
  <Source>request</Source>
  <JSONPayload>
    <JSONPath>
      <Expression>$.store.book[*].author</Expression>
      <Pattern>REGEX PATTERN</Pattern>
      <Pattern>REGEX PATTERN</Pattern>
    </JSONPath>
  </JSONPayload>
</RegularExpressionProtection>