serverless: After Version 1.60.2 Serverless fails to deploy with Error "The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [WebsocketsApiParameter] in the Resources block of the template"

Bug Report

Description

  1. What did you do? I updated the serverless to version 1.60.5 from 1.59.3 and tried to deploy.

  2. What happened? The deployment failed with the following message:

  3. What should’ve happened? The deployment should succeed.

  4. What’s the content of your serverless.yml file? Most of it is confidential. I can share parts of it.

# region WebSockets
  ws-connection-handler:
    handler: src/functions/ws/connection-handler.ts
    events:
      - websocket:
          route: $connect

      - websocket:
          route: message

      - websocket:
          route: $default

      - websocket:
          route: $disconnect
  # endregion
  1. What’s the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy)

Error --------------------------------------------------

Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [WebsocketsApiParameter] in the Resources block of the template

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 21 (19 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @gevorggalstyan for thorough investigation, I’ll do my best to look into it shortly

I can tell for sure that it has been the reason as I have tested every single commit and file in the merges from 1.60.1 to 1.60.2 by reverting each of them and trying to redeploy every time. After narrowing down to lib/plugins/aws/package/compile/functions/index.js I applied the same approach for every changed line in that file and again narrowed down to line 436.

So my only reasoning about why switching from _.merge to Object.assign is based on factually testing and seeing that with Object.assign the stack does not deploy, but with _.merge it does.

I do share your confusion about the issue and why would this be a problem, as I have exported the result of each method and compared the files and in fact, the only differences were in the s3 file names, specifically the timestamps and DateTime, even the version numbers were the same.

We do use a lot of plugins but because of the fact that the files were the same and the versions numbers matched, to be honest, I have no idea what is going on here.

Again the only actual difference between Object.assign and _.merge that came to my mind was the deep/shallow copy, so I have decided to test my hypothesis by using parse-stringify approach and that worked.

Unfortunately, I can’t do anything more than that.