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"
        }
    }
}

गड़बड़ियों के टाइप और उनकी संभावित वजहें

JSONHTMLProtection की नीति के तहत, कई अलग-अलग तरह की CancelutionFailed गड़बड़ियां हो सकती हैं. यहां दी गई टेबल में अलग-अलग तरह की गड़बड़ियों और उनके संभावित वजहों के बारे में बताया गया है:

गड़बड़ी का टाइप वजह
ऑब्जेक्ट के नाम की तय सीमा से ज़्यादा वर्ण किसी ऑब्जेक्ट के एंट्री नाम में स्ट्रिंग की ज़्यादा से ज़्यादा लंबाई पार हो गई है.
ऑब्जेक्ट की एंट्री की संख्या तय सीमा से ज़्यादा है किसी ऑब्जेक्ट में ज़्यादा से ज़्यादा एंट्री हो सकती हैं.
अरे एलिमेंट की संख्या से ज़्यादा डेटा किसी अरे में, एलिमेंट की संख्या की तय सीमा पार हो गई है.
कंटेनर की गहराई तय सीमा से ज़्यादा है नेस्ट की गई गहराई की अधिकतम सीमा पार हो गई है.
स्ट्रिंग की वैल्यू, तय सीमा से ज़्यादा है स्ट्रिंग की वैल्यू के लिए, तय सीमा से ज़्यादा वर्ण हैं.
अमान्य 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. गड़बड़ी के मैसेज की जांच करें, ताकि JSONचिटार प्रोटेक्शन की नीति के नाम और उस लाइन नंबर की पहचान की जा सके जहां लंबा एंट्री नाम आता है. उदाहरण के लिए, इस गड़बड़ी के मैसेज में, JSONIssueProtection नीति का नाम 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. पहले चरण में पहचानी गई नीति की जांच करें और <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. इनपुट पेलोड की खास लाइन नंबर (पहले चरण में पहचानी गई) की जांच करें और देखें कि ऑब्जेक्ट के नाम की लंबाई, <ObjectEntryNameLength> एलिमेंट (दूसरे चरण में पहचाने गए) में बताई गई वैल्यू से ज़्यादा है या नहीं. अगर ऑब्जेक्ट के नाम की लंबाई उस संख्या से ज़्यादा है, तो यह गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में लाइन 2 पर number नाम की प्रॉपर्टी है. इसमें छह वर्ण हैं (नाम की लंबाई छह है). ऑब्जेक्ट के नाम की लंबाई पांच (<ObjectEntryNameLength> एलिमेंट के लिए तय की गई वैल्यू) से ज़्यादा है, इसलिए आपको यह गड़बड़ी मिलती है:

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

रिज़ॉल्यूशन

अगर JSON HTMLProtection नीति को ऐसे पेलोड से बचाना था जिनके लिए ऑब्जेक्ट एंट्री के नाम तय वैल्यू से ज़्यादा हों, तो गड़बड़ी का मैसेज दिख सकता है. इस मामले में, कुछ और करने की ज़रूरत नहीं है.

हालांकि, अगर आपको यह तय करना है कि बिना किसी नतीजे के पेलोड में लंबे ऑब्जेक्ट एंट्री के नाम बताए जा सकते हैं, तो अपनी ज़रूरतों के मुताबिक <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>एलिमेंट की वैल्यू पांच है, लेकिन इनपुट JSON पेलोड में पांच से ज़्यादा एंट्री हैं, तो यह गड़बड़ी होती है.

संक्रमण की जांच

  1. गड़बड़ी के मैसेज की जांच करें, ताकि JSONचिटार प्रोटेक्शन की नीति के नाम और उस लाइन नंबर की पहचान की जा सके जहां एंट्री की संख्या तय सीमा से ज़्यादा है. उदाहरण के लिए, नीचे दिए गए गड़बड़ी के मैसेज में, नीति का नाम 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> एलिमेंट में दी गई वैल्यू को नोट करें. इस एलिमेंट की पहचान पहले चरण में की गई थी.

    यहां दिए गए नीति के उदाहरण में, <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. इनपुट पेलोड के खास लाइन नंबर (पहले चरण में बताया गया है) की जांच करें और देखें कि क्या पेलोड में इकाइयों की संख्या, <ObjectEntryCount> एलिमेंट के लिए तय की गई वैल्यू (दूसरे चरण में दी गई है) से ज़्यादा है. अगर ऑब्जेक्ट की संख्या, ऑब्जेक्ट एंट्री की संख्या से ज़्यादा है, तो यह गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में, छठी एंट्री लाइन #7 (company) पर आती है. इनपुट JSON पेलोड में ऑब्जेक्ट एंट्री की संख्या 5 से ज़्यादा है (<ObjectEntryCount> एलिमेंट के लिए दी गई वैल्यू) आपको यह गड़बड़ी दिखती है:

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

रिज़ॉल्यूशन

अगर JSONMessageProtection नीति को तय किए गए थ्रेशोल्ड से ज़्यादा ऑब्जेक्ट एंट्री वाले पेलोड से बचाने के लिए बनाया गया था, तो गड़बड़ी का मैसेज मिल सकता है. इस मामले में, आपको कोई और कार्रवाई करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि बिना किसी नतीजे के पेलोड में ज़्यादा ऑब्जेक्ट एंट्री शामिल की जा सकती हैं, तो अपनी ज़रूरतों के हिसाब से <ObjectEntryCount> को सही वैल्यू में शामिल करें.

उदाहरण के लिए, अगर आपको लगता है कि ज़्यादा से ज़्यादा 10 ऑब्जेक्ट एंट्री की अनुमति दी जा सकती है, तो JSON फ़िल्टरProtection की नीति में इस तरह से बदलाव करें:

<?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 कलेक्शन है, जिसमें तीन से ज़्यादा एलिमेंट हैं, तो यह गड़बड़ी दिखती है.

संक्रमण की जांच

  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> एलिमेंट के लिए तय की गई वैल्यू को नोट कर लें (पहले चरण में बताया गया).

    JSON HTMLProtection की नीति के इस उदाहरण में, <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. इनपुट पेलोड की खास लाइन नंबर (पहले चरण में पहचानी गई) की जांच करें और देखें कि वहां दिए गए कलेक्शन में मौजूद आइटम की संख्या, <ArrayElementCount> एलिमेंट (दूसरे चरण में पहचाने गए) में मौजूद आइटम की संख्या से ज़्यादा है या नहीं. अगर अरे एलिमेंट की संख्या, संख्या से ज़्यादा है, तो यह गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में, models नाम के ऐरे में तीसरी लाइन पर पांच एलिमेंट हैं. क्योंकि अरे एलिमेंट की संख्या 3 से ज़्यादा है (वैल्यू <ArrayElementCount> एलिमेंट के लिए तय किया गया है) आपको यह गड़बड़ी दिखती है:

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

रिज़ॉल्यूशन

अगर JSONHTMLProtection पॉलिसी को किसी खास अरे काउंट थ्रेशोल्ड के साथ पेलोड से सुरक्षित रखने के लिए बनाया गया था, तो गड़बड़ी का मैसेज दिख सकता है. इस मामले में, आपको कुछ और करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि किसी अरे में बड़ी संख्या में एलिमेंट इस्तेमाल करने की अनुमति दी जा सकती है, तो अपनी ज़रूरतों के हिसाब से <ArrayElementCount> में सही वैल्यू डालें.

उदाहरण के लिए, अगर आपको लगता है कि ज़्यादा से ज़्यादा पांच अरे एलिमेंट को अनुमति दी जा सकती है, तो नीति में इस तरह से बदलाव करें:

<?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. गड़बड़ी के मैसेज की जांच करके, JSON IDProtection नीति के नाम और उस लाइन नंबर की पहचान करें जहां कंटेनर की वैल्यू तय सीमा से ज़्यादा है. उदाहरण के लिए, गड़बड़ी के इस मैसेज में, नीति का नाम 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> एलिमेंट के लिए तय की गई वैल्यू को नोट कर लें (पहले चरण में बताया गया).

    JSON HTMLProtection की नीति के इस उदाहरण में, <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. इनपुट पेलोड के खास लाइन नंबर (जिसकी पहचान पहले चरण में बताई गई है) की जांच करें और देखें कि क्या पेलोड में कंटेनर की गहराई <ContainerDepth> एलिमेंट में दी गई वैल्यू (दूसरे चरण में बताई गई) से ज़्यादा है. अगर कंटेनर की गहराई, संख्या से ज़्यादा है, तो यह गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में, लाइन 5 पर कंटेनर की गहराई 6 है. डेप्थ से 5 से ज़्यादा है, इसके <ContainerDepth> तत्व के लिए तय किया गया मान JSON रीडायरेक्ट करने से जुड़ी नीति के तहत आपको यह गड़बड़ी दिखती है:

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

रिज़ॉल्यूशन

अगर JSONHTMLProtection नीति को तय वैल्यू से ज़्यादा कंटेनर वाले पेलोड से सुरक्षित रखने के लिए बनाया गया था, तो गड़बड़ी का मैसेज दिख सकता है. इस मामले में, आपको कुछ और करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि कंटेनर की ज़्यादा गहराई स्वीकार की जा सकती है, तो अपनी ज़रूरतों के हिसाब से <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. (चरण 1 में बताया गया है) में <StringValueLength> एलिमेंट के लिए तय की गई वैल्यू को नोट कर लें.

    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. इनपुट पेलोड की खास लाइन नंबर (पहले चरण में पहचानी गई) की जांच करें और देखें कि वैल्यू की लंबाई, <StringValueLength> एलिमेंट के लिए तय किए गए वर्णों की संख्या (दूसरे चरण में पहचानी गई) से ज़्यादा है या नहीं. अगर वैल्यू की लंबाई सीमा से ज़्यादा है, तो यह गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में Place Name नाम का एक ऑब्जेक्ट है. इसकी वैल्यू Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu के तीसरे लाइन में 85 वर्ण हैं. मान की लंबाई इससे ज़्यादा है 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> एलिमेंट से तय किया गया इनपुट मैसेज पेलोड होता है का इस्तेमाल, JSON HTMLProtection नीति में किया गया है. यह एक मान्य JSON ऑब्जेक्ट नहीं है.

संक्रमण की जांच

  1. गड़बड़ी के मैसेज की जांच करके, नीति के नाम और उस लाइन नंबर की पहचान करें जहां गड़बड़ी हुई थी. यहां दिए गए उदाहरण में नीति का नाम JSON-Threat-Protection-1 andपेलोड 2 की लाइन है.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason: Expecting : at line 3
    
  2. इनपुट पेलोड के खास लाइन नंबर (पहले चरण में बताया गया है) की जांच करें और देखें कि पेलोड में पास किया गया JSON ऑब्जेक्ट, वाकई मान्य JSON ऑब्जेक्ट है या नहीं.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में, पंक्ति 3 में ":" (कोलन) नहीं है. यह मान्य JSON ऑब्जेक्ट नहीं है, इसलिए आपको गड़बड़ी का यह मैसेज मिला है:

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

रिज़ॉल्यूशन

पक्का करें कि ऐसे किसी भी एपीआई प्रॉक्सी को मान्य इनपुट JSON पेलोड पास किया जाए जिसमें JSONIssueProtection नीति शामिल है.

ऊपर दिए गए उदाहरण के लिए, 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"
        }
    }
}

वजह

गड़बड़ी का यह मैसेज तब दिखता है, जब JSONMajorProtection नीति के <Source> एलिमेंट में दिया गया message वैरिएबल इनमें से कोई एक हो:

  • दायरे से बाहर (उस खास फ़्लो में उपलब्ध नहीं है जहां नीति लागू की जा रही है)
  • यह मान्य वैल्यू request, response या message में से एक नहीं है

उदाहरण के लिए, यह गड़बड़ी तब होती है, जब नीति में <Source> एलिमेंट को वैरिएबल जो उस फ़्लो में मौजूद नहीं होता जहां नीति लागू की जाती है.

संक्रमण की जांच

  1. गड़बड़ी के मैसेज से नीति के नाम और सोर्स वैरिएबल के नाम की पहचान करें. उदाहरण के लिए, नीचे दिए गए गड़बड़ी के मैसेज में, नीति का नाम JSON-Threat-Protection-1 और सोर्स वैरिएबल requests है:

    JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not available
    
  2. पहले चरण में पहचाने गए <Source> एलिमेंट के लिए तय की गई वैल्यू की जांच करें.

    JSON HTMLProtection की नीति के इस उदाहरण में, <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
    

रिज़ॉल्यूशन

पक्का करें कि JSONThreatProtection नीति के <Source> एलिमेंट में सेट किया गया वैरिएबल, request, response या message पर सेट हो. साथ ही, यह भी पक्का करें कि वह उस फ़्लो में मौजूद हो जहां नीति लागू होती है.

ऊपर दिखाई गई JSON HTMLProtection नीति के उदाहरण को सही करने के लिए, <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"
        }
    }
}

वजह

यह गड़बड़ी तब होती है, जब JSONThreatProtection नीति में <Source> एलिमेंट को किसी ऐसे वैरिएबल पर सेट किया गया हो जो message टाइप का न हो.

मैसेज टाइप वैरिएबल, सभी एचटीटीपी अनुरोधों और जवाबों को दिखाते हैं. बिल्ट-इन Apigee Edge फ़्लो वैरिएबल, अनुरोध, रिस्पॉन्स, और मैसेज, मैसेज टाइप के होते हैं. यहां की यात्रा पर हूं मैसेज वैरिएबल के बारे में ज़्यादा जानने के लिए, वैरिएबल रेफ़रंस देखें.

संक्रमण की जांच

  1. JSON HTMLProtection नीति के नाम और सोर्स वैरिएबल के नाम की पहचान करें डालें. उदाहरण के लिए, नीचे दिए गए गड़बड़ी के मैसेज में, नीति का नाम JSON-Threat-Protection-1 है और सोर्स वैरिएबल message.content है:

    JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does not resolve to a Message
    
  2. JSON HTMLProtection नीति के <Source> एलिमेंट की जांच करें. इसकी पहचान, पहले चरण में की गई है.

    JSON HTMLProtection की नीति के इस उदाहरण में, <Source> को message के बजाय message.content पर सेट किया गया है:

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

रिज़ॉल्यूशन

पक्का करें कि जो JSONPreferenceProtection नीति लागू नहीं हो सकी उसमें <Source> एलिमेंट शामिल हो message टाइप फ़्लो वैरिएबल पर सेट करें, जो उस फ़्लो में मौजूद होता है जहां नीति लागू होती है.

नीति को ठीक करने के लिए, <Source> एलिमेंट में बदलाव करके, वैरिएबल तय किया जा सकता है यानी एक तरह का मैसेज. उदाहरण के लिए, नहीं हो पाने वाले JSONMajorProtection में, ये काम किए जा सकते हैं <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>