question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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"

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
medikoocommented, Jan 16, 2020

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

1reaction
gevorggalstyancommented, Jan 14, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Template format error: Unresolved resource dependencies in ...
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template.
Read more >
The CloudFormation template is invalid: Template format error
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block ...
Read more >
Resolve the "This template does not include any resources to ...
This error can occur when you use the AWS CloudFormation console in scenarios with any of the following: Conditional resources. The resource ......
Read more >
failure on serverless deploy Template format error
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ServerlessDeploymentBucket] in the ...
Read more >
Top 10 Serverless Deployment Errors (and How to Fix Them)
The CloudFormation stack name is '<stack-name>--'. Please resolve the issue then attempt preparation again. The cause: This situation often ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found