Message Logging policy deployment error troubleshooting

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

InvalidProtocol

Error message

Deployment of an API proxy through either the Edge UI or Edge management API fails with this error message:

Error Saving Revision revision_number
Invalid Protocol: invalid_protocol for Syslog handler in policy policy_name.

Example error message

Error Saving Revision 4
Invalid Protocol: HTTP for Syslog handler in policy LogToSyslog.

Example screenshot

Cause

The deployment of the MessageLogging policy policy can fail with this error if the protocol specified within the <Protocol> element is not valid. The valid protocols are TCP and UDP. For sending syslog messages over TLS/SSL, only TCP is supported.

For example, the deployment of the API Proxy fails with this error if you specify HTTP in the <Protocol> element of the MessageLogging Policy as shown below:

<Protocol>HTTP</Protocol>

Diagnosis

  1. Identify the MessageLogging policy where the error occurred. You can find this information in the error message. For example, in the following error, the policy name is LogToSyslog:

    Invalid Protocol: HTTP for Syslog handler in policy LogToSyslog.
    
  2. In the failed MessageLogging policy configuration check if the protocol specified within the <Protocol> element is valid. If there is an invalid protocol specified, then that's the cause of the error.

    For example, the following policy specifies an invalid protocol.

    <?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
    Mes>sag<eLoggi>ng na<me=&quo>t;LogToSyslog"
      Syslog
        Message[3f509b58 tag="{organization.name}.{apiproxy.name}.{environment.name}"]< Weather> requ<est >for WOEID {request<.quer>ypara<m.w}>./M<essag>e
       < Hostlog>s-01<.loggly.c>om/Ho<st
        Port51>4/Po<rt
        Protoco>lHT<TP/Prot>oco<l
        Fo>rmatM<essagetru>e</FormatMessage
    >  /Syslog
      logLevelALERT/logLevel
    /MessageLogging
    

    Because the protocol defined within the <Protocol> element is invalid, the deployment of the API Proxy fails with the error:

    Invalid Protocol: HTTP for Syslog handler in policy LogToSyslog.
    

Resolution

Ensure that the protocol defined within the <Protocol> element of the MessageLogging policy is valid. The <Protocol> element supports the following values:

  • TCP
  • UDP

To correct the example shown above, define a valid protocol within the <Protocol> element:

<?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
Mes>sag<eLoggi>ng na<me=&quo>t;LogToSyslog"
  Syslog
    Message[3f509b58 tag="{organization.name}.{apiproxy.name}.{environment.name}"]< Weather> requ<est >for WOEID {request<.quer>ypara<m.w}>./M<essag>e
   < Hostlog>s-0<1.loggly.>com/H<ost
    Port5>14/P<ort
    Protoc>olT<CP/Prot>oco<l
    Fo>rmatM<essagetru>e</FormatMessage
>  /Syslog
  logLevelALERT/logLevel
/MessageLogging

InvalidPort

Error message

Deployment of an API proxy through either the Edge UI or Edge management API fails with this error message:

Error Saving Revision revision_number
Invalid Port: 0 for Syslog handler in policy policy_name.

Example error message

Error Saving Revision 4
Invalid Port: 0 for Syslog handler in policy LogToSyslog.

Example screenshot

Cause

The deployment of the MessageLogging policy can fail with this error if the port number is not specified within the <Port> element or if it is not valid. The port number must be an integer greater than zero.

For example, if the <Port> element is declared as shown below, the deployment of the API proxy fails:

<Port>0</Port>

Diagnosis

  1. Identify the MessageLogging policy where the error occurred. You can find this information from the error message. For example, in the following error, the policy name is LogToSyslog:

    Invalid Port: 0 for Syslog handler in policy LogToSyslog.
    
  2. In the failed MessageLogging policy check if a valid port number is specified within the <Port> element. If the port number is not defined or is invalid, then that's the cause of the error.

    For example, the following policy specifies an invalid port number:

    <?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
    Mes>sag<eLoggi>ng na<me=&quo>t;LogToSyslog"
      Syslog
        Message[3f509b58 tag="{organization.name}.{apiproxy.name}.{environment.name}"]< Weather> requ<est >for WOEID {request<.quer>ypara<m.w}>.</Mess>age
     <   Hostl>ogs<-01.loggl>y.com</Host
        Por>t0/P<ort
        Protoc>olT<CP/Prot>oco<l
        Fo>rmatM<essagetru>e</FormatMessage
    >  /Syslog
      logLevelALERT/logLevel
    /MessageLogging
    

    Because the port number defined within the <Port> element is invalid, the deployment of the API Proxy fails with the error:

    Invalid Port: 0 for Syslog handler in policy LogToSyslog.
    

Resolution

Ensure that a port number is defined within the <Port> element of the MessageLogging policy. It has to be an integer greater than zero.

To correct the example shown above, define a valid port number within the <Protocol> element.

<?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
Mes>sag<eLoggi>ng na<me=&quo>t;LogToSyslog"
  Syslog
    Message[3f509b58 tag="{organization.name}.{apiproxy.name}.{environment.name}"]< Weather> requ<est >for WOEID {request<.quer>ypara<m.w}>./M<essag>e
   < Hostlog>s-0<1.loggly.>com/H<ost
    Port5>14/P<ort
    Protoc>olT<CP/Prot>oco<l
    Fo>rmatM<essagetru>e</FormatMessage
>  /Syslog
  logLevelALERT/logLevel
/MessageLogging