أنت الآن بصدد الاطّلاع على مستندات Apigee Edge.
انتقِل إلى
مستندات Apigee X. info
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 العديد من الأنواع المختلفة من أخطاء ExecutionFailed. يسرد الجدول أدناه الأنواع المختلفة من الأخطاء وأسبابها المحتملة:
| نوع الخطأ | السبب |
| تجاوز الحد الأقصى لطول اسم إدخال العنصر | تم تجاوز الحد الأقصى لطول السلسلة المسموح به في اسم إدخال أحد العناصر. |
| تجاوز عدد إدخالات العناصر | تم تجاوز الحد الأقصى لعدد الإدخالات المسموح بها في أحد العناصر. |
| تم تجاوز عدد عناصر المصفوفة | تم تجاوز الحد الأقصى لعدد العناصر المسموح بها في مصفوفة. |
| تجاوز عمق الحاوية | تم تجاوز الحد الأقصى المسموح به للعمق المتداخل. |
| تجاوز طول قيمة السلسلة | تم تجاوز الحد الأقصى المسموح به لطول قيمة السلسلة. |
| عنصر 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 أحرف، سيتم عرض هذا الخطأ.
التشخيص
افحص رسالة الخطأ لتحديد اسم سياسة 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افحص السياسة التي حدّدتها في الخطوة 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>افحص رقم السطر المحدّد (المحدّد في الخطوة 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 إدخالات، سيظهر هذا الخطأ.
التشخيص
افحص رسالة الخطأ لتحديد اسم سياسة 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دوِّن القيمة المحدّدة في العنصر
<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>افحص رقم السطر المحدّد (المحدّد في الخطوة 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 عناصر، سيتم عرض هذا الخطأ.
التشخيص
راجِع رسالة الخطأ لتحديد اسم السياسة ورقم السطر الذي تم فيه تجاوز طول المصفوفة. على سبيل المثال، في رسالة الخطأ التالية، اسم السياسة هو
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دوِّن القيمة المحدّدة للعنصر
<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>افحص رقم السطر المحدّد (المحدّد في الخطوة 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، ولكن حمولة الإدخال تحتوي على عمق حاوية يتجاوز هذا الحدّ، سيتم عرض هذا الخطأ.
التشخيص
افحص رسالة الخطأ لتحديد اسم سياسة 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دوِّن القيمة المحدّدة للعنصر
<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>افحص رقم السطر المحدّد (الذي تم تحديده في الخطوة 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 حرفًا، سيظهر هذا الخطأ.
التشخيص
راجِع رسالة الخطأ لتحديد اسم السياسة ورقم السطر الذي تم تجاوز طول السلسلة فيه. في المثال التالي، اسم السياسة هو
JSON-Threat-Protection-1 andline in the الحمولة3.JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded string value length at line 3دوِّن القيمة المحدّدة للعنصر
<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>افحص رقم السطر المحدّد (المحدّد في الخطوة 1) من حمولة الإدخال وتحقَّق ممّا إذا كان طول القيمة أكبر من عدد الأحرف المحدّد للعنصر
<StringValueLength>(المحدّد في الخطوة 2). إذا كان طول القيمة يتجاوز الحدّ المسموح به، يكون ذلك هو سبب الخطأ.في ما يلي مثال على حمولة الإدخال:
{ "Country": "New Zealand", "Place Name": "Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu" }تحتوي حمولة JSON المعروضة أعلاه على عنصر باسم
Place Nameتبلغ قيمتهTaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu85 حرفًا في السطر 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 صالحًا.
التشخيص
افحص رسالة الخطأ لتحديد اسم السياسة ورقم السطر الذي حدث فيه الخطأ. في المثال التالي، اسم السياسة هو
JSON-Threat-Protection-1 andline in the الحمولة2.JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason: Expecting : at line 3افحص رقم السطر المحدّد (المحدّد في الخطوة 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> في السياسة على متغير غير متوفّر في المسار الذي يتم فيه تنفيذ السياسة.
التشخيص
حدِّد اسم السياسة واسم المتغيّر "المصدر" من رسالة الخطأ. على سبيل المثال، في رسالة الخطأ التالية، اسم السياسة هو
JSON-Threat-Protection-1ومتغيّر المصدر هوrequests:JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not availableافحص القيمة المحدّدة للعنصر
<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 كاملة. تكون متغيرات التدفق request وresponse وmessage المضمّنة في Apigee Edge من النوع message. لمزيد من المعلومات عن متغيّرات الرسائل، يُرجى الاطّلاع على مرجع المتغيّرات.
التشخيص
حدِّد اسم سياسة JSONThreatProtection واسم المتغير المصدر من رسالة الخطأ. على سبيل المثال، في رسالة الخطأ التالية، اسم السياسة هو
JSON-Threat-Protection-1ومتغيّر المصدر هوmessage.content:JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does not resolve to a Messageافحص العنصر
<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 التي تعذّر تنفيذها تم ضبطه على متغيّر تدفق من النوع message المتوفّر في التدفق الذي يتم فيه تنفيذ السياسة.
لتصحيح السياسة، يمكنك تعديل العنصر <Source> لتحديد متغيّر من النوع message. على سبيل المثال، في 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>