تحديد المشاكل وحلّها في وقت تشغيل ميزة "الحماية من التهديدات باستخدام JSON"

أنت تعرض مستندات Apigee Edge.
انتقل إلى مستندات Apigee X.
معلومات

ExecutionFailed

رمز الخطأ

steps.jsonthreatprotection.ExecutionFailed

نص الاستجابة للخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]: error_description
          at line line_num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

أنواع الأخطاء والأسباب المحتمَلة

يمكن أن تؤدي سياسة JSONThreatProtection إلى العديد من الأنواع المختلفة من أخطاء ExecutionFound (تعذّر التنفيذ). يسرد الجدول أدناه الأنواع المختلفة من الأخطاء وأسبابها المحتملة:

نوع الخطأ السبب
تم تجاوز طول اسم إدخال العنصر تم تجاوز الحد الأقصى لطول السلسلة المسموح به في اسم إدخال العنصر.
تم تجاوز عدد الإدخالات في العنصر تم تجاوز الحد الأقصى لعدد الإدخالات المسموح بها في العنصر.
تجاوز عدد عناصر المصفوفة تم تجاوز الحد الأقصى لعدد العناصر المسموح بها في الصفيف.
تم تجاوز عمق الحاوية تم تجاوز الحد الأقصى المسموح به للعمق المتداخل.
تم تجاوز طول قيمة السلسلة تم تجاوز الحد الأقصى المسموح به لعدد أحرف قيمة السلسلة.
كائن JSON غير صالح حمولة JSON الأساسية التي تم إدخالها غير صالحة.

تم تجاوز طول اسم إدخال العنصر

نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded object entry name length at line line_num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded object entry name length at line 2",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

السبب

يحدث هذا الخطأ إذا كانت حمولة رسالة الإدخال المحدّدة من خلال العنصر <Source> تحتوي على عنصر JSON يحمل اسم سمة يتجاوز الحد الأقصى للطول المحدّد في العنصر <ObjectEntryNameLength>.

على سبيل المثال، إذا تم تحديد العنصر <ObjectEntryNameLength> على أنّه 5 في السياسة، وكان حمولة الرسالة المُدخَلة يحتوي على سمة JSON يتجاوز اسمها 5 أحرف، يتم عرض هذا الخطأ.

التشخيص

  1. راجِع رسالة الخطأ لتحديد اسم سياسة JSONThreatProtection ورقم السطر الذي يظهر فيه اسم الإدخال الطويل. على سبيل المثال، في رسالة الخطأ التالية، اسم السياسة JSONThreatProtection هو JSON-Threat-Protection-1 ورقم السطر في الحمولة هو 2.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry name
    length at line 2
    
  2. تحقَّق من السياسة التي حدّدتها في الخطوة 1 ولاحظ القيمة المحدّدة في العنصر <ObjectEntryNameLength>.

    على سبيل المثال، في سياسة JSONThreatProtection التالية، تم ضبط <ObjectEntryNameLength> على 5:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>12</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>5</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. افحص رقم السطر المحدّد (المحدّد في الخطوة 1) لحمولة الإدخال وتحقَّق مما إذا كان طول اسم العنصر أكبر من القيمة المحدّدة في العنصر <ObjectEntryNameLength> (الذي تم تحديده في الخطوة 2). إذا كان طول اسم العنصر يتجاوز هذا العدد، هذا هو سبب الخطأ.

    في ما يلي مثال على حمولة الإدخال:

    {
       "number" : 500,
       "string" : "text"
    }
    

    تحتوي حمولة JSON الموضحة أعلاه على سمة باسم number في السطر 2 وتحتوي على 6 أحرف (طول الاسم هو 6). بما أنّ طول اسم الكائن أكبر من 5 (القيمة المحدّدة للعنصر <ObjectEntryNameLength>)، ستحصل على الخطأ التالي:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry name
    length at line 2
    

الدقة

