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

Event Subscription/Deletion bug #501

Open
johnlim opened this issue Aug 14, 2018 · 1 comment
Open

Event Subscription/Deletion bug #501

johnlim opened this issue Aug 14, 2018 · 1 comment

Comments

@johnlim
Copy link

johnlim commented Aug 14, 2018

This is a Bug Report

When deploying, i get the following error (seemed to happen after i did a function rename)

Could not subscribe the userMicroservice-dev-main function to the '/xxx-usermicroservice/' endpoint. A subscription for that endpoint and method already exists in another service. Please remove that subscription before registering this subscription.

When I then do a sls remove, I get this error

  Failed to delete http.request event type due the error: Event type cannot be deleted because there are subscriptions using it.

My environment is as follows:

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           8.11.3
     Serverless Version:     1.30.0

May I also know how I can delete an app from the Dashboard? Thanks.

@johnlim
Copy link
Author

johnlim commented Aug 14, 2018

##Update
I managed to duplicate the issue. Using the project from https://github.com/serverless/event-gateway-getting-started as an example:
The steps to reproduce the issue are as follows

  1. Clone the repo
  2. Modify serverless.yml to your own tenant and app
  3. Run npm install and then sls deploy
  4. Add a name parameter to the getUser function in serverless.yml as follows
functions:
  getUser:
    handler: handler.getUsers
    name: "whoAmIs"
    events:
      - eventgateway:
          type: sync
          eventType: http.request
          path: /users/:id
          method: GET
  1. Run sls deploy
  2. Modify the name parameter again. For example:
functions:
  getUser:
    handler: handler.getUsers
    name: "whoAmIsssssss" #update the name
    events:
      - eventgateway:
          type: sync
          eventType: http.request
          path: /users/:id
          method: GET
  1. Run sls deploy
  2. Error is displayed
Event Gateway Plugin
Serverless: WARNING: Inappropriate call of provider.request()
EventGateway: Function "getUser" registered. (ID: whoAmIs)
 
  Error --------------------------------------------------
 
  Could not subscribe the whoAmIs function to the '/huubaper-test/users/:id' endpoint. A subscription for that endpoint and method already exists in another service. Please remove that subscription before registering this subscription.
  1. Run sls remove
  2. Following error is displayed
Event Gateway Plugin
EventGateway: Subscription "user.created" removed from function: test-dev-emailUser
EventGateway: Subscription "http.request" removed from function: test-dev-createUser
EventGateway: Event Type "email.sent" removed.
 
  Error --------------------------------------------------
 
  Failed to delete http.request event type due the error: Event type cannot be deleted because there are subscriptions using it.

iirc, I've also encountered this issue when updating the handler name. Hope this helps.

@johnlim johnlim changed the title Coud not subscribe to function from endpoint error Event Subscription/Deletion bug Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant