Risoluzione degli errori di runtime di JSON Threat Protection

Stai visualizzando la documentazione relativa a Apigee e Apigee ibrido.
Visualizza la documentazione di Apigee Edge.

ExecutionFailed

Codice di errore

steps.jsonthreatprotection.ExecutionFailed

Corpo della risposta di errore

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

Tipi di errori e possibili cause

Il criterio JSONThreatProtection può generare molti tipi diversi di errori ExecutionFailed. Nella tabella seguente sono elencati i diversi tipi di errori e le loro possibili cause:

Tipo di errore Causa
È stata superata la lunghezza del nome dell'oggetto È stata superata la lunghezza massima della stringa consentita nel nome della voce di un oggetto.
Numero di voci di oggetti superato È stato superato il numero massimo di voci consentite in un oggetto.
Numero di elementi dell'array superato È stato superato il numero massimo di elementi consentiti in un array.
Profondità container superata La profondità nidificata massima consentita è stata superata.
Lunghezza valore stringa superata La lunghezza massima consentita per un valore di stringa è stata superata.
Oggetto JSON non valido Il payload JSON di input non è valido.

Lunghezza nome voce oggetto superata

Corpo della risposta di errore

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se il payload del messaggio di input specificato dall'elemento <Source> contiene un oggetto JSON con un nome di proprietà superiore alla lunghezza massima specificata nell'elemento <ObjectEntryNameLength>.

Ad esempio, se l'elemento <ObjectEntryNameLength> è specificato come 5 nel criterio, ma il payload del messaggio di input ha una proprietà JSON il cui nome supera i 5 caratteri, viene restituito questo errore.

Diagnosi

  1. Esamina il messaggio di errore per identificare il nome del criterio JSONThreatProtection e il numero di riga in cui si trova il nome della voce lunga. Ad esempio, nel seguente messaggio di errore, il nome del criterio JSONThreatProtection è JSON-Threat-Protection-1 e il numero di riga nel payload è 2.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry name
    length at line 2
    
  2. Esamina il criterio identificato nel passaggio 1 e prendi nota del valore specificato nell'elemento <ObjectEntryNameLength>.

    Ad esempio, nel seguente criterio JSONThreatProtection, <ObjectEntryNameLength> è impostato su 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. Esamina il numero di riga specifico (identificato nel passaggio 1) del payload di input e controlla se la lunghezza del nome dell'oggetto è superiore al valore specificato nell'elemento <ObjectEntryNameLength> (identificato nel passaggio 2). Se la lunghezza del nome dell'oggetto supera questo numero, la causa dell'errore è questa.

    Ecco un esempio di payload di input:

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

    Il payload JSON mostrato sopra ha una proprietà denominata number nella riga 2 che contiene 6 caratteri (la lunghezza del nome è 6). Poiché la lunghezza del nome dell'oggetto è maggiore di 5 (il valore specificato per l'elemento <ObjectEntryNameLength>), viene visualizzato il seguente errore:

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

Risoluzione

Se il criterio JSONThreatProtection ha lo scopo di proteggere da payload con nomi di voci di oggetti che superano il valore definito, è previsto il messaggio di errore. In questo caso, non sono richieste ulteriori azioni.

Tuttavia, se stabilisci che nel payload possono essere specificati nomi di voci di oggetti più lunghi senza alcuna conseguenza, modifica <ObjectEntryNameLength> scegliendo un valore adatto in base ai tuoi requisiti.

Ad esempio, se pensi di poter consentire nomi degli oggetti fino a una lunghezza di 10 caratteri, modifica il criterio JSONThreatProtection come segue:

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

Superato numero di voci oggetto

Corpo della risposta di errore

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se il payload del messaggio di input specificato dall'elemento <Source> contiene un oggetto JSON con più voci (proprietà) rispetto al valore specificato nell'elemento <ObjectEntryCount> del criterio.

Ad esempio, se l'elemento <ObjectEntryCount> è 5, ma il payload JSON di input ha più di 5 voci, viene generato questo errore.

Diagnosi

  1. Esamina il messaggio di errore per identificare il nome del criterio JSONThreatProtection e il numero di riga in cui viene superato il numero di voci. Ad esempio, nel seguente messaggio di errore, il nome del criterio è JSON-Threat-Protection-1 e il numero di riga nel payload è 7:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry count
    at line 7
    
  2. Annota il valore specificato nell'elemento <ObjectEntryCount> del criterio (identificato nel passaggio 1).

    Nell'esempio di criterio che segue, il criterio <ObjectEntryCount> è impostato su 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. Esamina il numero di riga specifico (identificato nel passaggio 1) del payload di input e controlla se il numero di entità nel payload è maggiore del valore specificato per l'elemento <ObjectEntryCount> (identificato nel passaggio 2). Se il numero di oggetti supera il conteggio delle voci di oggetto, questa è la causa dell'errore.

    Ecco un esempio di payload di input:

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

    Nel payload JSON mostrato sopra, la sesta voce si trova alla riga #7 (company). Poiché il conteggio delle voci dell'oggetto nel payload JSON di input è maggiore di 5 (il valore specificato per l'elemento <ObjectEntryCount>), viene visualizzato il seguente errore:

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

Risoluzione

Se il criterio JSONThreatProtection ha lo scopo di proteggere dai payload con una serie di voci di oggetto che superano una soglia specifica, è previsto il messaggio di errore. In questo caso, non sono richieste ulteriori azioni da parte tua.

Tuttavia, se stabilisci che più voci oggetto possono essere incluse nel payload senza alcuna conseguenza, modifica <ObjectEntryCount> in un valore adatto in base ai tuoi requisiti.

Ad esempio, se pensi di poter consentire fino a 10 voci di oggetto, modifica il criterio JSONThreatProtection come segue:

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

Numero di elementi dell'array superato

Corpo della risposta di errore

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se il payload del messaggio di input specificato dall'elemento <Source> contiene un array JSON con un numero di elementi superiore a quello specificato nell'elemento <ArrayElementCount> del criterio.

Ad esempio, se l'elemento <ArrayElementCount> viene specificato come 3, ma il payload di input ha un array JSON con più di tre elementi, viene generato questo errore.

Diagnosi

  1. Esamina il messaggio di errore per identificare il nome della norma e il numero di riga in cui la lunghezza dell'array viene superata. Ad esempio, nel seguente messaggio di errore, il nome del criterio è JSON-Threat-Protection-1 e il numero di riga nel payload è 3:

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded array element count at line 3
    
  2. Annota il valore specificato per l'elemento <ArrayElementCount> del criterio (identificato nel passaggio 1).

    Nel seguente esempio di criterio JSONThreatProtection, <ArrayElementCount> è impostato su 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. Esamina il numero di riga specifico (identificato nel passaggio 1) del payload di input e controlla se l'array specificato ha un conteggio superiore a quello specificato nell'elemento <ArrayElementCount> (identificato nel passaggio 2). Se il numero di elementi dell'array supera il conteggio, questa è la causa dell'errore.

    Ecco un esempio di payload di input:

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

    Il payload JSON mostrato sopra contiene 5 elementi nell'array denominato models alla riga 3. Poiché il numero di elementi array è maggiore di 3 (il valore specificato per l'elemento <ArrayElementCount>), viene visualizzato il seguente errore:

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

Risoluzione

Se il criterio JSONThreatProtection ha lo scopo di proteggere dai payload con una soglia di conteggio degli array specifica, il messaggio di errore è previsto. In questo caso, non sono richieste ulteriori azioni.

Tuttavia, se stabilisci che è possibile consentire un numero più elevato di elementi in un array, modifica <ArrayElementCount> in un valore adatto in base ai tuoi requisiti.

Ad esempio, se pensi di poter consentire fino a cinque elementi array, modifica il criterio come segue:

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

Profondità container superata

Corpo della risposta di errore

Il traffico di runtime restituisce un codice di risposta 500 con il seguente errore:

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se il payload del messaggio di input specificato dall'elemento <Source> contiene un oggetto JSON con elementi JSON con una profondità del container superiore alla profondità massima del container specificata nell'elemento <ContainerDepth> del criterio. La profondità container è la profondità nidificata massima consentita per gli elementi JSON. Ad esempio, un array che contiene un oggetto che contiene un oggetto genera una profondità di contenimento pari a 3.