إذا كانت سياسة JSONThreatProtection تهدف إلى الحماية من الحمولات التي تحتوي على أسماء إدخالات كائنات تتجاوز القيمة المحدّدة، من المتوقع ظهور رسالة الخطأ. وفي هذه الحالة، ليس عليك اتّخاذ أي إجراء إضافي.

ومع ذلك، إذا قررت إمكانية تحديد أسماء أطول لإدخال العناصر في الحمولة بدون أي عواقب، يمكنك تعديل السمة <ObjectEntryNameLength> إلى قيمة مناسبة استنادًا إلى متطلّباتك.

على سبيل المثال، إذا كنت تعتقد أنّه يمكنك السماح بأسماء عناصر تصل إلى 10 أحرف، يمكنك تعديل سياسة JSONThreatProtection على النحو التالي:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>12</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>10</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

تجاوز عدد إدخالات العناصر

نص الاستجابة للخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded object entry count at line line_num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded object entry count at line 7",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

السبب

يحدث هذا الخطأ إذا كانت حمولة رسالة الإدخال التي يحدِّدها العنصر <Source> تحتوي على كائن JSON يحتوي على إدخالات (خصائص) أكثر من القيمة المحدّدة في العنصر <ObjectEntryCount> في السياسة.

على سبيل المثال، إذا كان عنصر <ObjectEntryCount> هو 5، ولكنّ الحمولة في ملف JSON المُدخلة تحتوي على أكثر من 5 إدخالات، يتمّ طرح هذا الخطأ.

التشخيص

  1. راجِع رسالة الخطأ لتحديد اسم سياسة JSONThreatProtection ورقم السطر الذي تم تجاوز عدد الإدخالات فيه. على سبيل المثال، في رسالة الخطأ التالية، يكون اسم السياسة هو JSON-Threat-Protection-1 ورقم السطر في الحمولة هو 7:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry count
    at line 7
    
  2. دوِّن القيمة المحدّدة في العنصر <ObjectEntryCount> للسياسة (المحدَّدة في الخطوة 1).

    في مثال السياسة التالي، يتم ضبط <ObjectEntryCount> على 5:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>12</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>6</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. افحص رقم السطر المحدّد (المحدّد في الخطوة 1) لحمولة الإدخال وتحقَّق مما إذا كان عدد الكيانات في الحمولة أكبر من القيمة المحدّدة للعنصر <ObjectEntryCount> (الذي تم تحديده في الخطوة 2). إذا تجاوز عدد العناصر عدد الإدخالات في الكائن، يكون هذا هو سبب الخطأ.

    في ما يلي مثال على حمولة الإدخال:

    {
    "name" : "John",
    "id" : 234687,
    "age" : 31,
    "city" : "New York",
    "country" : "USA",
    "company" : "Google"
    }
    

    في حمولة JSON الموضحة أعلاه، يظهر الإدخال السادس في السطر رقم 7 (الشركة). نظرًا لأن عدد إدخالات الكائن في حمولة البيانات الأساسية بتنسيق JSON أكبر من 5 (القيمة المحدّدة للعنصر <ObjectEntryCount>) ستحصل على الخطأ التالي:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry count at
    line 7
    

الدقة

إذا كانت سياسة JSONThreatProtection تهدف إلى الحماية من الحمولات التي تتضمن عددًا من إدخالات الكائنات التي تتجاوز حدًا محددًا، من المتوقع ظهور رسالة الخطأ. وفي هذه الحالة، لن تحتاج إلى اتخاذ أي إجراء إضافي.

ومع ذلك، إذا قررت إمكانية تضمين المزيد من إدخالات العناصر في الحمولة بدون أي عواقب، عليك تعديل <ObjectEntryCount> إلى قيمة مناسبة استنادًا إلى متطلّباتك.

على سبيل المثال، إذا كنت تعتقد أنه يمكنك السماح بما يصل إلى 10 إدخالات للكائنات، عدِّل سياسة JSONThreatProtection على النحو التالي:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>12</ContainerDepth>
    <ObjectEntryCount>10</ObjectEntryCount>
    <ObjectEntryNameLength>6</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

تم تجاوز عدد عناصر الصفيفة

نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded array element count at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded array element count at line 3",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

السبب

يحدث هذا الخطأ إذا كانت حمولة رسالة الإدخال التي يحدِّدها العنصر <Source> تحتوي على مصفوفة JSON التي تحتوي على عدد من العناصر أكبر من الرقم المحدّد في العنصر <ArrayElementCount> من السياسة.

على سبيل المثال، إذا تم تحديد العنصر <ArrayElementCount> على أنّه 3، وكانت حمولة البيانات المُدخلة تحتوي على مصفوفة JSON تضم أكثر من 3 عناصر، يتم عرض هذا الخطأ.

التشخيص

  1. افحص رسالة الخطأ لتحديد اسم السياسة ورقم السطر الذي يتم فيه تجاوز طول الصفيف. على سبيل المثال، في رسالة الخطأ التالية، يكون اسم السياسة هو JSON-Threat-Protection-1 ورقم السطر في الحمولة هو 3:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded array element count at line 3
    
  2. دوِّن القيمة المحدّدة للعنصر <ArrayElementCount> في السياسة (المحدَّدة في الخطوة 1).

    في المثال التالي على سياسة JSONThreatProtection، تم ضبط <ArrayElementCount> على 3:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>12</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>6</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. راجِع رقم السطر المحدّد (الذي تم تحديده في الخطوة 1) من الحمولة المُدخلة وتحقّق مما إذا كانت الصفيف المحدّدة هناك تحتوي على عدد أكبر من العدد المحدّد في عنصر <ArrayElementCount> (الذي تم تحديده في الخطوة 2). إذا تجاوز عدد عناصر الصفيفة العدد، فإن هذا هو سبب الخطأ.

    في ما يلي مثال على حمولة الإدخال:

    {
     "name":"Ford",
     "models":[
        "Mustang",
        "Endeavour",
        "Fiesta",
        "EcoSport",
        "Focus"
     ]
    }
    

    تحتوي حمولة JSON المعروضة أعلاه على 5 عناصر في الصفيف المُسمى models في السطر 3. نظرًا لأن عدد عناصر الصفيفة أكبر من 3 (قيمة المحدد للعنصر <ArrayElementCount>) ستحصل على الخطأ التالي:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded array element count
    at line 3
    

الدقة

إذا كانت سياسة JSONThreatProtection مخصّصة للحماية من حِزم البيانات التي تحتوي على حدّ أدنى لعدد الصفائف، من المتوقّع ظهور رسالة الخطأ. وفي هذه الحالة، لن يُطلب منك اتخاذ أي إجراء إضافي.

ومع ذلك، إذا قررت أنّه يمكن السماح بعدد أكبر من العناصر في المصفوفة، يمكنك تعديل <ArrayElementCount> إلى قيمة مناسبة استنادًا إلى متطلّباتك.

على سبيل المثال، إذا كنت تعتقد أنّه يمكنك السماح بما يصل إلى 5 عناصر صفيف، يمكنك تعديل السياسة على النحو التالي:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>5</ArrayElementCount>
    <ContainerDepth>12</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>6</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

تم تجاوز عمق الحاوية

نص استجابة الخطأ

تعرض حركة البيانات في بيئة التشغيل رمز الاستجابة 500 مع الخطأ التالي:

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded container depth at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded container depth at line 5",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

السبب

يحدث هذا الخطأ إذا كانت حمولة رسالة الإدخال التي يحدّدها العنصر <Source> تحتوي على كائن JSON يحتوي على عناصر JSON بعمق حاوية يتجاوز الحد الأقصى لعمق الحاوية المحدد في عنصر <ContainerDepth> الخاص بالسياسة. عمق الحاوية هو الحد الأقصى المسموح به للعمق المُدمَج لعناصر JSON. على سبيل المثال، قد ينتج عن الصفيف الذي يحتوي على كائن يحتوي على كائن عمق احتواء يبلغ 3.

على سبيل المثال، إذا كان العنصر <ContainerDepth> هو 3، وكان عمق حاوية البيانات الأساسية للإدخال يتجاوز هذا الحد، يتم عرض هذا الخطأ.

التشخيص

  1. افحص رسالة الخطأ لتحديد اسم سياسة JSONThreatProtection ورقم السطر الذي يتم فيه تجاوز عمق الحاوية. على سبيل المثال، في رسالة الخطأ التالية، يكون اسم السياسة هو JSON-Threat-Protection-1 ورقم السطر في الحمولة هو 5.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded container depth at
    line 5
    
  2. دوِّن القيمة المحدّدة للعنصر <ContainerDepth> (الذي تم تحديده في الخطوة 1).

    في المثال التالي على سياسة JSONThreatProtection، تم ضبط <ContainerDepth> على 5:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. افحص رقم السطر المحدّد (المحدّد في الخطوة 1) لحمولة الإدخال وتحقَّق مما إذا كان عمق الحاوية في الحمولة أعلى من القيمة المحدّدة في العنصر <ContainerDepth> (الذي تم تحديده في الخطوة 2). وإذا تجاوز عمق الحاوية العدد، فإن هذا هو سبب الخطأ.

    في ما يلي مثال على حمولة الإدخال:

    {
     "ContainerDepth2":[ {
           "ContainerDepth4":[
              {
                 "ContainerDepth6":[
                    "1",
                    "2"
                 ]
              }
           ]
        }
     ]
    }
    

    تحتوي حمولة JSON المعروضة أعلاه على عمق حاوية يبلغ 6 في السطر 5. منذ العمق أكبر من 5، والقيمة المحددة لعنصر <ContainerDepth> تحصل سياسة JSONThreatProtection على الخطأ التالي:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded container depth at
    line 5
    

الدقة

إذا كانت سياسة JSONThreatProtection تهدف إلى الحماية من الحمولات التي تحتوي على عمق للحاويات التي تتجاوز القيمة المحدّدة، من المتوقع ظهور رسالة الخطأ. وفي هذه الحالة، لن يُطلب منك اتخاذ أي إجراء إضافي.

وإذا قررت أنّ زيادة عمق الحاوية مقبولة، يمكنك تعديل السمة <ContainerDepth> إلى قيمة مناسبة بناءً على متطلّباتك.

على سبيل المثال، إذا كنت تعتقد أنّه يمكنك السماح بعمق الحاوية حتى 10، يمكنك تعديل السياسة على النحو التالي:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>10</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

تم تجاوز طول قيمة السلسلة

نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded string value length at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded string value length at line 3",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

السبب

يحدث هذا الخطأ إذا كانت حمولة رسالة الإدخال التي يحدِّدها العنصر <Source> تحتوي على عناصر JSON التي تحتوي على قيم تحتوي على عدد أحرف أكبر من الذي يسمح به العنصر <StringValueLength>.

على سبيل المثال، إذا تم ضبط العنصر <StringValueLength> على 50 في السياسة، وكانت حمولة البيانات المُدخلة تشتمل على عنصر واحد أو أكثر تشتمل قيمه على أكثر من 50 حرفًا، سيتم عرض هذا الخطأ.

