APIGEETOOL Error Uploading Service Callout Policy with causes a "beans.OtherValidationError"

We're receiving an error from apigeetool deployproxy ... when deploying a proxy containing a ServiceCallout policy with a LoadBalancer element. Copying the policy directly or uploading the proxy using a zip file works as expected.

Policy snippet:

<ServiceCallout async="false" continueOnError="false" enabled="true" name="SC.GetAccessToken">
    <DisplayName>SC.GetAccessToken</DisplayName>
    <Properties/>
    <Request clearPayload="true">
        <Set>
            <Headers>
                <Header name="Accept">application/json</Header>
            </Headers>
            <Payload contentType="application/json" variableSuffix="#" variablePrefix="%">
            {
                "Username": "%request.formparam.username#",
                "Password": "%request.formparam.password#"
            }            
            </Payload>
            <Verb>POST</Verb>
        </Set>
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    </Request>
    <Response>apigee.servicecallout.GetAccessTokenResponse</Response>
   <HTTPTargetConnection>
        <Properties>
            <Property name="success.codes">2XX</Property>
        </Properties>      
        <LoadBalancer>
            <Server name="loadbalancerserver1"/>
        </LoadBalancer>
        <Path>/api/v1/admin/token</Path>
    </HTTPTargetConnection>
</ServiceCallout>

and this is the error response:

Command failed: apigeetool deployproxy -V -u %APIGEE_USR% -p %APIGEE_PWD% -o %ORG% -e dev -n auth -d .
Error: Error uploading policy SC.GetAccessToken.xml: {
  "code" : "beans.OtherValidationError",
  "message" : "Unexpected Validation Error null",
  "contexts" : [ ]
}
Error: Error uploading policy SC.GetAccessToken.xml: {
  "code" : "beans.OtherValidationError",
  "message" : "Unexpected Validation Error null",
  "contexts" : [ ]
}
    at Request._callback (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\lib\commands\deployproxy.js:397:18)
    at Request.self.callback (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\node_modules\request\request.js:186:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\node_modules\request\request.js:1163:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\node_modules\request\request.js:1085:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)

Any ideas as to how we might fix this much appreciated.

Michael McD.

0 9 553
9 REPLIES 9

FYI: We are getting the same service callout load balancer error message when a URL and LoadBalancer elements are both defined. See here: Having issues uploading proxy using rest and APIGEETOOL

Hi @Sai Saran Vaidyanathan, looks like there is an unresolved issue with the apigeetool and the HTTPTargetConnection element. This is a big issue for us as it blocks our CI deployment pipeline.

Is there anyway we can get this actioned by Apigee?

Yes - @Noah Dietz is looking into it. Thanks for following up on the GitHub issue

Hi @michaelmcdowell I found the root cause. It is an issue with the Management API being used by apigeetool. I am working on a fix. When I have an idea of a timeline, I will post it here. I will also spend some time looking for a work around to hold you over until we can push a fix. Thanks!

Hi @ndietz1 we're thinking of trying to deploy .zip files using the underlying Apigee API.

If you have any suggestions that'd be very much appreciated.

@michaelmcdowell

Hey @michaelmcdowell , using the API directly is great work around. There is an API (here)to upload the bundle as a whole, which would circumvent the bugged code I'm fixing and is still a one-shot solution for you like apigeetool was. There is a catch in that there is a size limit on the payload for this API, which can be tough to overcome (especially for large Node.js proxies).

If you're running Node.js proxies, and you exclude the node_modules, there is an API (here) to run "npm install" for your Node proxy.

Thanks for your patience and willingness to work with me on this 🙂


@michaelmcdowell - you can also try the Maven deploy plugin as another option. There are samples you can refer to as well

@michaelmcdowell The fix for this was released. You should be able to upload the individual policy with the configuration you've pasted.

If the issue persists, please follow up and paste any additional error messages. Thank you and sorry for the slow follow up, this got dropped along the way.