Gitlab deployment failing


#1

When I try to deploy using gitlab ci, I get this weird error: Jets::Error: Rsync is required. Rsync does not seem to be installed.
My base image is the ruby 2.5 one and I am using ‘jets deploy’


#2

Jets uses rsync to copy files. So rsync is required. That message is comes up when it is detected that rsync is not installed. Try installing rsync on your gitlab ci server. If you don’t have access to that, maybe consider codebuild https://rubyonjets.com/docs/extras/codebuild/


#3

Thanks Tung, that fixed the error but now I get a new one ’ NoMethodError: undefined method `strip’ for nil:NilClass’


#4

:thinking: No clue. Probably not enough info.


#5

I’ll keep digging :slightly_smiling_face: thanks for the help as usual


#6

Fixed it by using yes to pipe answer to prompt when asked about sending anonymous logs


#7

Oh I see. This my help: https://rubyonjets.com/faq/ You can set the JETS_ENV env var to bypass that prompt. Examples:

JETS_AGREE=yes jets deploy
JETS_AGREE=no jets deploy

FWIW, sending the gem information helps lambdagems build out more binary gems and the rest of the community.


#8

oh brilliant, thanks for sending it!


#9

One last point, getting a weird failure:
The deployment works:
API Gateway Endpoint: https://prcha7gfsk.execute-api.us-east-1.amazonaws.com/dev_2/
ERROR: Job failed: exit code 1

Does jets reply with an exit code 1 when it finishes deploying?


#10

It should only exit 1 (failed) when there’s a failed deploy. IE: CloudFormation stack rolls back. Otherwise, it should exit 0 (success). This behavior is specifically designed for CI/CD. Just tested it. Here’s the deploy output and the exit status from the jets deploy command.

JETS_ENV=production jets deploy

$ JETS_ENV=production jets deploy
Deploying to Lambda demo-prod environment…
Building CloudFormation templates.
Deploying CloudFormation stack with jets app!
Waiting for stack to complete
10:18:14PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack demo-prod User Initiated
10:18:17PM CREATE_IN_PROGRESS AWS::S3::Bucket S3Bucket
10:18:18PM CREATE_IN_PROGRESS AWS::S3::Bucket S3Bucket Resource creation Initiated
10:18:39PM CREATE_COMPLETE AWS::S3::Bucket S3Bucket
10:18:40PM CREATE_COMPLETE AWS::CloudFormation::Stack demo-prod
Stack success status: CREATE_COMPLETE
Time took for stack deployment: 30s.
The /tmp/jets/demo/cache folder exists. Incrementally re-building the jets using the cache. To clear the cache: rm -rf /tmp/jets/demo/cache
=> Compling assets in current project directory
=> yarn install
yarn install v1.9.4
warning package.json: No license field

/public/packs/manifest.json.br
Uploading s3://demo-prod-s3bucket-1t5jo7lgwp7y9/jets/public/packs/css/theme-a1247bca.css.gz
Time for public assets to s3: 0s
Deploying CloudFormation stack with jets app!
Waiting for stack to complete
10:19:03PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack demo-prod User Initiated
10:19:07PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiGateway
10:19:08PM CREATE_IN_PROGRESS AWS::Lambda::LayerVersion GemLayer
10:19:08PM CREATE_IN_PROGRESS AWS::IAM::Role IamRole
10:19:08PM CREATE_IN_PROGRESS AWS::IAM::Role IamRole Resource creation Initiated
10:19:08PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiGateway Resource creation Initiated
10:19:19PM CREATE_COMPLETE AWS::CloudFormation::Stack ApiGateway
10:19:19PM CREATE_IN_PROGRESS AWS::Lambda::LayerVersion GemLayer Resource creation Initiated
10:19:19PM CREATE_COMPLETE AWS::Lambda::LayerVersion GemLayer
10:19:21PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiResources1
10:19:22PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiResources1 Resource creation Initiated
10:19:23PM CREATE_COMPLETE AWS::IAM::Role IamRole
10:19:25PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack JetsPreheatJob
10:19:26PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack JetsPreheatJob Resource creation Initiated
10:19:33PM CREATE_COMPLETE AWS::CloudFormation::Stack ApiResources1
10:19:35PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack JetsPublicController
10:19:35PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack PostsController
10:19:36PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack JetsPublicController Resource creation Initiated
10:19:36PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack PostsController Resource creation Initiated
10:20:10PM CREATE_COMPLETE AWS::CloudFormation::Stack JetsPublicController
10:20:10PM CREATE_COMPLETE AWS::CloudFormation::Stack PostsController
10:20:12PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiDeployment20191230221900
10:20:13PM CREATE_IN_PROGRESS AWS::CloudFormation::Stack ApiDeployment20191230221900 Resource creation Initiated
10:20:23PM CREATE_COMPLETE AWS::CloudFormation::Stack ApiDeployment20191230221900
10:21:03PM CREATE_COMPLETE AWS::CloudFormation::Stack JetsPreheatJob
10:21:05PM UPDATE_COMPLETE_CLEANUP_IN_PROGRESS AWS::CloudFormation::Stack demo-prod
10:21:05PM UPDATE_COMPLETE AWS::CloudFormation::Stack demo-prod
Stack success status: UPDATE_COMPLETE
Time took for stack deployment: 2m 2s.
Prewarming application.
API Gateway Endpoint: https://d2uq5jz8f9.execute-api.us-west-2.amazonaws.com/prod/
$ echo $?
0
$

Wondering if you’re running into an edge case bug. :face_with_monocle:


#11

ah found what the issue was: I was deploying using

yes 'no' | jets deploy

when I swapped to JETS_AGREE=no instead of using yes, it worked