"Make API active" - does it do anything?

I’m trying to understand what the “Make API active” checkbox in the API designer actually does.
If I deselect the checkbox, it seems nothing actually changes?
The api is still fully functional and responds to incoming requests, and furthermore the uptime url’s for the url continue to be hit by the healthcheck daemon.

I would have expected an inactive api to not actually be active.

Is this expected behaviour?

fyi the logs show this on clicking the Update button :
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=info msg=“Using Policies from Dashboard Service”
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=info msg=“Mutex lock acquired… calling”
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=info msg=“Calling dashboard service for policy list”
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=info msg=“Processing policy list”
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=info msg="–> Processing policy ID: 5981a99f8326eb5cef645cdb"
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=info msg=“Detected 0 APIs”
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=warning msg=“No API Definitions found, not reloading”
Aug 25 03:58:46 ip-xxx tyk[9302]: time=“Aug 25 03:58:46” level=info msg=“Initiating coprocess reload”

Making an API inactive should cause it to be unloaded from your managed gateways.

can you share your gateway logs from after you changed the active state and saved the api?

logs are shown in the original message - did you mean some other logs? Not quite sure on the location, this came from syslog.

Ah, oops.

Do you only have one api configured on the dashboard?

You can see there in the logs that the gateway can’t find any APIs (so a zero list), and it defensively doesn’t reload to an empty state.

That’s why your API might still be loaded even though it is disabled.

That’s an interesting edge case if true, will need to think of a way to handle it.

Yep, it looks like an edge case and bug.

I created an issue to handle this situation Can't deactivate API if it is the only one · Issue #1035 · TykTechnologies/tyk · GitHub

Leo, Tyk Team

Yes - only 1 api defined.
So the defect seems to be if you only have 1 api active, and cannot be deactivated.
I’ll keep any eye on the Issue.

Sorry all! :slight_smile: