Several openwhisk users recently have hit a bug using serverless framework (sls) and openwhisk to deploy a function/api. I've hit the same bug when using the standalone controller + api gateway.
The symptom is failure to create an API and this error: Failed to deploy API Gateway route due to error: POST https://<ip>:31001/api/v1/web/whisk.system/apimgmt/createApi.http Returned HTTP 502 (Bad Gateway) --> "API creation failure: Unable to configure the API Gateway: "Invalid URI \"undefined/tenants\""" The issue is documented here https://github.com/serverless/serverless-openwhisk/issues/103#issuecomment-503732524 and the workaround suggested there worked for me. It is to add APIGW_ACCESS_TOKEN=APIGW_ACCESS_TOKEN to the .wskprops file. This shouldn't be necessary - maybe someone else knows why the workaround works or how to fix it properly in the gateway or the route management packages. -r