التشخيص

  1. افحص رسالة الخطأ لتحديد اسم السياسة ورقم السطر الذي يتم تجاوز طول السلسلة فيه. في المثال التالي، يظهر اسم السياسة في سطر JSON-Threat-Protection-1 andفي الحمولة 3.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded string value length at line 3
    
  2. دوِّن القيمة المحدّدة للعنصر <StringValueLength> في (المعرّف في الخطوة 1).

    في المثال التالي على سياسة JSONThreatProtection، تم ضبط <StringValueLength> على 50:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. افحص رقم السطر المحدّد (المحدّد في الخطوة 1) لحمولة الإدخال وتحقَّق مما إذا كان طول القيمة أكبر من عدد الأحرف المحدّد للعنصر <StringValueLength> (الذي تم تحديده في الخطوة 2). إذا تجاوز طول القيمة الحدّ الأقصى، هذا هو سبب الخطأ.

    في ما يلي مثال على حمولة الإدخال:

    {
      "Country": "New Zealand",
      "Place Name": "Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu"
    }
    

    تحتوي حمولة JSON الموضحة أعلاه على عنصر باسم Place Name وقيمته Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu يتكون من 85 حرفًا في السطر 3. نظرًا لأن طول القيمة أكبر من 50، إذا كانت القيمة محددة في العنصر <StringValueLength>، فستحصل على الخطأ التالي:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded string value length
    at line 3
    

الدقة

إذا كانت سياسة JSONThreatProtection تهدف إلى الحماية من الحمولات ذات القيم التي تتجاوز طول سلسلة معيّنة، من المتوقع ظهور رسالة الخطأ. وفي هذه الحالة، لن يُطلب منك اتخاذ أي إجراء إضافي.

وإذا قررت إمكانية تحديد طول قيمة أطول في الحمولة، يمكنك تعديل <StringValueLength> إلى قيمة مناسبة بناءً على متطلّباتك.

على سبيل المثال، إذا كنت تعتقد أنه يمكنك السماح بقيمة يصل طولها إلى 90، فعدِّل السياسة على النحو التالي:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>5</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>90</StringValueLength>
</JSONThreatProtection>

عنصر JSON غير صالح

نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: string: at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: Expecting : at line 3",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

السبب

يحدث هذا الخطأ إذا لم تكن حمولة رسالة الإدخال المحدّدة بواسطة العنصر <Source> في سياسة JSONThreatProtection كائن JSON صالحًا.

التشخيص

  1. افحص رسالة الخطأ لتحديد اسم السياسة ورقم السطر الذي حدث فيه الخطأ. في المثال التالي، يظهر اسم السياسة في سطر JSON-Threat-Protection-1 andفي الحمولة 2.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason: Expecting : at line 3
    
  2. راجِع رقم السطر المحدّد (الذي تم تحديده في الخطوة 1) من الحمولة المُدخلة وتحقّق مما إذا كان عنصر JSON الذي تم تمريره في الحمولة هو عنصر JSON صالح.

    في ما يلي مثال على حمولة الإدخال:

    {
      "Longitude": 6.11499,
      "Latitude"  50.76891
    }
    

    في حمولة JSON الموضحة أعلاه، لا يحتوي السطر 3 على ":" (نقطتان). ولأنّه ليس كائن JSON صالحًا، ستتلقّى رسالة الخطأ:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    Expecting : at line 3
    

الدقة

تأكَّد من تمرير حمولة بيانات JSON صالحة للإدخال إلى أي خادم وكيل لواجهة برمجة تطبيقات يتضمّن سياسة JSONThreatProtection.

بالنسبة إلى المثال الموضّح أعلاه، عدِّل الحمولة بتنسيق JSON على النحو التالي:

{
    "Longitude": 6.11499,
  "Latitude" : 50.76891
}

SourceUnavailable

رمز الخطأ

steps.jsonthreatprotection.SourceUnavailable

نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]::
          Source[var_name] is not available"
        "detail": {
            "errorcode": "steps.jsonthreatprotection.SourceUnavailable"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]::
          Source requests is not available",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.SourceUnavailable"
        }
    }
}

السبب

يحدث هذا الخطأ إذا كان المتغيّر message المحدَّد في العنصر <Source> من سياسة JSONThreatProtection أي مما يلي:

  • خارج النطاق (لا تتوفّر خلال المسار المحدّد الذي يتم فيه تنفيذ السياسة)
  • ليست إحدى القيم الصالحة request أو response أو message

على سبيل المثال، يحدث هذا الخطأ إذا تم ضبط العنصر <Source> في السياسة على متغيّر غير متوفّر في مسار تنفيذ السياسة.

التشخيص

  1. حدِّد اسم السياسة واسم متغيّر المصدر من رسالة الخطأ. على سبيل المثال، في رسالة الخطأ التالية، يكون اسم السياسة هو JSON-Threat-Protection-1 ومتغيّر المصدر هو requests:

    JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not available
    
  2. افحص القيمة المحدّدة للعنصر <Source> والمحدّد في الخطوة 1.

    في المثال التالي على سياسة JSONThreatProtection، تم ضبط العنصر <Source> على requests.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>requests</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    

    القيم الصالحة للعنصر <Source> هي request أو response أو message. لأنّ requests ليست قيمة صالحة ولا تتوفّر في العملية التي يتم فيها تنفيذ السياسة، يظهر لك الخطأ التالي:

    JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not available
    

الدقة

تأكَّد من ضبط المتغيّر في عنصر <Source> لسياسة JSONThreatProtection التي تعذّر تنفيذها على request أو response أو message وأنّه متوفّر في العملية التي يتم تنفيذ السياسة فيها.

لتصحيح مثال سياسة JSONThreatProtection الموضَّح أعلاه، يمكنك تعديل العنصر <Source> لاستخدام المتغيّر request، لأنّه متوفّر في مسار الطلب:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>5</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

NonMessageVariable

رمز الخطأ

steps.jsonthreatprotection.NonMessageVariable

نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Variable var_name does not resolve to a Message"
        "detail": {
            "errorcode": "steps.jsonthreatprotection.NonMessageVariable"
        }
    }
}

مثال على نص استجابة الخطأ

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Variable message.content does not resolve to a Message",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.NonMessageVariable"
        }
    }
}

السبب

يحدث هذا الخطأ إذا تم ضبط العنصر <Source> في السياسة JSONThreatProtection يتم ضبطها على متغيّر ليس من النوع message.

تمثِّل متغيّرات نوع الرسالة طلبات واستجابات HTTP كاملة. يأتي الإصدار المدمَج يكون طلب متغيرات تدفق Apigee Edge والاستجابة والرسالة من نوع الرسالة. إلى لمعرفة المزيد من المعلومات عن متغيّرات الرسائل، اطّلِع على مرجع المتغيّرات.

التشخيص

  1. تحديد اسم سياسة JSONThreatProtection واسم متغيّر المصدر من رسالة الخطأ. على سبيل المثال، في رسالة الخطأ التالية، سيظهر اسم السياسة هو JSON-Threat-Protection-1 ومتغيّر المصدر هو message.content:

    JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does not resolve to a Message
    
  2. افحص العنصر <Source> في سياسة JSONThreatProtection (المحدَّدة في الخطوة 1).

    في مثال سياسة JSONThreatProtection التالي، تم ضبط <Source> على message.content بدلاً من message:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>message.content</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    

    بما أنّ "message.content" ليس من النوع "رسالة"، ستتلقّى الخطأ:

    JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does
    not resolve to a Message
    

الدقة

تأكَّد من أنّ العنصر <Source> في سياسة JSONThreatProtection التي تعذّرت معالجتها هو. يتم ضبطها على متغيّر تدفق النوع رسالة متوفّر في المسار الذي يتم فيه تنفيذ السياسة.

لتصحيح السياسة، يمكنك تعديل العنصر <Source> لتحديد متغيّر. من النوع الذي يناسب الرسالة. على سبيل المثال، في عملية JSONThreatProtection التي أخفقت، يمكنك تحديد العنصر <Source> كـ message:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>5</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>message</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>