Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

"basePath not unique" when having more than one function deployed with API Gateway #83

@l2fprod

Description

@l2fprod

My serverless.yml has two functions exposed with API Gateway:

service: serenade-users

provider:
  name: openwhisk

functions:
  login:
    handler: auth/login.main
    annotations:
      final: true
    events:
      - http:
          method: GET
          path: /login
          resp: http

  token:
    handler: auth/token.main
    annotations:
      final: true
    events:
      - http:
          method: GET
          path: /token
          resp: http

plugins:
  - serverless-openwhisk

but it fails to deploy

~/mnt/home/dev/serenade/serenade-users> sls deploy --verbose
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Compiling Functions...
Serverless: Compiled Function (login): {"actionName":"serenade-users-dev-login","overwrite":true,"action":{"exec":{"main":"main","kind":"nodejs:default","code":"<hidden>"},"limits":{"timeout":60000,"memory":256},"parameters":[{"key":"authURL","value":"https://appid-oauth.ng.bluemix.net/oauth/v3/YYY"}],"annotations":[{"key":"final","value":true},{"key":"web-export","value":true}]}}
Serverless: Compiled Function (token): {"actionName":"serenade-users-dev-token","overwrite":true,"action":{"exec":{"main":"main","kind":"nodejs:default","code":"<hidden>"},"limits":{"timeout":60000,"memory":256},"parameters":[{"key":"authURL","value":"https://appid-oauth.ng.bluemix.net/oauth/v3/YYY"},{"key":"authClientId","value":"YYY"},{"key":"authSecret","value":"XXX"}],"annotations":[{"key":"final","value":true},{"key":"web-export","value":true}]}}
Serverless: Compiling API Gateway definitions...
Serverless: Compiled API Gateway definition (login): [{"relpath":"/login","operation":"GET","responsetype":"http","action":"/_/serenade-users-dev-login","basepath":"/serenade-users"}]
Serverless: Compiled API Gateway definition (token): [{"relpath":"/token","operation":"GET","responsetype":"http","action":"/_/serenade-users-dev-token","basepath":"/serenade-users"}]
Serverless: Compiling Rules...
Serverless: Compiling Triggers & Feeds...
Serverless: Deploying Functions...
Serverless: Deploying Function: serenade-users-dev-login
Serverless: Deploying Function: serenade-users-dev-token
Serverless: Deployed Function: serenade-users-dev-login
Serverless: Deployed Function: serenade-users-dev-token
Serverless: Deploying API Gateway definitions...
Serverless: Deploying API Gateway Route: {"relpath":"/login","operation":"GET","responsetype":"http","action":"/_/serenade-users-dev-login","basepath":"/serenade-users"}
Serverless: Deploying API Gateway Route: {"relpath":"/token","operation":"GET","responsetype":"http","action":"/_/serenade-users-dev-token","basepath":"/serenade-users"}
Serverless: Deployed API Gateway Route: {"relpath":"/token","operation":"GET","responsetype":"http","action":"/_/serenade-users-dev-token","basepath":"/serenade-users"}

  Serverless Error ---------------------------------------

  Failed to deploy API Gateway route (/login) due to error: POST https://openwhisk.ng.bluemix.net/api/v1/web/whisk.system/apimgmt/createApi.http Returned HTTP 502 (Bad Gateway) --> "API creation failure: Unable to configure the API Gateway (status code 400): basePath not unique"

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           7.10.1
     Serverless Version:     1.23.0

using [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions