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

Portal cannot startup when APIs are deleted on Kickstarter #25

Closed
TESAARON opened this issue Nov 1, 2016 · 4 comments
Closed

Portal cannot startup when APIs are deleted on Kickstarter #25

TESAARON opened this issue Nov 1, 2016 · 4 comments

Comments

@TESAARON
Copy link

TESAARON commented Nov 1, 2016

Hi Martin,

We encountered a slight error when deleting an API on kickstarter. On restart of the portal when an API is deleted we get the screen: 'The Portal is not yet fully initialized. Please reload in a couple of seconds.'

I debugged using 'docker-compose up' and the error seems to be that the portal is still expecting a subscription to the deleted API (called twitter-api) on a given application (test-app). The error specifically is:

"Application 'test-app' has a subscription to invalid API 'twitter-api' "

Any idea how we can rectify this? Perhaps we need to delete the entire entry for 'twitter-api' in the Kong database.

Regards,
Aaron

@DonMartin76
Copy link
Member

DonMartin76 commented Nov 1, 2016

This is actually designed behavior to prevent you making such mistakes.

Deleting an API which is in use by an application is nothing which should just be ignored and and the subscription deleted (I could have done that, and the error message you see is part of the "sanity check" at startup, so I detect these things explicitly).

Before rolling out a new version of the configuration, it is advisable to take out the data using the export API, do either a blue/green kind of deployment, or a test deployment, and import that data into the test environment.

The import API will then do exactly the same checks as the portal API at startup and tell you whether the combination of static and dynamic data fit.

To remedy your problem now you should first revert to an older version of your configuration (I assume you have it in source control, so this shouldn't be difficult), delete the subscriptions to the invalid API, and then redeploy the new configuration. On my "mental todo list" there is a feature to delete all subscriptions to an API for exactly these situations, but until now it hasn't been very pressing.

Deleting an API from a production API portal shouldn't be done often; it will force all the clients to migrate to something else, which usually will be challenging.

Hope that helps. Perhaps we can mindstorm together a little to find a feature set which helps with these things. /Martin

@TESAARON
Copy link
Author

TESAARON commented Nov 2, 2016

Hi Martin,

Many thanks for reverting. Yes I think the button was pressed by accident by one of our developers and then caused the problem! Anyway, as you mentioned, we were able to revert the changes on Github and restart from there.

Perhaps an extra dialogue box should appear with a warning on the delete? Or perhaps admin privileges to the portal should still be allowed so that he/she can delete the application as a super-user? For now we will just make sure not to press delete anymore!

Regards,
Aaron

@DonMartin76
Copy link
Member

Deleting an abandonded API is perfectly fine and should be possible. I am more thinking along the following API Lifecycle phases:

  • Add a possibility to "depreciate" an API, so that it's no longer possible to subscribe to it, but existing subscriptions are still in effect, as would documentation and Swagger still be available
  • Add a "download subscriptions CSV" functionality which would let an Admin download a list of existing subscriptions for e-mailing actions announcing the retirement of an API
  • Have an Admin functionality which lets an Admin delete all active subscriptions of an API

And in addition to that, yes, it would be good to have a "do you really know what you're doing" kind of alert in the kickstarter when deleting APIs.

Thoughts?

@DonMartin76
Copy link
Member

I'll close this one if you don't mind, and track the idea in the new issue.

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

No branches or pull requests

2 participants