rubyonjets/jets

Jets 5.0.2 cannot deploy when project completely empty

Closed this issue · 2 comments

My Environment

Software Version
Operating System macOs 12.4
Jets 5.0.2
Ruby 3.2.2

Expected Behaviour

Following the Getting Started API example, without even creating any migration (so no database needed), before invoking the scaffold for the first time, it should deploy.

So, basically:

jets new demo --mode=api
jets deploy

Should deploy, but it fails.

Current Behavior

The deploy fails 100% of the time with the following errors:

[15:09] ➜  demo git:(main) jets deploy
Deploying stack demo-dev ...
Building CloudFormation templates
Built CloudFormation templates at /tmp/jets/demo/templates
Deploying CloudFormation stack with jets app!
Waiting for stack to complete
03:09:59PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack demo-dev User Initiated
03:10:02PM CREATE_IN_PROGRESS AWS::S3::Bucket S3Bucket
03:10:06PM CREATE_IN_PROGRESS AWS::S3::Bucket S3Bucket Resource creation Initiated
03:10:33PM CREATE_COMPLETE AWS::S3::Bucket S3Bucket
03:10:35PM CREATE_COMPLETE AWS::CloudFormation::Stack demo-dev
Stack success status: CREATE_COMPLETE
Time took: 36s
The jets version has changed enough since the last build to merit refreshing the build cache.
Current jets version: 5.0.2 Last built jets version: unknown
Removing /tmp/jets/demo to start fresh.
=> jets assets:precompile
=> Copying current project directory to temporary build area: /tmp/jets/demo/stage/code
=> Reconfiguring webpacker development settings for AWS Lambda.
=> Generating shims in the handlers folder.
Checking s3://demo-dev-s3bucket-xxxxx/jets/code/code-b12e0d2f.zip
=> Creating zip file for /tmp/jets/demo/stage/code
=> cd /tmp/jets/demo/stage/code && chmod -R 755 . && zip --symlinks -rq code.zip .
Zip file created at: /tmp/jets/demo/stage/zips/code-b12e0d2f.zip (72.6 KB)
Building CloudFormation templates
Built CloudFormation templates at /tmp/jets/demo/templates
Uploading CloudFormation templates to S3.
Uploading code zip files to S3.
Uploading /tmp/jets/demo/stage/zips/code-b12e0d2f.zip (72.6 KB) to S3
Uploaded to s3://demo-dev-s3bucket-xxxxx/jets/code/code-b12e0d2f.zip
Time to upload code to s3: 0s
Checking for modified public assets and uploading to S3.
Time for public assets to s3: 0s
Deploying CloudFormation stack with jets app!
Waiting for stack to complete
03:10:45PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack demo-dev User Initiated
03:10:48PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiGateway
03:10:48PM CREATE_IN_PROGRESS AWS::IAM::Role IamRole
03:10:49PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiGateway Resource creation Initiated
03:10:50PM CREATE_IN_PROGRESS AWS::IAM::Role IamRole Resource creation Initiated
03:11:00PM CREATE_COMPLETE AWS::CloudFormation::Stack ApiGateway
03:11:01PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiResources1
03:11:02PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiResources1 Resource creation Initiated
03:11:06PM CREATE_COMPLETE AWS::IAM::Role IamRole
03:11:08PM CREATE_IN_PROGRESS AWS::IAM::Policy IamPolicy
03:11:08PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack JetsController
03:11:10PM CREATE_IN_PROGRESS AWS::IAM::Policy IamPolicy Resource creation Initiated
03:11:10PM CREATE_FAILED AWS::CloudFormation::Stack JetsController Template format error: Unresolved resource dependencies [GemLayer] in the Resources block of the template
03:11:10PM CREATE_FAILED AWS::CloudFormation::Stack ApiResources1 Resource creation cancelled
03:11:10PM CREATE_FAILED AWS::IAM::Policy IamPolicy Resource creation cancelled
03:11:11PM UPDATE_ROLLBACK_IN_PROGRESS AWS::CloudFormation::Stack demo-dev The following resource(s) failed to create: [ApiResources1, JetsController, IamPolicy].
03:11:18PM UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS AWS::CloudFormation::Stack demo-dev
03:11:19PM DELETE_COMPLETE AWS::CloudFormation::Stack JetsController
03:11:19PM DELETE_IN_PROGRESS AWS::IAM::Policy IamPolicy
03:11:19PM DELETE_IN_PROGRESS AWS::CloudFormation::Stack ApiResources1
03:11:20PM DELETE_COMPLETE AWS::IAM::Policy IamPolicy
03:11:21PM DELETE_IN_PROGRESS AWS::IAM::Role IamRole
03:11:30PM DELETE_COMPLETE AWS::CloudFormation::Stack ApiResources1
03:11:31PM DELETE_IN_PROGRESS AWS::CloudFormation::Stack ApiGateway
03:11:35PM DELETE_COMPLETE AWS::IAM::Role IamRole
03:11:42PM DELETE_COMPLETE AWS::CloudFormation::Stack ApiGateway
03:11:42PM UPDATE_ROLLBACK_COMPLETE AWS::CloudFormation::Stack demo-dev
Stack rolled back: UPDATE_ROLLBACK_COMPLETE
Time took: 57s
The Jets application failed to deploy. Jets creates a few CloudFormation stacks to deploy your application.
The logs above show the CloudFormation parent stack events and points to the stack with the error.
Please go to the CloudFormation console and look for the specific stack with the error.
The specific child stack usually shows more detailed information and can be used to resolve the issue.
Example of checking the CloudFormation console: https://rubyonjets.com/docs/debugging/cloudformation/

Step-by-step reproduction instructions

jets new demo --mode=api
jets deploy

Fixed in jets 5.0.3 Thanks for the report

@tongueroo Thank you for the prompt response, was afraid I was doing something wrong!