Ad esempio, se l'elemento <ContainerDepth> è 3, ma il payload di input ha una profondità del container superiore a questo limite, viene generato questo errore.

Diagnosi

  1. Esamina il messaggio di errore per identificare il nome del criterio JSONThreatProtection e il numero di riga in cui viene superata la profondità del container. Ad esempio, nel seguente messaggio di errore, il nome del criterio è JSON-Threat-Protection-1 e il numero di riga nel payload è 5.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded container depth at
    line 5
    
  2. Annota il valore specificato per l'elemento <ContainerDepth> (identificato nel passaggio 1).

    Nel seguente esempio di criterio JSONThreatProtection, <ContainerDepth> è impostato su 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. Esamina il numero di riga specifico (identificato nel passaggio 1) del payload di input e controlla se la profondità del container nel payload è superiore al valore specificato nell'elemento <ContainerDepth> (identificato nel passaggio 2). Se la profondità del container supera il conteggio, è questa la causa dell'errore.

    Ecco un esempio di payload di input:

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

    Il payload JSON mostrato sopra ha una profondità del container pari a 6 alla riga 5. Poiché la profondità è maggiore di 5, al valore specificato per l'elemento <ContainerDepth> del criterio JSONThreatProtection viene visualizzato il seguente errore:

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

Risoluzione

Se il criterio JSONThreatProtection ha lo scopo di proteggere da payload con profondità di container che superano il valore specificato, è previsto il messaggio di errore. In questo caso, non sono richieste ulteriori azioni.

Tuttavia, se stabilisci che è accettabile una profondità del container più elevata, modifica <ContainerDepth> in un valore adatto in base ai tuoi requisiti.

Ad esempio, se pensi di poter consentire profondità container fino a 10, modifica il criterio come segue:

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

Lunghezza valore stringa superata

Corpo della risposta di errore

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se il payload del messaggio di input specificato dall'elemento <Source> contiene elementi JSON con valori con più caratteri di quelli consentiti dall'elemento <StringValueLength>.

Ad esempio, se l'elemento <StringValueLength> è impostato su 50 nel criterio, ma il payload di input ha uno o più elementi i cui valori contengono più di 50 caratteri, viene generato questo errore.

Diagnosi

  1. Esamina il messaggio di errore per identificare il nome della norma e il numero di riga in cui la lunghezza della stringa viene superata. Nell'esempio seguente il nome del criterio è JSON-Threat-Protection-1 andriga nel payload 3.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded string value length at line 3
    
  2. Annota il valore specificato per l'elemento <StringValueLength> nel tag (identificato nel passaggio 1).

    Nel seguente esempio di criterio JSONThreatProtection, <StringValueLength> è impostato su 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. Esamina il numero di riga specifico (identificato nel passaggio 1) del payload di input e controlla se la lunghezza del valore è superiore al numero di caratteri specificato per l'elemento <StringValueLength> (identificato nel passaggio 2). Se la lunghezza del valore supera il limite, la causa dell'errore è questa.

    Ecco un esempio di payload di input:

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

    Il payload JSON mostrato sopra ha un oggetto denominato Place Name il cui valore Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu contiene 85 caratteri nella riga 3. Poiché la lunghezza del valore è superiore a 50 (valore specificato nell'elemento <StringValueLength>), viene visualizzato il seguente errore:

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

Risoluzione

Se il criterio JSONThreatProtection ha lo scopo di proteggere da payload con valori che superano una lunghezza specifica della stringa, è previsto il messaggio di errore. In questo caso, non sono richieste ulteriori azioni.

Tuttavia, se stabilisci che è possibile specificare una lunghezza del valore maggiore nel payload, modifica <StringValueLength> in un valore adatto in base ai tuoi requisiti.

Ad esempio, se pensi di poter consentire un valore fino a 90 caratteri, modifica il criterio come segue:

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

Oggetto JSON non valido

Corpo della risposta di errore

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se il payload del messaggio di input specificato dall'elemento <Source> nel criterio JSONThreatProtection non è un oggetto JSON valido.

Diagnosi

  1. Esamina il messaggio di errore per identificare il nome del criterio e il numero di riga in cui si è verificato l'errore. Nell'esempio seguente il nome del criterio è JSON-Threat-Protection-1 andriga nel payload 2.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason: Expecting : at line 3
    
  2. Esamina il numero di riga specifico (identificato nel passaggio 1) del payload di input e controlla se l'oggetto JSON che è stato passato nel payload è effettivamente un oggetto JSON valido.

    Ecco un esempio di payload di input:

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

    Nel payload JSON mostrato sopra, la riga 3 non contiene ":" (due punti). Poiché non è un oggetto JSON valido, viene visualizzato l'errore:

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

Risoluzione

Assicurati che venga passato un payload JSON di input valido a qualsiasi proxy API che includa il criterio JSONThreatProtection.

Per l'esempio sopra descritto, modifica il payload JSON come segue:

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

SourceUnavailable

Codice di errore

steps.jsonthreatprotection.SourceUnavailable

Corpo della risposta di errore

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se la variabile message specificata nell'elemento <Source> del criterio JSONThreatProtection è:

  • Fuori ambito (non disponibile nel flusso specifico in cui viene eseguito il criterio)
  • Non è uno dei valori validi request, response o message

Ad esempio, questo errore si verifica se l'elemento <Source> nel criterio è impostato su una variabile che non esiste nel flusso in cui viene eseguito il criterio.

Diagnosi

  1. Identifica il nome del criterio e il nome della variabile Origine nel messaggio di errore. Ad esempio, nel seguente messaggio di errore, il nome del criterio è JSON-Threat-Protection-1 e la variabile di origine è requests:

    JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not available
    
  2. Esamina il valore specificato per l'elemento <Source> identificato nel passaggio 1.

    Nel seguente esempio di criterio JSONThreatProtection, l'elemento <Source> è impostato su 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>
    

    I valori validi per l'elemento <Source> sono request, response o message. Poiché le richieste non sono un valore valido e non esistono nel flusso in cui viene eseguito il criterio, viene visualizzato l'errore:

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

Risoluzione

Assicurati che la variabile impostata nell'elemento <Source> del criterio JSONThreatProtection non riuscito sia impostata su request, response o message ed esista nel flusso in cui viene eseguito il criterio.

Per correggere il criterio JSONThreatProtection di esempio mostrato sopra, puoi modificare l'elemento <Source> in modo che utilizzi la variabile request, perché esiste nel flusso di richiesta:

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

Codice di errore

steps.jsonthreatprotection.NonMessageVariable

Corpo della risposta di errore

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

Corpo di esempio della risposta di errore

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

Causa

Questo errore si verifica se l'elemento <Source> nel criterio JSONThreatProtection è impostato su una variabile che non è di tipo message.

Le variabili del tipo di messaggio rappresentano intere richieste e risposte HTTP. Le variabili di flusso Apigee integrate richiesta, risposta e messaggio sono di tipo "messaggio". Per scoprire di più sulle variabili dei messaggi, consulta Riferimento sulle variabili.

Diagnosi

  1. Identifica il nome del criterio JSONThreatProtection e il nome della variabile di origine dal messaggio di errore. Ad esempio, nel seguente messaggio di errore, il nome del criterio è JSON-Threat-Protection-1 e la variabile di origine è message.content:

    JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does not resolve to a Message
    
  2. Esamina l'elemento <Source> del criterio JSONThreatProtection (identificato nel passaggio 1).

    Nel seguente esempio di criterio JSONThreatProtection, <Source> è impostato su message.content anziché su 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>
    

    Poiché message.content non è di tipo messaggio, viene visualizzato l'errore:

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

Risoluzione

Assicurati che l'elemento <Source> nel criterio JSONThreatProtection con errori sia impostato su una variabile di flusso di tipo messaggio esistente nel flusso in cui viene eseguito il criterio.

Per correggere il criterio, puoi modificare l'elemento <Source> per specificare una variabile di tipo messaggio. Ad esempio, nel file JSONThreatProtection con errore puoi specificare l'elemento <Source> come 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>