Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployproxy allows a null API name #187

Open
mike-carey opened this issue May 1, 2020 · 1 comment
Open

deployproxy allows a null API name #187

mike-carey opened this issue May 1, 2020 · 1 comment

Comments

@mike-carey
Copy link

mike-carey commented May 1, 2020

Description

When sending a blank api name to deployproxy, the CLI seems to use null in the URL causing a problem when attempting to grab the current revision. As a result, it attempts to create the revision as NaN and the server responds with 500 Internal Server Error

Steps to Reproduce

apigeetool deployproxy \
  -n '' \
  -o "$APIGEE_ORG" \
  -e "$APIGEE_ENV" \
  -L https://api.enterprise.apigee.com \
  -u "$APIGEE_USERNAME" \
  -p "$APIGEE_PASSWORD" \
  -d "$directory" \
  -t "$token" \
  -V

Expected Results

You have not provided the name of the api

I would expect some sort of 4XX Client HTTP Status Code from the server.

Actual Results

Going to create revision NaN of API
Using getstarted/apiproxy/getstarted.xml as the root file
Creating revision NaN of API
Proxy creation error: {
  "code" : "repository.filesystem.FailedToLoadFile",
  "message" : "Failed to load file : /organizations/$ORG/apiproxies/null/revisions/0f99f333-43e4-45da-bffd-1a8fae63c5d8/0f99f333-43e4-45da-bffd-1a8fae63c5d8.xml",
  "contexts" : [ ]
}
Error: Proxy creation failed. Status code 500
    at proxyCreationDone (/Users/michaelcarey/workspace/apigee-demo/node_modules/apigeetool/lib/commands/deployproxy.js:299:10)
    at Request._callback (/Users/michaelcarey/workspace/apigee-demo/node_modules/apigeetool/lib/commands/deployproxy.js:286:5)
    at Request.self.callback (/Users/michaelcarey/workspace/apigee-demo/node_modules/request/request.js:185:22)
    at Request.emit (events.js:203:13)
    at Request.<anonymous> (/Users/michaelcarey/workspace/apigee-demo/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:203:13)
    at IncomingMessage.<anonymous> (/Users/michaelcarey/workspace/apigee-demo/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:291:20)
    at IncomingMessage.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1168:12)
Error: Proxy creation failed. Status code 500
    at proxyCreationDone (/Users/michaelcarey/workspace/apigee-demo/node_modules/apigeetool/lib/commands/deployproxy.js:299:10)
    at Request._callback (/Users/michaelcarey/workspace/apigee-demo/node_modules/apigeetool/lib/commands/deployproxy.js:286:5)
    at Request.self.callback (/Users/michaelcarey/workspace/apigee-demo/node_modules/request/request.js:185:22)
    at Request.emit (events.js:203:13)
    at Request.<anonymous> (/Users/michaelcarey/workspace/apigee-demo/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:203:13)
    at IncomingMessage.<anonymous> (/Users/michaelcarey/workspace/apigee-demo/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:291:20)
    at IncomingMessage.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1168:12)
@whitlockjc
Copy link
Member

While I think we could/should do client-side validation of this, I think this may be better solved by making the Management API handle this better. Let me file a bug internally and I can look into working around this on the client-side for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants